JSON-RPC
Also called JSON Remote Procedure Call
A lightweight protocol for calling functions on another system by sending JSON messages. It is the message format used by the Model Context Protocol.
What is JSON-RPC?
JSON-RPC is a simple protocol for asking another program to run a function and send back the result. The request and response are small JSON messages, and the specification is short and independent of any transport such as HTTP or standard input and output.
How does it work?
A request names the method to run, includes its parameters and carries an ID. The reply carries the same ID with either a result or an error. A message with no ID is a notification, which needs no reply.
What is a simple example?
A client sends a request to call a method named "get_weather" with the city "Lagos" and gets back a result with the forecast, matched to the request by its ID.
Why does it matter?
The Model Context Protocol uses JSON-RPC 2.0 for its messages, so it underlies how AI apps talk to MCP servers. It is a common choice for APIs where a small, predictable format is enough.