JSON-RPC 2.0 gives MCP a lightweight, transport-independent message envelope with built-in request/response/notification semantics. MCP layers its method set and lifecycle on top.
Imagine sending a sticky note to a coworker asking them to do something. The note has a fixed layout: a version number, a verb (what you want done), a details section, and a tracking number so the reply can be matched back. JSON-RPC 2.0 is that sticky-note format, written as JSON. MCP is a set of agreed-upon verbs written on those notes: 'list the tools you have,' 'call this tool with these arguments,' 'read this resource.' The note format is JSON-RPC. The verbs are MCP.
Concept explanation~2 min read
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Concept explanation~2 min read
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
JSON-RPC 2.0 is a plain-text remote procedure call standard published in 2010, over a decade before MCP existed. MCP picked it as its wire format and layered an AI-specific method set, lifecycle, and capability model on top.
Understanding this layering is the difference between debugging an MCP issue at the correct level and chasing the wrong layer. This explanation pins down what JSON-RPC 2.0 is, what fields appear in each message, what role each plays in MCP, and where the boundary between the two specs runs.
JSON-RPC 2.0 in five fields
The entire spec fits on one page. Every message is a JSON object.
Requests carry four fields: jsonrpc: "2.0" (version string, always required), method (string naming the operation), params (arguments as an object or array), and id (string or number for correlating the response). The id is the correlation mechanism. A client can have many requests in flight simultaneously; responses come back with the matching id and the client routes each one to the right caller.
Responses carry three fields: jsonrpc: "2.0", the matching id, and either result on success or error on failure. Exactly one of result or error is present. The error object has a numeric code, a string message, and an optional data field. JSON-RPC defines five standard codes: -32700 parse error, -32600 invalid request, -32601 method not found, -32602 invalid params, -32603 internal error. Servers can define additional codes outside the reserved range.
Notifications are requests without an id. The sender does not expect a reply and the receiver does not send one. They are fire and forget, useful for one-way signals where confirmation is unnecessary.
Three message shapes, five required fields across them, five standard error codes. That is everything JSON-RPC contributes to MCP: an envelope, a correlation mechanism, and an error vocabulary.
Situations where this technique stops working.
2–4 min · Everything important, quickly.
Real products, models, and research that use this idea.
- MCP Inspector and the @modelcontextprotocol/inspector CLI show raw JSON-RPC frames so you can verify the version field, method name, id correlation, and result/error split while debugging a server.
- Stdio MCP servers (filesystem, sqlite, git) emit newline-delimited JSON-RPC 2.0 messages on stdout, which you can pipe through jq to read by hand during development.
What an interviewer would ask next. Try answering before peeking at the approach.
QWalk through a JSON-RPC 2.0 error object. How does it differ from an MCP tool error?
JSON-RPC error: numeric code, string message, optional data. Standard codes include -32700 parse, -32601 method not found, -32602 invalid params. MCP tool error: a successful JSON-RPC response whose result.content describes a failure and result.isError is true. The model sees tool errors and can react; JSON-RPC errors mean the host and server are out of contract.
Red flags & common mistakes
The phrases that signal junior thinking. Click to expand.
Red flags & common mistakes
The phrases that signal junior thinking. Click to expand.
Describing MCP as a brand new protocol built from scratch. MCP reuses JSON-RPC 2.0 as its wire format and layers an AI-specific method set, lifecycle, and capability model on top.
60 second bullets to scan on the way to the call.
State that JSON-RPC 2.0 is the wire format MCP uses.
List the required request fields: jsonrpc, method, params, id.
Primary sources. Browse if you want the original framing.
Same topic, related formats. Practice these next.