Dividing Responsibility for Tool Connections in MCP
A model tool-use example that explains the responsibilities of MCP hosts, clients, and servers across the data and transport layers.
On this page11
Suppose you want to use the same internal document-search tool in a code editor and a chat application. Writing a separate connection for each application means maintaining the same tool twice. The Model Context Protocol (MCP) brings those connections under a common protocol. This article follows the architecture to explain who is responsible for what when using MCP. It refers to revision 2026-07-28.
Starting with function calling
In this article's model tool-use example, MCP connects with the model API's function-calling mechanism. With function calling, the model does not execute a function itself. The application sends tool definitions, and the model requests a tool and its arguments in a structured form. The application executes the tool and returns its result. In the Claude API, the request appears in a tool_use block, and the result returns in a tool_result block with the same call ID. Field names differ between providers.
The model chooses based on the tool definition rather than its implementation code. A tool's name, description, and input schema therefore serve both as API documentation and as part of the prompt. Anthropic's article on agent design recommends designing tools as carefully as human interfaces. When the model repeatedly supplies an incorrect input, change the argument design to make that mistake harder—a technique known as poka-yoke. For example, require an absolute path instead of a relative one. Argument names and descriptions should also make the intended use clear.
MCP is the connection protocol that lets multiple applications share these tool definitions and calls. It does not prescribe how an application calls a model or incorporates the supplied context into a prompt.
Three participants
The MCP architecture overview identifies three participants. These are logical roles: a small script can act as both host and client in a single process.
Clients and servers are paired one to one. A host using three servers creates three clients. If a proxy aggregates several servers, the proxy itself takes the server role toward its own client.
The host: the final decision point
The server supplies tool descriptions and results, while the host controls the user interface and model calls. The host is therefore the final point for permission decisions. The Tools specification requires clients to treat tool annotations as untrusted unless they come from a trusted server. A tool annotation that marks a tool as read-only must not be trusted by the host as-is.
Combining tools from multiple servers is also the host's responsibility. Different servers may use the same tool name, so the host needs a rule for resolving name collisions. Tool definitions loaded up front consume input tokens in every request. When many servers are connected, consider loading definitions only when needed through progressive tool discovery.
The client: connections and error handling
The client checks the server's supported revisions and capabilities and converts the list returned by tools/list into the model API's tool-definition format. When the model returns a tool call, the client forwards it through tools/call.
The specification distinguishes two kinds of errors. Protocol errors, such as an unknown tool, a malformed request, or a server error, are generally difficult for the model to repair and usually require code or configuration changes. Tool-execution errors marked isError: true can be shown to the model so that it can adjust its arguments and try again. The specification recommends validating results before passing them to the model, setting call timeouts, and keeping an audit log.
The server: a contract the model can understand
The server declares its supported primitives as capabilities. Tools are functions whose execution the model can request, resources are data read as context, and prompts are instruction templates selected by the user. When connecting an existing system, first distinguish actions from read-only context.
A tool is defined by a name, a description, and an input JSON Schema (inputSchema). When returning structured results, provide an output schema (outputSchema) and matching structuredContent. It is better to group tools around tasks the model needs to perform than to wrap an existing REST API without changes. Exposing low-level endpoints directly requires the model to assemble more steps and creates more opportunities to get their order wrong.
The specification requires servers to validate every tool input, enforce access controls and rate limits, and sanitize outputs. Execution-error messages should explain both the cause and the permitted input so that the model can make a correction.
Two layers
The data layer: what messages mean
The data layer adds capability discovery, primitive invocation, and change notifications to the requests, responses, and notifications defined by JSON-RPC 2.0. Its messages are the same regardless of transport.
Revision 2026-07-28 removed connection-level sessions and the initialize handshake. Each request carries the protocol version and client capabilities in _meta, allowing the server to process that request on its own. A client can use server/discover to check supported versions and capabilities in one exchange. If the server needs user input, it returns an InputRequiredResult; the client adds the answer and retries the original request. When an application needs state across calls, such as a shopping cart, a tool can return a handle that a subsequent call supplies as an argument.
The feature that lets a server ask a user for additional information is called elicitation. These requests also travel through InputRequiredResult. Sampling and logging from earlier revisions became deprecated in 2026-07-28.
This stateless design makes it easier to spread requests across server instances when scaling horizontally. If a server keeps per-instance state such as handles, or its authentication or external dependencies differ by instance, routing and shared state still need their own design. Revisions through 2025-11-25 used a handshake and connection sessions, however, so applying their lifecycle descriptions directly to the current revision would be incorrect.
The transport layer: processes and communication paths
The transport specification defines two standard transports. The stdio transport communicates with a local child process launched by the client, while Streamable HTTP can connect to either local or remote servers.
The Streamable HTTP specification requires servers to validate the Origin header on all incoming connections. This protects against DNS rebinding attacks in which a web page interacts with a local server. For a local HTTP server, it recommends binding only to 127.0.0.1 and implementing proper authentication for all connections. Binding to 127.0.0.1 reduces exposure to the network, but it does not stop other processes on the same machine. The security best practices warn that local MCP servers run with the client's privileges, so their code can do everything the client can do.
When not to use MCP
MCP does not itself provide a security boundary (the author's interpretation). A server that exposes dangerous tools remains dangerous even if it follows the protocol. An approval interface can become a formality when users grow accustomed to repeated prompts, so the design also needs to limit the scope of permissions.
For a few functions used inside a single application, the provider API's function-calling mechanism is sufficient. Adding a protocol layer means operating more processes and managing revision compatibility. Compatibility between revisions is not automatic. Before implementing a connection, check the target client's supported revision and transport.
Bringing the responsibilities together
When several applications need the same tool, one MCP server offers a wider scope for reuse. Responsibilities are divided among three participants: the server defines clear tool contracts and validates inputs; the client manages connections and validates results; and the host obtains user consent and makes the final permission decision. State the applicable revision whenever making a claim about MCP.
References
- Model Context Protocol, Architecture overview — participant roles and the distinction between the data and transport layers.
- MCP Specification 2026-07-28, Key Changes — removal of sessions and
initialize, addition ofserver/discover, and deprecation of sampling. - MCP Specification 2026-07-28, Tools — tool definitions, error handling, and security considerations.
- MCP Specification 2026-07-28, Transports — stdio and custom transports.
- MCP Specification 2026-07-28, Streamable HTTP — local and remote HTTP transport,
Originvalidation, and compatibility with earlier revisions. - Model Context Protocol, Build an MCP client — client implementation guidance.
- Model Context Protocol, Client Best Practices — progressive tool discovery.
- Model Context Protocol, Security Best Practices — local server privileges and attack paths.
- JSON-RPC 2.0 Specification — the structure of requests, responses, and notifications.
- Claude Docs, Tool use with Claude — the function-calling exchange and tool-definition costs.
- Anthropic, Building effective agents — tool design and the agent-computer interface.