0Pricing
MCP Academy · Aula

Anatomia de uma chamada JSON-RPC

id, method e params em uma mensagem MCP real.

Anatomia de uma chamada JSON-RPC é uma aula grátis de MCP Academy no CoddyKit. Esta é a aula 2 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.

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.

Perguntas Frequentes

A aula “Anatomia de uma chamada JSON-RPC” é grátis?

Sim — o texto completo de “Anatomia de uma chamada JSON-RPC” é 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 “Anatomia de uma chamada JSON-RPC”?

id, method e params em uma mensagem MCP real. 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 2 de 4.

Quanto tempo leva a aula “Anatomia de uma chamada JSON-RPC”?

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