Skip to content

fix(mcp): adopt official SDK with bounded persistent stdio - #4899

Merged
EffortlessSteven merged 19 commits into
mainfrom
codex/3088-official-sdk-status
Sep 29, 2026
Merged

EffortlessSteven merged 19 commits into
mainfrom
codex/3088-official-sdk-status

Conversation

@EffortlessSteven

@EffortlessSteven EffortlessSteven commented Sep 29, 2026 •

Copy link
Copy Markdown
Member

Summary

ripr mcp uses the official Rust SDK for negotiation and request lifecycle. The status-only adapter retains finite stdio framing, cancellation-safe partial IO, correlated errors, and serial request admission until the matching response is fully written and flushed.

Swarm / Source Boundary

  • ordinary dependency, protocol, test and documentation development for ripr-swarm
  • release publishing or release-boundary changes

Source-of-truth Links

Proposal / governing issue: #3088.
Spec: MCP interoperability.
ADR / plan: ADR 0022, including all former-control dispositions and dependency admission.
Acceptance delta: delegate lifecycle to the SDK while preserving the read-only status authority boundary and finite cancellation-safe transport.

Candidate Relationships

Candidate branch: codex/3088-official-sdk-status; current head 1e359916b959029ccea9c89c7ef2359b25d1cae4, tree 26db6633725114c3f6b79f2646f83f0408c3859b.
Material prerequisite: merged #4911 (67de8927b5d39bd437d33272eda3b4d41b3d567b), normally merged without conflicts. MCP owner source, tests, Cargo manifest and lock remain byte-identical to prior SDK head 3f87. No proposed replacement candidate.

Scope

  • Typed SDK handler, persistent framing/writer/transport, dependency lock, focused controls and migration documentation.

Scope Classification

  • One architectural seam

Production delta: SDK owns negotiation and dispatch; adapter owns static status data and bounded stdio. Input limit is 256 KiB; output limit 128 KiB including delimiter. Oversized correlated IDs trigger bounded termination without substitute IDs. Persistent queued identity survives canceled writes/flushes; notifications and unmatched replies cannot release request admission. CLI runtime shutdown after service termination avoids waiting for uncancellable stdin work; this does not join that worker or qualify embedding/repeated sessions.

Evidence/support delta: 21 library controls, 4 official SDK-client sessions and 5 public stdio cases; bounded diagnostic harness observations retain executable custody and response stages without payload logging.

Single acceptance criterion: SDK-backed status discovery and response behavior retain authority boundaries and the exercised IO/admission invariants.
Non-goals: analysis authority, repair tools, HTTP, custom lifecycle, support promotion, performance or release qualification.

Support-tier Impact

  • changes MCP interoperability documentation

No support promotion. SDK owns protocol negotiation and compatibility mapping. Missing-resource compatibility and available-URI text are documented; one root-redacted resource/tool remains.

Policy Impact

  • doc artifacts
  • dependency
  • process/network

rmcp is pinned 3.5.0 (Apache-2.0/MSRV 1.88); six added transitive packages have exact admission recorded in the ADR, within repository MSRV 1.95. Current owning policy gates pass; this is not a vulnerability audit.

Proof

Exact current 1e proof Result
Windows workspace all-target compilation PASS
check-fast PASS: 15 expected gates, no skips, 1389 selector rows
precommit PASS: 6 named commands, complete 1389 paired changes / 1391 old-new path union
Linux required 36564584544 PASS; actualJUnit 10154 cases, 0 failures/errors/skipped cases
Current named MCP controls PASS: 21 library + 4 official SDK + 5 public stdio
Actual combined checkout b1e2f61; tree identical to current candidate; parents67de+1e
Source/retirement parity All 20 owned delta paths match CI, including absent removed legacy modules

Raw nextest summary reports 10154 passed and 1 skipped: output::executed_control::tests::write_executed_control_contract_fixtures is explicitly ignored because it writes committed fixtures. It is not an MCP omission; no executed JUnit case is skipped. Current required log records PRECOMMIT_RESULT=success. Local driver terminal0 and all 36 recorded owned PIDs absent before shared-target release.

Discriminating historical failures remain retained: local oversized output 143503 bytes versus 131072 limit; old SDK transport admitted 33 requests with held stdout rather than discovery plus one outstanding request. Current actual SDK controls check admission count, matching flushed-ID release, wrong/no-ID/notification nonrelease and canceled write/flush resumption. Earlier test-only constructor/lint/environment/PyPI fixture failures are repaired with separate retained receipts; they are not current passes.

