Q&A-6Design MCP capability discovery and compatibility.
Answer
Assumptions first. I'm building an MCP host (client) that connects to third-party servers I don't control, and I need to know what each server can do before I expose it to the model, and survive servers built against older spec revisions.
The core answer: capability discovery is not a separate call. It is the initialize handshake. The client sends initialize with its own protocolVersion and capabilities; the server replies with its protocolVersion, capabilities, serverInfo, and optional instructions. The client then sends notifications/initialized. Everything after that is gated on what the server actually advertised.
Mechanism. Protocol version negotiation is the compatibility contract. The client proposes a revision string: MCP revisions are date-based, e.g. 2024-11-05, 2025-03-26, 2025-06-18. If the server supports the proposed revision it echoes it back. If not, it returns a revision it does support. The client must check the returned value: if it can't speak that revision, it should disconnect rather than silently proceed.
Capabilities are a set of keys in the server's initialize result: tools, resources, prompts, logging, completions, experimental. Some carry sub-flags: tools.listChanged, resources.subscribe, resources.listChanged. Absence of a key means the server does not support that feature, so the client must not call the corresponding method.
Gating then has two inputs: the server advertised the capability, and local policy allows it. A server can advertise sampling, but a host that doesn't want to run model completions on the server's behalf keeps it off.
Trace: initialize.
// client -> server
{"jsonrpc":"2.0","id":1,"method":"initialize","params":{
"protocolVersion":"2025-06-18",
"capabilities":{"roots":{"listChanged":true},"sampling":{}},
"clientInfo":{"name":"my-host","version":"1.4.0"}}}
// server -> client
{"jsonrpc":"2.0","id":1,"result":{
"protocolVersion":"2024-11-05",
"capabilities":{"tools":{"listChanged":true},"resources":{"subscribe":false}},
"serverInfo":{"name":"acme-tools","version":"2.1.0"}}}Reading it: the client asked for 2025-06-18, the server answered 2024-11-05. The client supports both, so it proceeds, but must not use anything added after 2024-11-05, such as elicitation. The server advertised tools and resources but not prompts, so prompts/list is off the table.
Gating table.
| server capability | methods unlocked | if absent |
|---|---|---|
tools | tools/list, tools/call | register no tools |
resources | resources/list, resources/read | no resource picker |
resources.subscribe | resources/subscribe | poll, or drop live updates |
prompts | prompts/list, prompts/get | no prompt menu |
logging | logging/setLevel | no server log control |
Trade-offs. Strict pinning, refuse anything but your exact revision, is simplest and safest, and breaks against every server on an older revision. Negotiation with a floor (accept any revision at or above a minimum you've tested) is the practical middle. Accept-anything forward compatibility is what gets you calling methods that don't exist. Decide by how many servers you must support and whether you can test each revision.
Caching: cache the negotiated revision and capability set per server endpoint, keyed by server identity plus revision. Don't cache capability results like tool lists across revisions: they change. listChanged notifications exist so you don't have to poll.
Failure modes.
- Empty capabilities object: client registers nothing and surfaces "connected, no capabilities." Detect by the empty object, not by an error.
- Unknown extension key: ignore it, log it, don't fail the handshake. Detect by diffing keys against your known set.
- Partial capability: server advertises
toolsbuttools/listerrors. Treat as capability revoked, disable it, don't retry in a loop. - Version mismatch: server returns a revision you don't speak. Disconnect at initialize, before any tool call, with an error naming both revisions.
Never treat serverInfo.name as identity or auth: it is self-reported and spoofable. Identity comes from the transport (OAuth token, mTLS), not the handshake.
Curated: · Written: · Reviewed:
Log in free to save your progress and keep bookmarks and notes for a quick revision before your interview.