📘Introduction

In this guide, we’ll walk through the basics of JSON-RPC, a lightweight protocol for structured communication between systems. It’s widely used in APIs, blockchain, and even newer standards like the Model Context Protocol (MCP).

💡 What is JSON-RPC?

JSON-RPC is a remote procedure call (RPC) protocol encoded in JSON. It allows one system (client) to call methods on another (server) as if they were local functions. Each message is just a JSON object with a method name, parameters, and an ID to match requests and responses.

🔌 Why JSON-RPC for MCP?

MCP uses JSON-RPC as its foundation because it is:

  • Lightweight & standardized — messages are simple JSON objects.
  • Transport-agnostic — works over stdin/stdout and HTTP
  • Bi-directional — both client and server can send requests.
  • Extensible — easy to define new methods while keeping the format consistent.

🔎 Example

Suppose you define this tool in your MCP server:

@mcp.tool()
def greet_user(name: str) -> str:
    return f"Hello, {name}! Welcome to the Deep learning Nerds Academy"

💻➡️ Request

The client asks the server to run the greet_user tool with the parameter Jack:

You can view this post with the tier: Academy Membership

Join academy now to read the post and get access to the full library of premium posts for academy members only.

Join Academy Already have an account? Sign In