0Pricing
MCP Academy · Lección

Anatomía de una llamada JSON-RPC

id, method y params en un mensaje MCP real.

Anatomía de una llamada JSON-RPC es una lección gratuita de MCP Academy en CoddyKit. Esta es la lección 2 de 4. Puedes leer la lección completa abajo gratuitamente — luego la practicas en el navegador con un editor de código integrado y un tutor de IA 24/7. Forma parte de la ruta de aprendizaje de MCP Academy, y tu progreso se sincroniza en la web y la app de CoddyKit. El curso de MCP Academy incluye 4 lecciones en total.

Partes de esta lección aún no han sido traducidas y se muestran en inglés.

Open the Envelope

Let us dissect one real MCP message field by field. A JSON-RPC call is a small JSON object, and four keys carry all of its meaning.

The jsonrpc Version Tag

Every message starts with jsonrpc set to the string 2.0. It marks the dialect so both sides parse the rest the same way.

{"jsonrpc": "2.0"}

The id Ties Things Together

The id is a number or string that labels a request. The matching response repeats it, so replies never get confused across many calls.

{"jsonrpc": "2.0", "id": 42}

method Names the Action

The method string says what you want, like tools/call or resources/read. MCP groups methods with a slash, namespace before the verb.

{"method": "tools/call"}

params Carries the Inputs

The params object holds the arguments for that method. For a tool call it names the tool and the values it should receive.

{"params": {"name": "add", "arguments": {"a": 2, "b": 3}}}

A Full Request

Put the four keys together and you have a complete request. This one asks the server to run the add tool with two numbers.

{"jsonrpc": "2.0", "id": 42, "method": "tools/call",
 "params": {"name": "add", "arguments": {"a": 2, "b": 3}}}

params Is Optional

Some methods need no input at all. When that happens you simply omit params, as tools/list does when it just wants the full catalog.

{"jsonrpc": "2.0", "id": 5, "method": "tools/list"}

Named, Not Positional

MCP always passes params as a JSON object with named keys, not a bare list. Names make the arguments self-documenting and order-independent.

The Response Mirror

The reply mirrors the request: same jsonrpc, same id, but method and params are gone. In their place sits a single result field.

{"jsonrpc": "2.0", "id": 42, "result": {"content": []}}

Keys You Will See Most

Across MCP traffic you mostly meet tools/list, tools/call, resources/read, and prompts/get. Spot these methods and the intent jumps right out.

Read It at a Glance

Now any MCP line is readable: jsonrpc is the version, id pairs the reply, method is the verb, and params are the inputs. Four keys, full clarity.

Quick Check

In a JSON-RPC request, which field holds the arguments for the method?

Recap: Four Keys

You can now read any call: jsonrpc sets the version, id pairs the reply, method names the action, and params supplies its inputs. That is the whole anatomy.

Preguntas frecuentes

¿La lección «Anatomía de una llamada JSON-RPC» es gratis?

Sí — el texto completo de «Anatomía de una llamada JSON-RPC» es gratis para leer aquí en la web. Para practicarla de forma interactiva (editor de código integrado y tutor de IA 24/7) y desbloquear el resto del curso de MCP Academy, actualiza a CoddyKit PRO. El curso de MCP Academy incluye 4 lecciones en total.

¿Qué aprenderé en «Anatomía de una llamada JSON-RPC»?

id, method y params en un mensaje MCP real. Practicas MCP Academy con código real que ejecutas directamente en el navegador, y un tutor de IA 24/7 responde tus preguntas mientras trabajas en la lección.

¿Necesito experiencia previa para empezar MCP Academy?

No se requiere experiencia previa. MCP Academy en CoddyKit está estructurado para principiantes hasta estudiantes avanzados, así que puedes empezar aquí o desde el inicio y avanzar a tu ritmo. Esta es la lección 2 de 4.

¿Cuánto tiempo toma la lección «Anatomía de una llamada JSON-RPC»?

La mayoría de las lecciones de CoddyKit toman alrededor de 5–10 minutos. Cada una es compacta e interactiva, así que avanzas constantemente y retomas exactamente por donde dejaste en la web y la app.

¿Puedo escribir y ejecutar código en esta lección de MCP Academy?

Sí. Cada lección de MCP Academy incluye un editor de código integrado, así que escribes y ejecutas código real directamente en tu navegador y obtienes retroalimentación instantánea de IA — sin configuración local necesaria.

Todas las lecciones de este curso

  1. Solicitudes, respuestas y notificaciones
  2. Anatomía de una llamada JSON-RPC
  3. El protocolo de inicialización
  4. Leer errores en el protocolo
← Volver a MCP Academy