JSON-RPC 2.0

JSON-RPC 2.0 is the underlying communication protocol used by the Model Context Protocol (MCP). It provides a simple, stateless way for a client to request the execution of a method on a server and receive a response.

Why JSON-RPC for MCP?

Message Types in MCP

Questions & Answers

What is JSON-RPC 2.0, and why is it used in MCP?

JSON-RPC 2.0 is the foundational communication protocol for MCP. It provides a simple, text-based, and language-agnostic way for clients to call methods on servers and handle the results or errors.

What are the three primary message types in the MCP / JSON-RPC structure?

The primary message types are Requests (which expect a response), Responses (which contain the result or error), and Notifications (which are one-way messages requiring no response).

How does JSON-RPC 2.0 handle failed requests?

Failed requests return a structured Response object containing an error key. This key includes a numeric code and a message, providing clear feedback on what went wrong (e.g., "Method not found").

Back to Glossary