Expand description
Protocol revision negotiation and MCP 2026-07-28 wire envelopes.
MCP 2025-11-25 uses a connection-scoped initialize handshake. MCP
2026-07-28 is stateless: every request declares its version, client
identity, and capabilities in _meta. Keeping this behavior in one module
prevents revision checks from leaking into application handlers.
Structs§
- Connect
Result - Revision-neutral result returned when a client establishes protocol behavior.
- Discover
Params - Parameters for
server/discover. - Discover
Result - Result of the stateless
server/discoverrequest. - Input
Required Result - A modern server response that asks the client to provide in-band input and retry.
- Modern
Request Context - Parsed modern request information. It is request-scoped by design.
- Negotiated
Protocol - Stable record of the protocol selected for a connection.
- Request
Meta Object - Required metadata envelope for a 2026-07-28 request.
- Tool
Header Mapping
Enums§
- Cache
Scope - Cache sharing policy introduced by MCP 2026-07-28.
- Operation
Result - A version-neutral operation result for MRTR-aware applications.
- Protocol
Era - The lifecycle family selected for an active client.
- Protocol
Mode - Runtime protocol selection policy.
- Result
Type - The discriminant present on all modern successful results.
Constants§
- CLIENT_
CAPABILITIES_ META_ KEY - Reserved request
_metakey carrying per-request client capabilities. - CLIENT_
INFO_ META_ KEY - Reserved request
_metakey carrying client identity. - HEADER_
MISMATCH - MCP-defined header/body mismatch error code.
- LEGACY_
PROTOCOL_ VERSION - Stateful MCP protocol revision retained for production interoperability.
- MCP_
METHOD_ HEADER - Standard HTTP method routing header.
- MCP_
NAME_ HEADER - Standard HTTP resource/name routing header.
- MCP_
PROTOCOL_ VERSION_ HEADER - Standard HTTP protocol revision header.
- MISSING_
REQUIRED_ CLIENT_ CAPABILITY - MCP-defined missing client capability error code.
- MODERN_
PROTOCOL_ VERSION - Final stateless MCP protocol revision supported by Prism v3.
- PROTOCOL_
VERSION_ META_ KEY - Reserved request
_metakey carrying the protocol revision. - SERVER_
INFO_ META_ KEY - Reserved result
_metakey carrying server identity. - SUPPORTED_
PROTOCOL_ VERSIONS - Protocol revisions supported by a dual-stack Prism server, in preference order.
- UNSUPPORTED_
PROTOCOL_ VERSION - MCP-defined unsupported revision error code.
Functions§
- decode_
http_ header_ value - Decode and validate an MCP HTTP routing-header value.
- decorate_
modern_ request - Add or replace the required modern
_metafields without disturbing application-defined metadata. - decorate_
modern_ result - Convert a handler-produced object into a standards-compliant modern result.
- encode_
http_ header_ value - Encode a body string as an MCP HTTP routing-header value.
- is_
cacheable_ method - List/discovery operations that require explicit cache policy in 2026-07-28.
- is_
legacy_ only_ method - Methods removed from the stateless 2026 core.
- is_
method_ not_ found - Test whether an error is the one safe automatic-downgrade signal.
- json_
rpc_ error_ details - Map SDK errors to their JSON-RPC code and structured MCP error data.
- modern_
request_ context - Parse and validate the required modern request envelope.
- request_
protocol_ version - Extract the modern protocol version from a request body for HTTP routing.
- request_
routing_ name - Derive the
Mcp-Nameheader value from the corresponding request field. - tool_
call_ headers - Build the custom HTTP headers required for one tool call.
- tool_
header_ mappings - Extract and validate
x-mcp-headerannotations from a tool input schema. - validate_
http_ headers - Validate standard HTTP routing headers against a modern request body.
- validate_
tool_ call_ headers - Validate received
Mcp-Param-*values against a tool call body.