0Pricing
MCP Academy · Aula

O handshake de inicialização

Como cliente e servidor concordam sobre a versão e os recursos.

O handshake de inicialização é uma aula grátis de MCP Academy no CoddyKit. Esta é a aula 3 de 4. Você pode ler a aula completa abaixo gratuitamente — depois pratica ao vivo no navegador com um editor de código integrado e um tutor de IA 24/7. Faz parte do caminho de aprendizado de MCP Academy, e seu progresso é sincronizado entre a web e o app CoddyKit. O curso de MCP Academy inclui 4 aulas no total.

Partes desta aula ainda não foram traduzidas e aparecem em 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.

Perguntas Frequentes

A aula “O handshake de inicialização” é grátis?

Sim — o texto completo de “O handshake de inicialização” é grátis para ler aqui na web. Para praticá-la interativamente (um editor de código integrado e um tutor de IA 24/7) e desbloquear o restante do curso de MCP Academy, atualize para CoddyKit PRO. O curso de MCP Academy inclui 4 aulas no total.

O que vou aprender em “O handshake de inicialização”?

Como cliente e servidor concordam sobre a versão e os recursos. Você pratica MCP Academy com código prático que executa diretamente no navegador, e um tutor de IA 24/7 responde suas dúvidas enquanto trabalha na aula.

Preciso ter experiência prévia para começar MCP Academy?

Nenhuma experiência prévia é necessária. MCP Academy no CoddyKit é estruturado para alunos iniciantes até avançados, então você pode começar aqui ou desde o início e aprender no seu ritmo. Esta é a aula 3 de 4.

Quanto tempo leva a aula “O handshake de inicialização”?

A maioria das aulas CoddyKit leva cerca de 5–10 minutos. Cada uma é compacta e interativa, então você faz progresso constante e retoma exatamente de onde parou entre web e app.

Posso escrever e executar código nesta aula de MCP Academy?

Sim. Cada aula de MCP Academy inclui um editor de código integrado, então você escreve e executa código real direto no navegador e recebe feedback de IA instantaneamente — nenhuma configuração local necessária.

Todas as aulas deste curso

  1. Solicitações, respostas e notificações
  2. Anatomia de uma chamada JSON-RPC
  3. O handshake de inicialização
  4. Lendo erros no protocolo
← Voltar para MCP Academy