Solicitações, respostas e notificações
Os três formatos de mensagem que o MCP troca o dia inteiro.
Solicitações, respostas e notificações é uma aula grátis de MCP Academy no CoddyKit. Esta é a aula 1 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.
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.
Perguntas Frequentes
A aula “Solicitações, respostas e notificações” é grátis?
Sim — o texto completo de “Solicitações, respostas e notificações” é 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 “Solicitações, respostas e notificações”?
Os três formatos de mensagem que o MCP troca o dia inteiro. 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 1 de 4.
Quanto tempo leva a aula “Solicitações, respostas e notificações”?
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
- Solicitações, respostas e notificações
- Anatomia de uma chamada JSON-RPC
- O handshake de inicialização
- Lendo erros no protocolo