fix(client): accept the draft protocol version the json-schema-ref-no-deref mock advertises#398
Merged
Merged
Conversation
…-deref mock advertises The scenario's hand-rolled server/discover handler advertises supportedVersions: ['2026-07-28'], but every other method is delegated to StreamableHTTPServerTransport from the pinned SDK (^1.29.0), whose version whitelist tops out at 2025-11-25. A SEP-2575 client that honors the negotiated version then gets HTTP 400 on tools/list, and the sep-2106-no-network-ref-deref check can never run. Extend the existing server/discover workaround to the version check: rewrite an incoming MCP-Protocol-Version: 2026-07-28 header to the SDK's LATEST_PROTOCOL_VERSION before delegating (patching rawHeaders too, since the SDK's Node adapter rebuilds its web-standard Request from rawHeaders). Add a stateless-draft-client regression test. Fixes #397 Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01N4TdyLB13XSsPwNScYHf4C
commit: |
pcarleton
approved these changes
Jul 8, 2026
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.
Requested by Paul Carleton · Slack thread
Fixes #397
Before / After
Before: the
json-schema-ref-no-derefmock's hand-rolledserver/discoverhandler advertisessupportedVersions: ["2026-07-28"], but every other method is delegated toStreamableHTTPServerTransportfrom the pinned@modelcontextprotocol/sdk@^1.29.0, whose version whitelist tops out at2025-11-25. A SEP-2575 client that probesserver/discoverand then honors the negotiated version gotHTTP 400 Bad Request: Unsupported protocol version: 2026-07-28ontools/list, so thesep-2106-no-network-ref-derefcheck always reported FAILURE ("Client did not call tools/list...") for a fully conformant client.After: the same client's
tools/listsucceeds (HTTP 200 with the tool schema), the client can be evaluated on the actual SEP-2106 behavior, and the check passes/fails on$refhandling as intended. Clients sending an already-SDK-supported version (e.g.2025-11-25) or a genuinely bogus version are unaffected.How
Extends the existing
server/discoverworkaround (the pattern from #347) to the version whitelist the pinned transport enforces: before delegating a POST to the SDK transport, an incomingMCP-Protocol-Version: 2026-07-28header — exactly the version the scenario's ownserver/discoveradvertises — is rewritten to the SDK'sLATEST_PROTOCOL_VERSION. Bothreq.headersandreq.rawHeadersare patched, because the SDK's Node adapter (@hono/node-server) rebuilds its web-standardRequestfromrawHeaders. A regression test drives the scenario with a stateless SEP-2575 client (via the harness'ssendStatelessRequest) that negotiates viaserver/discoverand then callstools/listwith the draft version header; it fails with HTTP 400 without the fix and passes with it.Local verification:
npm run check(typecheck + eslint + prettier),npm test(355 passed), andnpm run buildall pass.🤖 Generated with Claude Code
https://claude.ai/code/session_01N4TdyLB13XSsPwNScYHf4C
Generated by Claude Code