Skip to content

fix(mcp): checkpoint transport lifecycle and isolation work - #375

Draft
benbrandt wants to merge 1 commit into
mainfrom
work/mcp-over-acp-wip
Draft

benbrandt wants to merge 1 commit into
mainfrom
work/mcp-over-acp-wip

Conversation

@benbrandt

Copy link
Copy Markdown
Member

Draft checkpoint — not ready to merge

This preserves work started against the connection-oriented MCP-over-ACP draft. The agreed stabilization target is now MCP 2026-07-28 ONLY, with no legacy compatibility requirement. The stateful HTTP adapter and connect/disconnect consumer API here are not the intended final design and may be removed rather than maintained.

Companion RFD modernization audit: agentclientprotocol/agent-client-protocol#2222

Work captured

  • Supervise both halves of native MCP connections and wait for child cleanup before disconnect acknowledgement; contain individual child failures and settle requests already dispatched to the child.
  • Isolate logical HTTP sessions on a shared listener, create native connections lazily, and wait for native disconnect on DELETE. This session/header/initialize design is superseded by the latest-only stateless target.
  • Add a runtime-agnostic native consumer transport for v1/v2 ACP, explicit close, cancellation cleanup, pending reverse-request cleanup, and a direct ACP example using real rmcp client/server traffic.
  • Add lifecycle and HTTP isolation tests; update the book and changelogs, explicitly labeling this work as an older-model checkpoint.

Reusable vs superseded

Reusable: error/resource ownership investigation, per-request cleanup patterns, IDs/metadata preservation, isolation tests, explicit capability propagation.

Superseded/not a compatibility promise: MCP initialization, connection/session lifecycle as public transport contract, reverse RPC model, MCP-Session-Id, GET/DELETE session engine. The RFD audit recommends direct serverId routing and request-scoped notifications/cancellation with discovery, MRTR, and subscriptions. No dual-era mode is planned.

Validation

  • cargo fmt --all -- --check passed.
  • cargo run -p agent-client-protocol-rmcp --example native_mcp_over_acp --features native_mcp_example passed, printing the echo tool.
  • mdbook build and git diff --check passed.
  • Component checkpoints passed their new v1/v2 lifecycle, native consumer, and real HTTP session tests.
  • The combined just test run is NOT green: it stops at agent-client-protocol-conductor/tests/trace_mcp_tool_call.rs, whose expected trace still has the old eager-connect/no-disconnect sequence. The merged implementation connects lazily and records disconnect. The snapshot has not been rewritten to bless a superseded design.

Known incomplete work

  • Native requests queued in the relay at shutdown can still lose responders; in-flight request cleanup is covered but queued-request and handler-drop cases need work.
  • Aborting HTTP initialization before its response can leave an unadvertised session alive until listener shutdown; no idle timeout.
  • DELETE during pending forward/reverse requests needs explicit regression coverage.
  • rmcp 2.2.0 recognizes the 2026-07-28 string but still defaults to 2025-11-25 and does not provide the required modern service model; this PR does not claim current MCP conformance.

Keep this PR draft while the new wire contract and modern MCP dependency path are settled. Native stateless support can land independently of an optional modern HTTP adapter.

This branch has not been deployed

No deployments
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