Рукопожатие при инициализации
Узнайте, как клиент и сервер согласуют версию и возможности.
«Рукопожатие при инициализации» — бесплатный урок MCP Academy на CoddyKit. Это урок 3 из 4. Ты можешь прочитать весь урок бесплатно ниже — а потом практиковать его прямо в браузере с встроенным редактором кода и ИИ-репетитором 24/7. Это часть пути обучения MCP Academy, и твой прогресс синхронизируется между веб-версией и приложением CoddyKit. Курс MCP Academy содержит 4 уроков всего.
Части этого урока еще не переведены и отображаются на английском.
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.
Часто задаваемые вопросы
Урок «Рукопожатие при инициализации» бесплатный?
Да — полный текст урока «Рукопожатие при инициализации» бесплатно доступен здесь в веб-версии. Чтобы практиковать его интерактивно (встроенный редактор кода и ИИ-репетитор 24/7) и разблокировать остальной курс MCP Academy, подпишись на CoddyKit PRO. Курс MCP Academy содержит 4 уроков всего.
Чему я научусь в уроке «Рукопожатие при инициализации»?
Узнайте, как клиент и сервер согласуют версию и возможности. Ты практикуешь MCP Academy с помощью реального кода, который запускаешь прямо в браузере, и ИИ-репетитор 24/7 отвечает на твои вопросы во время урока.
Нужен ли мне опыт, чтобы начать MCP Academy?
Предыдущий опыт не требуется. MCP Academy на CoddyKit структурирован для всех уровней — от новичков до продвинутых, поэтому ты можешь начать отсюда или с самого начала и учиться в своем темпе. Это урок 3 из 4.
Сколько времени занимает урок «Рукопожатие при инициализации»?
Большинство уроков CoddyKit занимают около 5–10 минут. Каждый из них компактный и интерактивный, поэтому ты постоянно делаешь прогресс и продолжаешь с того же места в веб-версии и приложении.
Можно ли писать и запускать код в этом уроке MCP Academy?
Да. Каждый урок MCP Academy включает встроенный редактор кода, поэтому ты пишешь и запускаешь реальный код прямо в браузере и получаешь моментальную обратную связь от AI — локальная установка не требуется.
Все уроки этого курса
- Запросы, ответы и уведомления
- Строение вызова JSON-RPC
- Рукопожатие при инициализации
- Чтение ошибок в канале связи