JSON-RPC
JSON-RPC is a lightweight remote procedure call (RPC) protocol that uses JSON as its data exchange format. It allows clients to invoke methods on a remote server over a network and supports both request-response and notification (one-way message) communication patterns. The protocol is characterized by its simple structure, transport-layer independence, and cross-language compatibility, and can operate over multiple transport protocols including HTTP and WebSocket.
Core Facts
MCP采用客户端-服务器架构,基于标准化的JSON-RPC通信协议
Anthropic officially released the MCP specification at the end of 2024, adopting JSON-RPC 2.0 as the underlying communication protocol.
MCP基于JSON-RPC 2.0协议构建,支持请求-响应和通知两种消息模式
Timeline (last 90 days)
T3 Code uses ACP (Agent Client Protocol) to communicate with the local harness; ACP is a client-server communication protocol similar to LSP that exchanges messages via JSON-RPC.
A JSON-RPC error object typically contains code, message and an optional data field, used to express a call failure at the protocol layer.
A single MCP call may simultaneously produce an HTTP-layer error (such as a 4xx/5xx status code) and a JSON-RPC-layer error (such as a nonexistent method or invalid parameters).
The problem fixed by this patch is: when an HTTP request fails and the response body contains JSON-RPC error information, MCPClientError loses the original HTTP status code, request URL and response body.
Compared with binary protocols such as gRPC, JSON text transfer may bring additional overhead in very large context scenarios.
Among JSON-RPC standard error codes, -32700 indicates a parse error, -32601 indicates method not found, and -32602 indicates invalid params.
Message-based protocols such as JSON-RPC carry no framing information over pipes, so the writer must define message boundaries itself (such as line delimiting or length prefixes), and the SDK only forwards bytes.
Unlike REST APIs, JSON-RPC does not rely on HTTP verbs and URL paths to express semantics, but encapsulates operation intent in the message body, making it better suited to Agent scenarios that require dynamic discovery capability and bidirectional communication.
In the Python servers, the error code for an unknown tool changed from an isError result to a JSON-RPC -32602 error (Unknown tool: <name>), in both protocol eras.
With the stdio transport, the server runs as a child process of the client, exchanging JSON-RPC messages over standard input and output, with standard error used for logs.
15 more timeline events
All Facts (20)
MCP采用客户端-服务器架构,基于标准化的JSON-RPC通信协议
90%VerifiedAnthropic officially released the MCP specification at the end of 2024, adopting JSON-RPC 2.0 as the underlying communication protocol.
80%VerifiedMCP基于JSON-RPC 2.0协议构建,支持请求-响应和通知两种消息模式
80%VerifiedMCP(Model Context Protocol)是Anthropic于2024年底推出的开放标准,采用客户端-服务器架构和JSON-RPC协议通信
80%VerifiedBy defining a unified JSON-RPC 2.0 communication protocol, MCP simplifies the M×N adaptation problem into M+N.
80%VerifiedThe JSON-RPC 2.0 specification was first published by the JSON-RPC Working Group in 2010.
80%VerifiedThe Language Server Protocol (LSP) decouples language intelligence suggestion logic from the editor, enabling any programming language to implement the protocol once and obtain auto-completion and error detection in all LSP-compatible editors.
75%VerifiedIn MCP, JSON schema is used to describe tool input parameters; the host can use it to automatically generate call forms, validate parameters or reject invalid parameters in advance, but it does not constrain whether a tool should be called or whether a call is authorized.
70%VerifiedIn stdio transport, MCP server logs must be written to standard error (stderr), because extraneous standard output will corrupt the protocol stream.
65%VerifiedRPC (Remote Procedure Call) is action-centric, with interfaces directly describing callable functions; common implementations include Google's gRPC (based on Protocol Buffers and HTTP/2) and JSON-RPC.
65%VerifiedMCP distinguishes between protocol-level errors (such as connection drops and timeouts) and tool-level errors (such as invalid parameters and insufficient permissions).
65%VerifiedMCP's tool discovery mechanism queries the tool list of a connected Server via the tools/list interface, with parameter schemas based on the JSON Schema specification.
65%VerifiedLSP compresses the M×N relationship of editor-language integration into M+N, communicating through a standardized JSON-RPC protocol.
65%UnverifiedIn the MCP protocol, AI models trigger hardware operations through standardized JSON-RPC calls.
85%UnverifiedMCP选择JSON-RPC而非REST或GraphQL,是因为JSON-RPC天然支持双向通信和异步调用,更适合模型与工具之间需要实时响应的交互场景
80%UnverifiedLSP communicates based on the JSON-RPC 2.0 protocol, and language servers typically run as independent processes, communicating with editors via stdin/stdout or TCP.
60%UnverifiedCDP is based on the JSON-RPC specification, communicates bidirectionally via WebSocket, and exposes the browser's internal capabilities as a programmable interface.
60%UnverifiedMCP enables models to invoke external capabilities through a standardized JSON-RPC communication format, adopting a full-load design philosophy.
60%UnverifiedACP is essentially a JSON-RPC-based protocol that typically communicates with subprocesses via standard input/output (stdio).
60%UnverifiedT3 Code uses ACP (Agent Client Protocol) to communicate with the local harness; ACP is a client-server communication protocol similar to LSP that exchanges messages via JSON-RPC.
50%