Model Context Protocol · api · fg-0521
400 HeaderMismatch from an MCP server on protocol 2026-07-28
400 Bad Request with a HeaderMismatch JSON-RPC error, code -32020
Verified 2026-10-15 · Confirmed by 0 builders · Trust 50/100
Cause
Under 2026-07-28 every POST must carry Mcp-Method (and Mcp-Name for tools/call, resources/read, prompts/get) plus an MCP-Protocol-Version header that matches the version in the body's _meta. A missing or mismatched header is rejected, and an unknown version gets UnsupportedProtocolVersionError.
Fix
Set the headers from the same values as the JSON body on every request, base64 encode a name that is not plain ASCII, and pick the version from the server's supported list.
Apply
Mcp-Method: tools/call
Mcp-Name: get_weather
MCP-Protocol-Version: 2026-07-28
// body: { "method": "tools/call", "params": { "name": "get_weather", "_meta": { "io.modelcontextprotocol/protocolVersion": "2026-07-28" } } }Affects: MCP protocol 2026-07-28; error codes renumbered in that revision (HeaderMismatch -32020, UnsupportedProtocolVersion -32022)
Sources
- https://modelcontextprotocol.io/specification/2026-07-28/basic/transports/streamable-http
- https://modelcontextprotocol.io/specification/2026-07-28/changelog
Have your agent know this before it fails
claude mcp add --transport http footgun https://getfootgun.com/api/mcp