feat: allow overriding protocol versions in Client, Server, and Transport#1448
Merged
mattzcarey merged 5 commits intomainfrom Feb 3, 2026
Merged
feat: allow overriding protocol versions in Client, Server, and Transport#1448mattzcarey merged 5 commits intomainfrom
mattzcarey merged 5 commits intomainfrom
Conversation
|
@modelcontextprotocol/client
@modelcontextprotocol/server
@modelcontextprotocol/express
@modelcontextprotocol/hono
@modelcontextprotocol/node
commit: |
b3b05d2 to
304ca3c
Compare
…port Adds options to configure protocol versions for cases where the SDK's default version list doesn't include versions needed by clients or servers. - Add `protocolVersion` and `supportedProtocolVersions` options to ClientOptions - Add `protocolVersion` and `supportedProtocolVersions` options to ServerOptions - Add `supportedProtocolVersions` option to WebStandardStreamableHTTPServerTransportOptions - Add example showing custom protocol version configuration with Hono This enables servers using older SDK versions to support newer protocol versions (like 2025-11-25) without waiting for SDK updates.
Server now passes supportedProtocolVersions to transport during connect(), eliminating the need to configure versions in both places. - Add setSupportedProtocolVersions to Transport interface - Server.connect() calls transport.setSupportedProtocolVersions() - Replace Hono example with simpler Node.js http example Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
9220666 to
74d938f
Compare
Remove protocolVersion option from both Client and Server. First version in supportedProtocolVersions is now used as: - Server: fallback when client requests unsupported version - Client: version sent to server during initialization Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Consolidate the option in ProtocolOptions and handle transport version passing in Protocol.connect(). Client and Server inherit the protected _supportedProtocolVersions field. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
KKonstantinov
approved these changes
Feb 3, 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.
Summary
Adds
supportedProtocolVersionsoption toProtocolOptionsfor custom protocol version support.connect()Usage
Test plan
pnpm typecheck:allpassespnpm test:allpasses🤖 Generated with Claude Code