Expand description
Mcp-Param-{Name}: tool arguments a client mirrors into HTTP headers.
2026-07-28 (SEP-2243). A tool’s inputSchema may mark a property with
x-mcp-header: "Region", and a client calling that tool over Streamable
HTTP must then send the argument’s value as Mcp-Param-Region. A server
that reads the body must check the two agree — an intermediary may have
routed on the header while this server is about to act on the body — and
refuse a disagreement with 400 and -32020 HeaderMismatch.
The rules here are the transport specification’s, quoted where they decide something: https://modelcontextprotocol.io/specification/2026-07-28/basic/transports/streamable-http#custom-headers-from-tool-parameters
- Only properties statically reachable through
propertieskeys count; an annotation underitems, a composition keyword, a conditional or a$refmakes the annotation invalid, and an invalid one is not enforced. - Only
string,integerandbooleanparameters may be annotated. - “Parameter value is
null” and “parameter not in arguments”: the server “MUST NOT expect the header”. “Client omits header but value is in body”: the server “MUST reject the request”. - A value wrapped as
=?base64?…?=is decoded before comparison, and one whose payload is not valid Base64 is refused; a value without the exact wrapper is literal. - Integers compare numerically, so
42.0and42agree.
Functions§
- check
- Checks every annotated argument against the
Mcp-Param-*headers. - decode
- Decodes a header value per the sentinel rule, or
Noneif it is invalid. - encode
- Encodes a value for a header that admits the Base64 sentinel.
- has_
invalid_ annotation - Whether
schemacarries anyx-mcp-headerannotation the transport specification forbids. - headers_
for - The
Mcp-Param-*headers a client must send forarguments.