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§
- Final2026
Method - Exact direction and envelope metadata for one active MCP 2026-07-28 core method.
- Legacy2024
Client Capabilities - Typed shape of the 2024-11-05 client capabilities object.
- Legacy2024
List Changed Capability - Exact 2024-11-05
listChangedcapability shape. - Legacy2024
Method - Exact direction, envelope, and capability metadata for one tagged legacy method.
- Legacy2024
Resources Capability - Exact 2024-11-05 resources capability shape.
- Legacy2024
Roots Capability - Exact 2024-11-05 root capability shape.
- Legacy2024
Server Capabilities - Typed shape of the 2024-11-05 server capabilities object.
- Legacy2024
Wire Error - An exact-2024 raw wire admission failure.
Enums§
- Final2026
Direction - Direction permitted by the active MCP 2026-07-28 core message unions.
- Final2026
Envelope Kind - JSON-RPC envelope kind required by an active MCP 2026-07-28 core method.
- Final2026
Peer - Peer that originated an MCP 2026-07-28 core message.
- Legacy2024
Capability - Capability shape that owns a tagged method in the pinned legacy schema.
- Legacy2024
Direction - Direction permitted by the 2024-11-05 tagged union.
- Legacy2024
Envelope - A decoded exact-2024 JSON-RPC envelope.
- Legacy2024
Envelope Error - One exact-2024 admission failure, split by JSON-RPC error taxonomy.
- Legacy2024
Envelope Kind - JSON-RPC envelope kind required for a tagged method.
- Legacy2024
Result Disposition - Exact disposition of a result at the 2024-11-05 shared-result boundary.
- Legacy2024
Result Kind - 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
initializerequest. - 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
initializednotification (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.