What is JSON-RPC?

JSON-RPC is a lightweight remote-procedure-call protocol that encodes requests and responses as JSON objects; the Model Context Protocol uses JSON-RPC 2.0 as its wire format.

JSON-RPC is a simple, transport-agnostic protocol for calling a method on a remote system by sending a small JSON object. A JSON-RPC 2.0 request carries a method name, a params object, and an id; the responder replies with a result or an error tagged with the same id, and notifications (messages with no id) let either side send fire-and-forget events. The Model Context Protocol is built directly on JSON-RPC 2.0: every interaction between an MCP client and server, initialize, tools/list, tools/call, resources/read, is a JSON-RPC message. Because JSON-RPC says nothing about how bytes move, MCP can carry these same messages over different transports, framing them on stdio for local servers or over Streamable HTTP for remote ones. Understanding JSON-RPC demystifies a lot of MCP: when you inspect traffic with a tool like MCP Inspector, what you are reading is a stream of JSON-RPC requests and responses with the protocol's method names.