Model Context Protocol › Capability negotiation
Language AI HandbookAll chapters Capability declarations help a peer decide whether an operation is appropriate. The server declaration says which features it implements. Client capability information on a modern request lets the server account for what the client can handle for that request. Compare capability information on the relevant connection when the host has multiple connections. An operation that works against a library server says little about what a workshop server implements, even if both speak MCP.
Picture three fictional connections. The catalog provides tools and resources. The style guide offers resources and prompts. The workshop offers tools and prompts. Their declarations are independent. Keeping a matrix of the operation families each test server implements catches a common integration mistake, where the host copies capabilities from one connection into another. The matrix below records those three fixture declarations. Authorization and individual tool inventories belong in separate records.
PythonIn [7]Expand
capability_families = ("Tools", "Resources", "Prompts")
fixture_features = {
"Reading catalog": {"Tools", "Resources"},
"Style guide": {"Resources", "Prompts"},
"Workshop": {"Tools", "Prompts"},
}
capability_matrix = [
[family in supported for family in capability_families]
for supported in fixture_features.values()
]
assert capability_matrix == [
[True, True, False],
[False, True, True],
[True, False, True],
]VisualizationOut [8]Expand

The two connections with tools can also publish a tool with the same local name. An application can keep those entries distinct internally by storing the connection and the tool name together. It can label the two choices differently when it presents them. Include the destination in an approval prompt when a user could reasonably choose either. This way the action a user sees can match the server to which the host sends the call.
A capability can help select a call, and the server's available tool list can depend on the requesting identity. The application still checks whether a specific action is appropriate to expose in that interface. For example, an operator may connect a workshop server that supports tools while the reading interface never offers the workshop's operations. The host filters that view under its own policy even when it connects successfully.
Comments
Add to the conversation
A question, a correction, or an example from your own work.
No comments yet. Be the first to share your thoughts!