Historical Windows 12a first-reply 10 s deadline had empty stdout/stderr; its cause remains NOT_ESTABLISHED in #4914. Later 3f diagnostic PASS is not a production root-cause repair and instrumentation can perturb timing. Historical3f focused Windows 21/4/5 evidence covers unchanged owners; it is not repeated current 1e Windows runtime execution.

Evidence packet: F:/code/Opencode/Rust/ripr-4382-proof/3088-1e359-hosted; local guards: .../3088-1e359-sdk-guards-v8. Required raw/context/JUnit and named cases are retained. Exact-head substantive REVIEW_READY is posted as COMMENT PRR_kwDOSiSx0c8AAAABPwsOEQ. Protected squash merged as 3f07824efb2c35898973d23ca6acad109f3366c6 at 2026-09-29T12:35:44Z; broader issue #3088 remains open for explicitly unestablished predicates.

Claim Boundary

Finite executed controls establish the tested SDK status, IO, correlated-ID and admission behavior. They do not establish general resource bounds, full MCP conformance, speed, Windows live PyPI support, embedding guarantees or release readiness. Reference-corpus departures in raw guard output remain observations; policy pass is not an ideal-product claim.

Rollback

Revert adapter/dependency/documentation changes normally. No persisted-data migration or release action.

Spec-Test-Code Traceability

  • Spec: docs/interop/mcp.md.
  • Code: typed server.rs; persistent framing.rs, writer.rs, transport.rs.
  • Tests: adjacent controls, tests/mcp_sdk.rs, tests/mcp_stdio.rs using actual SDK/just-built CLI.
  • Golden outputs: none added.
  • Metrics: no numeric memory/performance claim.
  • ADR/learning: ADR0022 migration and former-control disposition; residual investigate(mcp): distinguish native Windows empty first-reply deadline #4914.

Static Language Check

  • Required terminology and explicit unknown stop reasons retained.

CI Economics

n/a: no workflow, protection or routing changes; existing required gates used.

Engineering Check

  • Current owning source/dependency/process policy gates passed.
  • Public protocol behavior documented.

Gates

  • cargo check --workspace --all-targets --locked --jobs 2
  • cargo xtask check-fast (15 gates includingfmt/strictClippy/policies)
  • cargo xtask precommit (six exact commands)
  • cargo nextest run --workspace --profile ci (current Linux required producer)
  • package/publish dry-run, cargo doc and editor/package tests: not run for this status-only seam

@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@coderabbitai

coderabbitai Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: c3834035-9279-45c4-adfb-80ffa5e34653

📥 Commits

Reviewing files that changed from the base of the PR and between 67de892 and 1e35991.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (19)
  • crates/ripr/Cargo.toml
  • crates/ripr/src/mcp/framing.rs
  • crates/ripr/src/mcp/mod.rs
  • crates/ripr/src/mcp/protocol.rs
  • crates/ripr/src/mcp/server.rs
  • crates/ripr/src/mcp/server/rpc.rs
  • crates/ripr/src/mcp/server/tests.rs
  • crates/ripr/src/mcp/server_tests.rs
  • crates/ripr/src/mcp/transport.rs
  • crates/ripr/src/mcp/transport_backpressure_tests.rs
  • crates/ripr/src/mcp/transport_tests.rs
  • crates/ripr/src/mcp/writer.rs
  • crates/ripr/src/mcp/writer_tests.rs
  • crates/ripr/tests/mcp_sdk.rs
  • crates/ripr/tests/mcp_stdio.rs
  • crates/ripr/tests/support/mcp_stdio_observation.rs
  • docs/adr/0022-mcp-is-a-bounded-projection.md
  • docs/interop/mcp.md
  • policy/process_allowlist.txt
 __________________________________________________________
