0Pricing
MCP Academy · Урок

Строение вызова JSON-RPC

Поля id, method и params в настоящем сообщении MCP.

«Строение вызова JSON-RPC» — бесплатный урок MCP Academy на CoddyKit. Это урок 2 из 4. Ты можешь прочитать весь урок бесплатно ниже — а потом практиковать его прямо в браузере с встроенным редактором кода и ИИ-репетитором 24/7. Это часть пути обучения MCP Academy, и твой прогресс синхронизируется между веб-версией и приложением CoddyKit. Курс MCP Academy содержит 4 уроков всего.

Части этого урока еще не переведены и отображаются на английском.

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.

Часто задаваемые вопросы

Урок «Строение вызова JSON-RPC» бесплатный?

Да — полный текст урока «Строение вызова JSON-RPC» бесплатно доступен здесь в веб-версии. Чтобы практиковать его интерактивно (встроенный редактор кода и ИИ-репетитор 24/7) и разблокировать остальной курс MCP Academy, подпишись на CoddyKit PRO. Курс MCP Academy содержит 4 уроков всего.

Чему я научусь в уроке «Строение вызова JSON-RPC»?

Поля id, method и params в настоящем сообщении MCP. Ты практикуешь MCP Academy с помощью реального кода, который запускаешь прямо в браузере, и ИИ-репетитор 24/7 отвечает на твои вопросы во время урока.

Нужен ли мне опыт, чтобы начать MCP Academy?

Предыдущий опыт не требуется. MCP Academy на CoddyKit структурирован для всех уровней — от новичков до продвинутых, поэтому ты можешь начать отсюда или с самого начала и учиться в своем темпе. Это урок 2 из 4.

Сколько времени занимает урок «Строение вызова JSON-RPC»?

Большинство уроков CoddyKit занимают около 5–10 минут. Каждый из них компактный и интерактивный, поэтому ты постоянно делаешь прогресс и продолжаешь с того же места в веб-версии и приложении.

Можно ли писать и запускать код в этом уроке MCP Academy?

Да. Каждый урок MCP Academy включает встроенный редактор кода, поэтому ты пишешь и запускаешь реальный код прямо в браузере и получаешь моментальную обратную связь от AI — локальная установка не требуется.

Все уроки этого курса

  1. Запросы, ответы и уведомления
  2. Строение вызова JSON-RPC
  3. Рукопожатие при инициализации
  4. Чтение ошибок в канале связи
← Назад к MCP Academy