Web Development

What is JSON-RPC?

JSON-RPC is a minimal protocol for calling remote functions using JSON. It's used in LLMs, blockchains, and tools like MCP to standardize interop.

JSON-RPC is a lightweight, stateless remote procedure call (RPC) protocol. It uses JSON to encode requests and responses and operates over HTTP, WebSockets, or any other transport.

It’s especially popular in systems where you want to keep integration simple and language-agnostic — like between a backend server and an AI model, or between microservices.

Basic JSON-RPC request:

{
  "jsonrpc": "2.0",
  "method": "getBalance",
  "params": ["0x1234..."],
  "id": 1
}

And the response:

{
  "jsonrpc": "2.0",
  "result": 1000,
  "id": 1
}

Key characteristics:

  • Pure JSON
  • No HTTP status code semantics (everything goes in the payload)
  • Supports named or positional parameters
  • Supports notifications (no response expected)

JSON-RPC is widely used in blockchain, AI agent toolchains, and increasingly with Model Context Protocol (MCP) as the transport layer for function calls.

FAQ

Is JSON-RPC the same as REST?

No. JSON-RPC focuses on calling remote functions, not on resources like REST. It's closer to calling a method in a shared library.

Does JSON-RPC support WebSockets?

It supports anything that can transport JSON. HTTP, WebSockets, pipes, even message queues.

Why use JSON-RPC vs gRPC?

It’s simpler, requires no codegen, and works great in JavaScript-heavy or browser environments. gRPC is more performant but more complex.

Is JSON-RPC secure?

It depends on the transport. The protocol doesn’t include authentication or encryption by default — that’s handled by the layer it runs on.

Promote your content

Reach over 400,000 developers and grow your brand.

Join our developer community

Hang out with over 4,500 developers and share your knowledge.