Compatibility · troubleshooting record
MCP Streamable HTTP request fails with HeaderMismatch (-32020)
The 2026-07-28 MCP specification requires the MCP-Protocol-Version HTTP header to match the protocol version in the request metadata. A mismatch returns HTTP 400 with the MCP-specific HeaderMismatch error. Older clients and servers may not implement this header yet.
Symptoms
- HTTP 400 with error code -32020 or HeaderMismatch.
- The request works with an older transport or client version.
- Server logs show a protocol version header that does not match the body.
Confirmed causes
These causes have a documented basis. They may not be the cause of your specific failure.
Client and server implement different protocol versions
The 2026-07-28 spec requires MCP-Protocol-Version to match the protocolVersion in request metadata.
An intermediary strips or rewrites the MCP-Protocol-Version header
Proxies and API gateways may forward only a subset of headers.
A handwritten request omits the header or metadata field
Both the header and the request metadata must be present and consistent for that protocol version.
Possible causes
- The client predates the header requirement.
- The server has not been updated for the latest protocol version.
- The endpoint is a compatibility shim that only supports older versions.
What still needs verification
- The protocol version each side supports.
- Whether the header reaches the server unchanged.
- Whether the server advertises backward compatibility.
Affected environments
Fixes
Align protocol versions
- Update the client or server to a version that supports the same protocol revision.
- Ensure MCP-Protocol-Version matches the request metadata protocol version.
- Test directly against the endpoint before adding a proxy.
Preserve protocol headers
- Configure proxies to forward MCP-Protocol-Version and related MCP headers.
- Do not transform the JSON body's protocol metadata.
- Return a clear version error rather than a generic 500.
Verify the fix
- The request and response use compatible protocol versions.
- The server no longer returns HeaderMismatch.
- Tool discovery and a sample call succeed.
Paste the configuration into the Config Doctor. It runs in your browser, never uploads the file, and can show structural issues and safe fixes.
Why we believe this
- modelcontextprotocol.io/specification/2026-07-28/basic/transports/streamable-httpOfficial documentation · checked Oct 23, 2026 · documented
The specification defines protocol version headers, method/name metadata headers, Origin validation, and endpoint requirements.
- modelcontextprotocol.io/specification/2026-07-28/basic/index#error-codesOfficial documentation · checked Oct 23, 2026 · documented
The 2026-07-28 MCP specification defines JSON-RPC and MCP-specific error codes.