Skip to main content

Module protocol

Module protocol 

Source
Expand description

JSON-RPC 2.0 message types used by MCP.

Re-exportsยง

use serde::Deserialize; ๐Ÿ”’
use serde::Deserialize; ๐Ÿ”’
use serde::Serialize; ๐Ÿ”’
use serde::Serialize; ๐Ÿ”’
use serde_json::Value; ๐Ÿ”’

Structsยง

JsonRpcRequest
A JSON-RPC request from the claude binary.
JsonRpcResponse
A JSON-RPC response from the MCP server back to the claude binary. Outbound only - we construct these, never parse them.
McpError
Standard MCP error body.
ServerInfo
Server metadata in initialize response.
ToolDescription
A tool as described in the tools/list response.

Enumsยง

JsonRpcResult
Typed successful-response payload. Outbound only, like its envelope: a Deserialize here would make the fieldless Empty match any object, so every unrecognised result would parse successfully rather than erroring.

Constantsยง

LATEST_PROTOCOL_VERSION
Answered when the client asks for a revision we do not speak.
SUPPORTED_PROTOCOL_VERSIONS
MCP protocol revisions this server speaks, newest first.