[SEP-2575][SEP-2567] 2026-06 stateless support: stdio + InMemory transports#2132
Draft
felixweinberger wants to merge 3 commits into
Draft
[SEP-2575][SEP-2567] 2026-06 stateless support: stdio + InMemory transports#2132felixweinberger wants to merge 3 commits into
felixweinberger wants to merge 3 commits into
Conversation
|
@modelcontextprotocol/client
@modelcontextprotocol/server
@modelcontextprotocol/express
@modelcontextprotocol/fastify
@modelcontextprotocol/hono
@modelcontextprotocol/node
commit: |
This was referenced May 20, 2026
NEW core/shared/streamDriver.ts: minimal request->response correlator for pipe-shaped client transports (one _pending map keyed by RequestId AND String(id) for _meta.subscriptionId routing). sendAndReceive yields notifications then one response (or indefinite for subscriptions/listen); break/return() sends notifications/cancelled. Send-failure -> synthetic error response (no hang). onMessage routes; close() ends all pending. InMemoryTransport: composes StreamDriver. send() routes via _receive() (driver claims first, falls through to onmessage). close() closes driver. StdioClientTransport: composes StreamDriver. processReadBuffer routes to driver when protocolVersion is unset or stateless. setProtocolVersion() gates back to onmessage for legacy. Satisfies: 2575-R12 (client sendAndReceive contract, pipe transports)
…outers
NEW core/shared/serverStatelessRouter.ts: routeServerStateless() —
per-message branch on isStatelessRequest to StatelessHandlers
{dispatch,listen}; notifications/cancelled aborts matching _inflight
controller.
stdio + InMemory server-side: receive paths route via
routeServerStateless; close() aborts all in-flight.
stdio + InMemory client-side: sendAndReceive threads opts?.signal to
StreamDriver.
Satisfies: 2567-R1 (pipe), 2567-R2
Migrate existing connection-model tests to LegacyTestClient (client.test, server.test, mcp.test, elicitation.test, stateManagementStreamableHttp, taskResumability) — they exercise server-to-client RPCs / oninitialized which require the legacy initialize path. statelessAcceptance.test.ts: add 'Client over InMemory' describe block (auto-probe, legacy negotiate, subscribe demux, MRTR auto-resume). NEW zeroChangeConsumer.test.ts: InMemory describe.each over Server/McpServer ctors + MRTR hardening (accumulate, max-rounds, requestSampling).
dd9e762 to
af76de4
Compare
7995ab3 to
32ef72b
Compare
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Extends 2026-06 stateless support to stdio + InMemory transports. Additive:
StreamDriver(client-side correlation for pipe transports),serverStatelessRouter(server-side per-message router),sendAndReceiveimpls. Migrates 189 connection-model tests toLegacyTestClient.Motivation and Context
Same SEPs over non-HTTP transports.
How Has This Been Tested?
pnpm test:all(1367). InMemory acceptance scenarios +zeroChangeConsumer(same handler under both protocols).Breaking Changes
None.
Types of changes
Checklist