0Pricing
MCP Academy · Урок

Согласование возможностей

Проверьте, какие функции поддерживают обе стороны.

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

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

Not Everyone Speaks Every Feature

MCP is rich, but no client or server supports it all. So at startup both sides negotiate which features they have, like two devices agreeing on what they can do. 🤝

It Happens at Initialize

This deal is struck during the initialize handshake, the very first exchange. After it, each side knows what the other offers and what is off the table.

Two Capability Bundles

The client announces its clientCapabilities and the server announces its serverCapabilities. Each bundle is just a map of feature flags and small options.

What a Server Declares

A server lists what it provides: things like tools, resources, and prompts. If a key is absent, clients know not to expect that primitive from you.

"capabilities": { "tools": {}, "resources": {} }

What a Client Declares

A client lists features it can offer back, such as roots, sampling, and elicitation. That is how your server learns it may even ask for roots at all.

"capabilities": { "roots": {}, "sampling": {} }

Sub-flags Add Detail

A capability can hold extra options. For example, roots may carry listChanged: true, meaning the client will notify you when its root set changes.

"roots": { "listChanged": true }

Absence Means No

The rule is simple: if a capability is missing, treat the feature as unavailable. Never call something the other side never promised it could do.

Version Comes First

Alongside features, both sides send a protocolVersion. They must agree on a shared version, or the session is rejected before any real work begins.

The SDK Does the Heavy Lifting

You rarely build these maps by hand. The Python SDK fills in your server capabilities from the tools and resources you registered, then exchanges them for you.

Read the Other Side's Flags

After init, you can inspect the client capabilities your session captured. That check is exactly what guards an optional call like list_roots.

caps = ctx.session.client_params.capabilities

Negotiate Once, Trust Throughout

Capabilities are settled at startup and hold for the session. You can rely on them for the connection's life without re-negotiating on every call.

Quick Check

Recall when and how features get agreed on.

Recap: The Capability Deal

At initialize, client and server swap capability maps and a protocol version. A missing flag means unsupported, and the SDK builds and reads these for you. 🎯

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

Урок «Согласование возможностей» бесплатный?

Да — полный текст урока «Согласование возможностей» бесплатно доступен здесь в веб-версии. Чтобы практиковать его интерактивно (встроенный редактор кода и ИИ-репетитор 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 — локальная установка не требуется.

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

  1. Что корни сообщают серверу
  2. Запрос корневых каталогов клиента
  3. Согласование возможностей
  4. Соблюдение границ клиента
← Назад к MCP Academy