Skip to main content

Module server

Module server 

Source
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_VERSIONS minus its modern head. The initialize handshake negotiates among these only.
META_PROTOCOL_VERSION
The _meta key carrying a modern request’s protocol version.
META_SERVER_INFO
The _meta key carrying the server identity in results (server/discover).
META_SUBSCRIPTION_ID
The _meta key tagging subscription-stream messages with the JSON-RPC id of the subscriptions/listen request that opened them.
SUPPORTED_PROTOCOL_VERSIONS
MCP protocol versions this server understands, newest first.

Traits§

AsyncToolHandler
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. None means the request speaks legacy.

Type Aliases§

Handler
Handler function type for MCP tool calls (synchronous).