Expand description
MCP server core — tool registration, initialization, and dispatch logic.
Structs§
- McpServer
- An MCP server that manages tools, resources, prompts, and dispatches calls.
Constants§
- LATEST_
PROTOCOL_ VERSION - The newest MCP protocol revision this server implements (modern, stateless).
- LEGACY_
LATEST_ PROTOCOL_ VERSION - The newest legacy (initialize-handshake) revision this server implements.
- LEGACY_
PROTOCOL_ VERSIONS - The legacy (initialize-handshake) revisions this server implements, newest
first —
SUPPORTED_PROTOCOL_VERSIONSminus its modern head. Theinitializehandshake negotiates among these only. - META_
PROTOCOL_ VERSION - The
_metakey carrying a modern request’s protocol version. - META_
SERVER_ INFO - The
_metakey carrying the server identity in results (server/discover). - META_
SUBSCRIPTION_ ID - The
_metakey tagging subscription-stream messages with the JSON-RPC id of thesubscriptions/listenrequest that opened them. - SUPPORTED_
PROTOCOL_ VERSIONS - MCP protocol versions this server understands, newest first.
Traits§
- Async
Tool Handler - Async tool-handler trait — the async counterpart to the synchronous
Handler.
Functions§
- request_
protocol_ version - Extract the modern-era protocol version from a request’s
params._meta, if present.Nonemeans the request speaks legacy.
Type Aliases§
- Handler
- Handler function type for MCP tool calls (synchronous).