feat: implement MCP protocol version header support #404
+39
−6
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.
Add MCP-Protocol-Version header to all HTTP requests as required by MCP specification 2025-06-18. This enables proper server-side version negotiation and backwards compatibility handling.
Complies with MCP specification requirement that HTTP clients MUST include protocol version header on all requests to MCP servers.
Related to #398 , #363 , #250
Implementation Details:
MCP_PROTOCOL_VERSION
andMCP_PROTOCOL_VERSION_HEADER_NAME
constants to all HTTP transport classes2025-06-18
for streamable HTTP transports (WebClientStreamableHttpTransport, HttpClientStreamableHttpTransport)2024-11-05
for SSE transports (WebFluxSseClientTransport, HttpClientSseClientTransport) for backwards compatibilitySpecification Reference:
This change ensures full compliance with the MCP specification requirement that "the client MUST include the MCP-Protocol-Version HTTP header on all subsequent requests to the MCP server."
Add MCP protocol version header support to all HTTP transport implementations as required by MCP specification 2025-06-18.
Motivation and Context
The MCP specification 2025-06-18 requires that HTTP clients MUST include the
MCP-Protocol-Version
header on all requests to MCP servers. This enables:Without this header, servers cannot properly handle version-specific behavior and may not function correctly with clients using different protocol versions.
How Has This Been Tested?
Breaking Changes
No breaking changes. This is a backwards-compatible addition:
Types of changes
Checklist