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.
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-Versionheader when the client sends the HTTP request. For example,MCP-Version: 2025-06-18means the client is using the 2025-06-18 version.Describe alternatives you've considered
We can read the body and parse the
initializerequest for the protocolVersion field to get the MCP version. But it would be cumbersome because of:mcp-session-idheader, which is set after initialization.