< Solving problems you didn't know you were about to have. >
 ----------------------------------------------------------
  \
   \   \
        \ /\
        ( )
      .( o ).
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@EffortlessSteven EffortlessSteven left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reviewed_head_sha: 1e35991
integration_basis: normal merge of prior SDK 3f87 and material prerequisite #4911 (67de892); current Linux checkout b1e2f61 has candidate-identical tree 26db6633.
claim_boundary: official SDK lifecycle for the inherited read-only, root-redacted status tool/resource, with finite cancellation-safe IO and matching-response-flush request admission.
changed_surfaces_and_semantic_owners_inspected: complete 20-path diff, SDK handler/lifecycle consumers, framing/writer/transport, manifests/lock, process policy, ADR 0022 and interop. Root independently reread prior 239/f612/12a semantic reviews, actual current server/interop and 12a-to-1e owner delta; no conflict resolution or MCP production changes accompanied the normal prerequisite merge.
blocking_findings: none.
proof_and_ci_observed: current all-target compilation, fast fifteen gates and six precommit commands PASS; exact 1389 kind/path/old_path pairs and 1391 path union matched independently, no skipped gates or limitations. Linux required run 36564584544 SUCCESS, actual JUnit 10154/0 failure/0 error/0 skipped cases, all 30 unique MCP cases (21 library, four official SDK, five public stdio) PASS. Raw summary separately records one explicitly ignored committed-fixture writer; it is not MCP coverage. Actual PRECOMMIT_RESULT=success and all 20 owned paths match CI including removed modules absent.
wrong_behavior_oracle_challenge: retained oversized-output failure 143503 versus 131072 bytes and old held-stdout admission of 33 requests discriminate the repaired seams. Current actual SDK typed-admission witness and partial-write/held-flush cancellation, matching-ID, wrong/no-ID, notification and fatal blocked-input controls exercise the intended boundaries; public held-stdin exit denies helpful EOF.
proof_or_review_missing: bot quota/unavailable output is missing automated review, not clean review. The accountable root supplied substantive current-head acceptance. Historical Windows first-reply deadline cause remains NOT_ESTABLISHED in #4914; later diagnostic success is not its repair.
residual_assumptions_and_non_claims: finite controls do not qualify full MCP conformance, analysis authority, general resource bounds, embedding/repeated sessions, blocking-stdin worker joining, performance, Windows live PyPI or release readiness. Guard policy success is not an ideal reference-corpus verdict. Broader #3088 acceptance remains separately reconciled.
disposition: REVIEW_READY.

@EffortlessSteven
EffortlessSteven marked this pull request as ready for review September 29, 2026 12:35
@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@EffortlessSteven
EffortlessSteven merged commit 3f07824 into main Sep 29, 2026
27 of 29 checks passed
@EffortlessSteven
EffortlessSteven deleted the codex/3088-official-sdk-status branch September 29, 2026 12:35
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-29T12:40:38.655924Z 1e35991 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 potential issue.

Devin Review

Comment thread docs/interop/mcp.md
Comment on lines +94 to +98
standard JSON-RPC codes. The pinned official Rust SDK owns negotiation,
dispatch, correlation and cancellation. Syntax-invalid JSON is ignored;
well-formed messages with invalid typed shapes receive Invalid Request and
the transport can read the next frame. Unknown request IDs are omitted in SDK
error responses; readable IDs remain correlated. Messages are capped at

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 Changelog retains retired MCP error contract

The existing MCP changelog entry still promises an id on every error. The SDK migration omits unknown IDs and ignores syntax-invalid JSON; a follow-up entry can distinguish the current contract from its history.

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1e359916b9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +66 to +69
ServerCapabilities::builder()
.enable_tools()
.enable_resources()
.build(),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Restore resource-template listing

The previous adapter returned an empty successful result for resources/templates/list, but this ServerHandler advertises resource support without implementing list_resource_templates; the SDK default therefore returns Method Not Found. MCP clients that enumerate templates as part of resource discovery can now abort before reaching the remaining status resource. Implement the typed empty-list handler and add an SDK/public-stdio regression case for this method. Validation: cargo test -p ripr mcp. Confidence: High.

Useful? React with 👍 / 👎.

Comment on lines +80 to +84
The server feature adds the following locked transitive packages. Their
published manifest declarations fit the repository's Rust 1.95 and
MIT/Apache-2.0 license posture; this is not a vulnerability-audit result.
Cargo generated the lockfile, and dependency-only `cargo fetch --locked`
completed after resolving the new graph.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Make the dependency-admission inventory complete

This paragraph presents the following table as the locked transitive packages added by the server feature, but the same commit's lockfile adds 24 package names, including direct rmcp dependencies such as chrono 0.4.45 and tokio-stream 0.1.18 that are absent from the six-row table. That makes the retained license/MSRV admission record incomplete and can cause later dependency reviews to treat unrecorded packages as already assessed. List the complete introduced graph or explicitly narrow the claim and document where the remaining packages were admitted; validate it against the parent-to-candidate Cargo.lock package-name diff. Confidence: High.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant