0Pricing
MCP Academy · Lección

El protocolo de inicialización

Cómo el cliente y el servidor acuerdan la versión y las funciones.

El protocolo de inicialización es una lección gratuita de MCP Academy en CoddyKit. Esta es la lección 3 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.

First Words Matter

Before any tool runs, client and server must meet. That opening exchange is the initialize handshake, and nothing else happens until it finishes.

The Client Speaks First

The handshake always starts with the client sending an initialize request. The server stays quiet and waits to be greeted before it replies.

{"jsonrpc": "2.0", "id": 0, "method": "initialize"}

Agreeing on a Version

The client offers a protocolVersion so both sides speak the same MCP edition. The server confirms a version it can support in its reply.

{"params": {"protocolVersion": "2025-06-18"}}

Declaring Capabilities

Each side lists its capabilities, such as tools, resources, or sampling. This tells the other party which features it may safely use.

{"capabilities": {"tools": {}, "resources": {}}}

Introducing Yourself

The client also sends clientInfo with its name and version. It is a friendly nameplate so the server knows exactly who connected.

{"clientInfo": {"name": "claude-desktop", "version": "1.0"}}

The Server Responds

The server replies with its own chosen version, its capabilities, and serverInfo. Now both sides know what the other can do.

{"result": {"protocolVersion": "2025-06-18",
  "serverInfo": {"name": "my-server", "version": "0.1"}}}

Sealing the Deal

After the reply, the client sends a final notifications/initialized message. It has no id and no answer, simply signaling that setup is complete.

{"jsonrpc": "2.0", "method": "notifications/initialized"}

Only Then, Real Work

Until that initialized notification arrives, the server should refuse other calls. The handshake gates everything that follows it.

Why Negotiate at All

Versions and features evolve, so the handshake lets a new client and an old server negotiate common ground instead of crashing on mismatch.

Capabilities Shape the Session

If the server never advertised resources, a polite client will not ask for them. Declared capabilities quietly define the rules of the whole session.

The Handshake in Three Beats

Remember the rhythm: client sends initialize, server responds, client confirms with initialized. Three beats and the connection is live.

Quick Check

What does the client send to finish the initialize handshake?

Recap: Saying Hello

You traced the handshake end to end: the client offers a version and capabilities, the server confirms, and a final initialized note opens the session for real work.

Preguntas frecuentes

¿La lección «El protocolo de inicialización» es gratis?

Sí — el texto completo de «El protocolo de inicialización» 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 «El protocolo de inicialización»?

Cómo el cliente y el servidor acuerdan la versión y las funciones. 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 3 de 4.

¿Cuánto tiempo toma la lección «El protocolo de inicialización»?

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