Skip to content

Serve MCP 2026-07-28 stateless requests through the streamable proxy #5830

Description

@jhrozek

Part of #5755. Design: RFC THV-0081; arch doc §Changes → "Streamable proxy" and §Security invariant (branch stateless-transport-proxies-design, PR #5808). Security-critical.

Serve Modern (2026-07-28) stateless requests through the streamable (HTTP→stdio) proxy.

Changes

  • Wire ClassifyRevision into resolveSessionForRequest; add a Legacy/Modern mode flag as a transport property (not driven off the client-controlled MCP-Protocol-Version header).
  • Modern stateless routing: unconditionally mint a fresh per-request routing token and ignore/strip any client-supplied Mcp-Session-Id; do not mint a session or consult the session manager. (The existing sessionless branch is guarded on an absent session header, so a Modern request carrying one would otherwise fall through to session lookup and risk response cross-delivery.)
  • Modern message-shape enforcement: reject JSON-RPC batches and client-sent responses; GET/DELETE → 405.

Dependencies

Depends on #5755 foundation issue (the deepened classifier).

Verification

  • Concurrency cross-delivery test: two concurrent Modern requests sharing a JSON-RPC id, one carrying a foreign Mcp-Session-Id, must not cross-deliver responses.
  • Modern batches / client-sent responses rejected; GET/DELETE → 405.
  • MRTR InputRequiredResult pass-through: an ordinary response with an id, must traverse the dispatcher unchanged.
  • Legacy behavior unchanged.

May split into routing and shape-enforcement PRs.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions