Expand description
Final MCP protocol-version header validation.
This module models the 2026-07-28 HTTP rule only: every request carries
an MCP-Protocol-Version header whose exact value matches the body’s
io.modelcontextprotocol/protocolVersion value. Transport code owns HTTP
header parsing and supplies the already-decoded field value here.
Structs§
- Final
Http Request Metadata - HTTP metadata mirrored from the final JSON-RPC request body.
- Final
Protocol Version - A validated final protocol version.
- Final
Request Admission - A request admitted through the final protocol-version boundary.
- Header
Mismatch Error - Typed local detail for a final
HeaderMismatchError. - Missing
Required Client Capability Error - Typed final error data for a missing required client capability.
- Request
Version Metadata - The request metadata whose HTTP and JSON body values mirror each other.
- Unsupported
Protocol Version Error - Typed data for a final unsupported-protocol-version response.
Enums§
- Header
Mismatch Reason - The exact header/body condition that failed final request admission.
- Protocol
Version Error - Why final protocol-version validation rejected a request.
- Request
Admission Error - Typed failure from final request version admission.
- Required
Capabilities Error - Why a caller could not construct required-capabilities error data.
Constants§
- FINAL_
PROTOCOL_ VERSION - The final protocol version implemented by this narrow modern surface.
- HEADER_
MISMATCH_ ERROR_ CODE - The final MCP JSON-RPC code for malformed, missing, or mismatched headers.
- MAX_
REQUIRED_ CAPABILITIES_ ERROR_ DATA_ BYTES - The maximum encoded size accepted for typed required-capabilities error data.
- MCP_
METHOD_ HEADER - The HTTP header that mirrors the JSON-RPC request method.
- MCP_
NAME_ HEADER - The HTTP header that mirrors a method-specific tool, resource, or prompt name.
- MCP_
PROTOCOL_ VERSION_ HEADER - The HTTP header that mirrors the body’s protocol-version metadata.
- MISSING_
REQUIRED_ CLIENT_ CAPABILITY_ ERROR_ CODE - The final MCP JSON-RPC code for a missing required client capability.
- SUPPORTED_
FINAL_ PROTOCOL_ VERSIONS - The exact protocol versions admitted by this final-only surface.
- UNSUPPORTED_
PROTOCOL_ VERSION_ ERROR_ CODE - The final MCP JSON-RPC code for a version the server does not support.
Functions§
- admit_
final_ http_ request - Admits the standard final HTTP header mirrors for a request.
- admit_
final_ request - Admits final request metadata using the required error precedence.
- validate_
final_ protocol_ version - Validates the final HTTP header/body protocol-version mirror.