Solicitudes, respuestas y notificaciones
Las tres formas de mensaje que MCP intercambia durante todo el día.
Solicitudes, respuestas y notificaciones es una lección gratuita de MCP Academy en CoddyKit. Esta es la lección 1 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.
Three Shapes of Talk
Under the hood, MCP speaks JSON-RPC. Every exchange is just one of three message shapes, and once you know them the wire stops feeling like magic.
What Is a Request?
A request asks the other side to do something and expects an answer. It carries an id so the reply can be matched back to it later.
{"jsonrpc": "2.0", "id": 1, "method": "tools/list"}The Reply Comes Back
A response answers exactly one request. It echoes the same id, so the client always knows which question it is replying to.
{"jsonrpc": "2.0", "id": 1, "result": {"tools": []}}Fire and Forget
A notification is a one-way heads-up. It looks like a request but has no id, so nobody sends a reply back.
{"jsonrpc": "2.0", "method": "notifications/initialized"}The id Is the Tell
The presence of an id is the whole difference: with an id you owe a reply, without one you do not. That single field separates requests from notifications.
Both Sides Can Ask
JSON-RPC is symmetric, so MCP is too. The server can send requests to the client, not just the other way around. Both parties play both roles.
Result or Error, Never Both
Every response carries either a result or an error, never both. Success fills result; failure fills error. You always know which one to read.
Notifications Power Updates
MCP uses notifications for live signals like progress, logs, and list changes. No reply is needed, so they keep the conversation flowing freely.
Matching by id
Because each request carries a unique id, many calls can be in flight at once. Replies need not arrive in order; the id keeps everything paired.
A Tiny Round Trip
Picture a round trip: the client requests tools/list, the server answers with the same id, and then the client knows which tools exist.
Why Three Is Enough
These three shapes cover everything MCP needs: ask and wait, answer, or announce. That simplicity is why JSON-RPC was chosen for the protocol.
Quick Check
You spot a JSON-RPC message with no id field. What kind is it?
Recap: Three Shapes
You learned MCP's whole vocabulary: requests ask with an id, responses answer with that id, and notifications announce with no id at all. Three shapes, endless conversations.
Preguntas frecuentes
¿La lección «Solicitudes, respuestas y notificaciones» es gratis?
Sí — el texto completo de «Solicitudes, respuestas y notificaciones» 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 «Solicitudes, respuestas y notificaciones»?
Las tres formas de mensaje que MCP intercambia durante todo el día. 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 1 de 4.
¿Cuánto tiempo toma la lección «Solicitudes, respuestas y notificaciones»?
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
- Solicitudes, respuestas y notificaciones
- Anatomía de una llamada JSON-RPC
- El protocolo de inicialización
- Leer errores en el protocolo