Skip to content

Send MCP-Protocol-Version header in Streamable HTTP client transport#500

Merged
halter73 merged 3 commits intomodelcontextprotocol:mainfrom
halter73:protocol-version-header
Jun 17, 2025
Merged

Send MCP-Protocol-Version header in Streamable HTTP client transport#500
halter73 merged 3 commits intomodelcontextprotocol:mainfrom
halter73:protocol-version-header

Conversation

@halter73
Copy link
Copy Markdown
Contributor

@halter73 halter73 commented Jun 10, 2025

modelcontextprotocol/modelcontextprotocol#548 updated the MCP specification to require the following:

If using HTTP, the client MUST include the MCP-Protocol-Version: <protocol-version> HTTP header during any subsequent requests to the MCP
server, allowing the MCP server to respond based on the MCP protocol version.

The protocol version sent by the client SHOULD be the one negotiated during initialization.

If the server receives a request with a missing, invalid, or unsupported
MCP-Protocol-VERSION, it MUST respond with 400 Bad Request.

This updates the client Streamable HTTP transport to send this header.

Replaces #493

@halter73 halter73 requested a review from stephentoub June 10, 2025 15:08
Comment thread src/ModelContextProtocol.Core/Client/StreamableHttpClientSessionTransport.cs Outdated
halter73 added 2 commits June 17, 2025 13:35
# Conflicts:
#	src/ModelContextProtocol.Core/Client/StreamableHttpClientSessionTransport.cs
#	tests/ModelContextProtocol.Tests/ModelContextProtocol.Tests.csproj
@halter73 halter73 merged commit befa31d into modelcontextprotocol:main Jun 17, 2025
17 of 21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants