Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 17, 2025

Conversation

halter73
Copy link
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
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