Skip to main content

Module methods

Module methods 

Source
Expand description

Canonical MCP JSON-RPC method names.

Centralizing these as constants prevents the class of typo bug where a method name is spelled slightly wrong at a call site (e.g. the lifecycle notification notifications/initialized being sent as bare initialized), which the wire protocol silently ignores rather than rejecting.

Structs§

Final2026Method
Exact direction and envelope metadata for one active MCP 2026-07-28 core method.
Legacy2024ClientCapabilities
Typed shape of the 2024-11-05 client capabilities object.
Legacy2024ListChangedCapability
Exact 2024-11-05 listChanged capability shape.
Legacy2024Method
Exact direction, envelope, and capability metadata for one tagged legacy method.
Legacy2024ResourcesCapability
Exact 2024-11-05 resources capability shape.
Legacy2024RootsCapability
Exact 2024-11-05 root capability shape.
Legacy2024ServerCapabilities
Typed shape of the 2024-11-05 server capabilities object.
Legacy2024WireError
An exact-2024 raw wire admission failure.

Enums§

Final2026Direction
Direction permitted by the active MCP 2026-07-28 core message unions.
Final2026EnvelopeKind
JSON-RPC envelope kind required by an active MCP 2026-07-28 core method.
Final2026Peer
Peer that originated an MCP 2026-07-28 core message.
Legacy2024Capability
Capability shape that owns a tagged method in the pinned legacy schema.
Legacy2024Direction
Direction permitted by the 2024-11-05 tagged union.
Legacy2024Envelope
A decoded exact-2024 JSON-RPC envelope.
Legacy2024EnvelopeError
One exact-2024 admission failure, split by JSON-RPC error taxonomy.
Legacy2024EnvelopeKind
JSON-RPC envelope kind required for a tagged method.
Legacy2024ResultDisposition
Exact disposition of a result at the 2024-11-05 shared-result boundary.
Legacy2024ResultKind
Classifies a server result after exact-2024 lossless admission.

Constants§

COMPLETION_COMPLETE
Completion request.
FINAL_2026_07_28_METHODS
All and only the method literals in the active MCP 2026-07-28 core request and notification unions.
INITIALIZE
Lifecycle initialize request.
LEGACY_2024_11_05_METHODS
All and only the 24 method literals in the pinned MCP 2024-11-05 schema.
LEGACY_2024_11_05_PROTOCOL_VERSION
The only legacy MCP wire version represented by this isolated surface.
LEGACY_2024_11_05_SCHEMA_JSON
Exact official MCP 2024-11-05 Draft 7 JSON schema, vendored as a read-only source input. This is deliberately not synthesized from newer protocol types: consumers can inspect the pinned source of truth directly.
LEGACY_2024_11_05_SCHEMA_SHA256
SHA-256 of the pinned official 2024-11-05 JSON schema.
LOGGING_SET_LEVEL
Logging set-level request.
NOTIFICATIONS_CANCELLED
Cancellation notification.
NOTIFICATIONS_INITIALIZED
Lifecycle initialized notification (spec-correct name).
NOTIFICATIONS_MESSAGE
Logging message notification.
NOTIFICATIONS_PROGRESS
Progress notification, valid in either direction.
NOTIFICATIONS_PROMPTS_LIST_CHANGED
Prompt-list-change notification.
NOTIFICATIONS_RESOURCES_LIST_CHANGED
Resource-list-change notification.
NOTIFICATIONS_RESOURCES_UPDATED
Resource-update notification.
NOTIFICATIONS_ROOTS_LIST_CHANGED
Roots-list-change notification.
NOTIFICATIONS_SUBSCRIPTIONS_ACKNOWLEDGED
Final subscription-established notification.
NOTIFICATIONS_TOOLS_LIST_CHANGED
Tool-list-change notification.
PING
Ping request.
PROMPTS_GET
Prompts get request.
PROMPTS_LIST
Prompts list request.
RESOURCES_LIST
Resources list request.
RESOURCES_READ
Resources read request.
RESOURCES_SUBSCRIBE
Resource-subscription request.
RESOURCES_TEMPLATES_LIST
Resource templates list request.
RESOURCES_UNSUBSCRIBE
Resource-unsubscription request.
ROOTS_LIST
Server-to-client roots list request.
SAMPLING_CREATE_MESSAGE
Server-to-client sampling request.
SERVER_DISCOVER
Final stateless server-discovery request.
SUBSCRIPTIONS_LISTEN
Final long-lived subscription request.
TOOLS_CALL
Tools call request.
TOOLS_LIST
Tools list request.

Functions§

classify_legacy_2024_result
Classifies a result before it can cross from shared handling to exact 2024.
decode_legacy_2024_11_05_client_capabilities
Validates and decodes the exact 2024-11-05 client capability shape.
decode_legacy_2024_11_05_envelope
Decodes one exact MCP 2024-11-05 JSON-RPC envelope before any lifecycle or dispatch work. Top-level batches, modern method literals, invalid IDs, and 2025-11-25 initialization are rejected at this pure raw-admission boundary.
decode_legacy_2024_11_05_envelope_classified
Decodes one exact-2024 envelope, classifying failures by taxonomy.
decode_legacy_2024_11_05_server_capabilities
Validates and decodes the exact 2024-11-05 server capability shape.
final_2026_07_28_method
Looks up one exact active MCP 2026-07-28 core method literal.
legacy_2024_11_05_method
Looks up one exact tagged 2024-11-05 method literal.
legacy_2024_11_05_schema
Parses the pinned legacy schema, retaining its exact source bytes in LEGACY_2024_11_05_SCHEMA_JSON.
translate_legacy_2024_result
Returns an ordinary complete result unchanged only when it has an exact 2024 representation for method.
validate_legacy_2024_11_05_initialize_result
Validates initialization-era server metadata before a consumer accepts it.
validate_legacy_2024_11_05_method_params
Validates the required exact-2024 parameter members for the methods used by the server adapter. JSON-RPC itself already guarantees an object whenever parameters are present; this function adds the pinned method-level shape.