Uzgadnianie możliwości
Sprawdź, które funkcje obsługują obie strony.
Uzgadnianie możliwości to bezpłatna lekcja MCP Academy na CoddyKit. To lekcja 3 z 4. Możesz przeczytać całą lekcję poniżej za darmo — a potem ćwiczyć ją interaktywnie w przeglądarce z wbudowanym edytorem kodu i tutorem AI dostępnym 24/7. To część ścieżki edukacyjnej MCP Academy, a Twój postęp synchronizuje się między webem a aplikacją CoddyKit. Kurs MCP Academy zawiera 4 lekcji w sumie.
Części tej lekcji nie zostały jeszcze przetłumaczone i są wyświetlane po angielsku.
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.capabilitiesNegotiate 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. 🎯
Często zadawane pytania
Czy lekcja „Uzgadnianie możliwości” jest bezpłatna?
Tak — pełny tekst „Uzgadnianie możliwości” jest dostępny za darmo tutaj w sieci. Aby ćwiczyć ją interaktywnie (wbudowany edytor kodu i tutor AI dostępny 24/7) i odblokować resztę kursu MCP Academy, przejdź na CoddyKit PRO. Kurs MCP Academy zawiera 4 lekcji w sumie.
Co nauczysz się w „Uzgadnianie możliwości”?
Sprawdź, które funkcje obsługują obie strony. Ćwiczysz MCP Academy z praktycznym kodem, który uruchamiasz bezpośrednio w przeglądarce, a tutor AI dostępny 24/7 odpowiada na Twoje pytania podczas pracy nad lekcją.
Czy potrzebuję doświadczenia, aby zacząć MCP Academy?
Nie wymagamy żadnego doświadczenia. MCP Academy w CoddyKit jest strukturyzowany dla początkujących i zaawansowanych użytkowników, więc możesz zacząć tutaj lub od początku i uczyć się w swoim tempie. To lekcja 3 z 4.
Ile czasu zajmuje lekcja „Uzgadnianie możliwości”?
Większość lekcji CoddyKit trwa około 5–10 minut. Każda lekcja to mały, interaktywny krok, dzięki czemu robisz systematyczne postępy i zawsze wracasz dokładnie do tego samego miejsca — na webie i w aplikacji.
Czy mogę pisać i uruchamiać kod w tej lekcji MCP Academy?
Tak. Każda lekcja MCP Academy zawiera wbudowany edytor kodu, więc piszesz i uruchamiasz prawdziwy kod bezpośrednio w przeglądarce i od razu otrzymujesz sprzężenie zwrotne od AI — bez konfiguracji na komputerze.
Wszystkie lekcje w tym kursie
- Co katalogi roots mówią serwerowi
- Żądanie katalogów roots klienta
- Uzgadnianie możliwości
- Respektowanie ograniczeń klienta