Skip to main content

Module dispatch

Module dispatch 

Source
Expand description

JSON-RPC dispatch for one HTTP request: version negotiation, header checks, server/discover, tools/list and tools/call, including confirmation round trips through requestState.

StructsΒ§

HttpRequest
One HTTP request to the MCP endpoint, framework-independent.
HttpResponse
The answer to one HTTP request, framework-independent.
McpServer
The MCP server: answers each request with the tools of its registry, run against the state S.
RpcError πŸ”’
ServerConfig πŸ”’
Deployment settings of an McpServer.

ConstantsΒ§

CONFIRMATION_TTL πŸ”’
DISCOVER_TTL_MS πŸ”’
SERVER_INFO_META_KEY πŸ”’
SERVER_NAME πŸ”’
SERVER_TITLE πŸ”’
TOOLS_LIST_TTL_MS πŸ”’
Short, so scope and role changes show up promptly.

FunctionsΒ§

confirmation_binding πŸ”’
Binds a confirmation to the user, the tool and its exact arguments, so a sealed state can’t be replayed by someone else or for another change.
to_json πŸ”’
A protocol value as JSON; one that doesn’t serialize is logged and becomes null.