You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add a special MCP-Version header on http transport can improve the MCP protocol detection #884
Is your feature request related to a problem? Please describe.
In some situations, we need to automatically detect the MCP request so that we can add corresponding features like observability and security to it. Especially, we also need to know which version of the protocol is used by the client.
Describe the solution you'd like
We can add an MCP-Version header when the client sends the HTTP request. For example, MCP-Version: 2025-06-18 means the client is using the 2025-06-18 version.
Describe alternatives you've considered
We can read the body and parse the initialize request for the protocolVersion field to get the MCP version. But it would be cumbersome because of:
It requires reading the whole body to detect if the request is MCP or not
If we miss the first request, we have no way to detect the version, though we can detect if it's MCP or not by the mcp-session-id header, which is set after initialization.
Activity
jonathanhefner commentedon Jul 1, 2025
This was added in the latest version of the spec: https://modelcontextprotocol.io/specification/2025-06-18/basic/transports#protocol-version-header 😄