Skip to main content

Module version

Module version 

Source
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§

ConnectResult
Revision-neutral result returned when a client establishes protocol behavior.
DiscoverParams
Parameters for server/discover.
DiscoverResult
Result of the stateless server/discover request.
InputRequiredResult
A modern server response that asks the client to provide in-band input and retry.
ModernRequestContext
Parsed modern request information. It is request-scoped by design.
NegotiatedProtocol
Stable record of the protocol selected for a connection.
RequestMetaObject
Required metadata envelope for a 2026-07-28 request.
ToolHeaderMapping

Enums§

CacheScope
Cache sharing policy introduced by MCP 2026-07-28.
OperationResult
A version-neutral operation result for MRTR-aware applications.
ProtocolEra
The lifecycle family selected for an active client.
ProtocolMode
Runtime protocol selection policy.
ResultType
The discriminant present on all modern successful results.

Constants§

CLIENT_CAPABILITIES_META_KEY
Reserved request _meta key carrying per-request client capabilities.
CLIENT_INFO_META_KEY
Reserved request _meta key 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 _meta key carrying the protocol revision.
SERVER_INFO_META_KEY
Reserved result _meta key 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 _meta fields 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-Name header 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-header annotations 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.