MCP Servers, Clients, and Tools: How the Pieces Fit
The Model Context Protocol (MCP) is often described in a single sentence: it is the open standard for connecting AI applications and agents to external tools and data. That sentence is accurate, but it hides the machiner
The Model Context Protocol (MCP) is often described in a single sentence: it is the open standard for connecting AI applications and agents to external tools and data. That sentence is accurate, but it hides the machinery. If you want to build with MCP, debug it, or reason about its security, you need to understand the parts and how they interlock. This article takes the protocol apart and puts it back together, focusing on three words that people frequently mix up: servers, clients, and tools.
A mental model before the details
Think of MCP the way you might think of a power outlet. The outlet is a standard interface. Any appliance with the right plug can draw power, and any building wired to the standard can supply it, without the appliance maker and the electrician ever coordinating. MCP plays the role of that standard. On one side sit AI applications that want capabilities; on the other sit systems that have capabilities to offer. The protocol is the shared socket between them.
The three roles that make this work are the host, the client, and the server. Tools, along with resources and prompts, are the things that flow across the connection. Let us look at each.
The host: where the model lives
The host is the application a person actually interacts with: a chat assistant, an IDE extension, a customer-support console, or an autonomous agent. The host is responsible for the model, for the user experience, and for orchestration β deciding when to reach for a tool and what to do with the result. Importantly, the host is also the trust boundary. It is where user approval happens and where a well-designed system pauses before doing anything irreversible.
A host is not the same thing as a client, even though people sometimes use the words interchangeably. A single host can contain many clients, one for each server it talks to.
The client: one connection, one server
A client is the connector component inside the host that manages a session with exactly one server. If your assistant connects to a file-system server, a database server, and a calendar server, the host spins up three clients. Each client is responsible for the lifecycle of its connection:
- Opening the connection and performing the initialization handshake.
- Negotiating which protocol version and capabilities both sides support.
- Discovering what the server offers β its tools, resources, and prompts.
- Forwarding requests from the host to the server and returning responses.
- Handling notifications, such as a server announcing that its tool list has changed.
Keeping one client per server is not an accident. It isolates connections so that a misbehaving server cannot interfere with another, and it gives the host clean, per-server control over permissions and lifecycle.
The server: a wrapper around a capability
A server is a program that exposes some external system over MCP. The system might be a SaaS API, a local database, a document store, or a company's internal service. The server's job is to translate between MCP's standard vocabulary and whatever the underlying system actually speaks.
Servers come in two broad flavors. A local server runs as a subprocess on the same machine as the host and typically communicates over standard input and output. This is simple and private, which makes it popular for developer tooling. A remote server runs as a networked service, usually reached over HTTP, and can be shared by many users. Remote servers are more powerful but introduce the usual concerns of any networked service: authentication, transport security, and availability.
A central principle is that the server, not the model, decides what is exposed and enforces the boundaries. The model can only invoke what the server advertises, and the server validates every call.
Tools, resources, and prompts: what crosses the wire
Three kinds of capability travel over an MCP connection, and distinguishing them clears up much confusion.
Tools
Tools are actions the model can take. "Create an invoice," "search the codebase," "send a message" β these are tools. Tools can have side effects, which is exactly why they need careful governance. Each tool is described with a name, a human-readable description, and a machine-readable input schema.
Resources
Resources are data the host can pull into the model's context. A file's contents, a row from a database, a page from a wiki β these are resources. Resources are generally read-only and are addressed by an identifier so the host can fetch them on demand.
Prompts
Prompts are reusable templates or guided workflows that a server can offer. They let a server suggest a good way to use its capabilities, for instance a multi-step template for filing a well-formed bug report.
Discovery in practice
Because a host cannot know in advance what a given server offers, discovery is built into the protocol. After the handshake, the client asks the server to list its tools. The server replies with structured definitions. Here is what a single tool definition might look like:
{
"name": "search_documents",
"description": "Full-text search over the knowledge base.",
"inputSchema": {
"type": "object",
"properties": {
"query": {
"type": "string",
"description": "Search terms"
},
"limit": {
"type": "integer",
"description": "Maximum number of results",
"default": 5
}
},
"required": ["query"]
}
}
The inputSchema is ordinary JSON Schema, so the model receives a precise contract: which fields exist, which are required, and what types they take. When the model wants to use the tool, the client sends a call and the server returns a result:
{
"method": "tools/call",
"params": {
"name": "search_documents",
"arguments": {
"query": "refund policy",
"limit": 3
}
}
}
Underneath these messages, MCP uses JSON-RPC 2.0, a lightweight convention for request-and-response and for notifications. You rarely need to hand-write this; client and server libraries handle the plumbing. But knowing the shape helps when you are reading logs or debugging a connection.
How a full round trip flows
Putting the pieces in motion, a typical interaction looks like this:
- The host starts and, for each configured server, creates a client that connects and handshakes.
- Each client discovers its server's tools and reports them to the host.
- The host gives the model the combined list of available tools.
- The user asks for something. The model decides a tool is needed and names it with arguments.
- The host, often after asking the user to approve, routes the call through the right client to the right server.
- The server executes the work, enforces its own permissions, and returns a result.
- The host feeds the result back to the model, which continues reasoning or replies
This loop can repeat many times within one request as the model chains several tool calls together.
Where it gets complicated: many servers at once
A single host with two or three servers is easy to reason about. Real deployments are messier. A large organization might have dozens of servers maintained by different teams, each with its own credentials, its own update cadence, and its own blast radius if something goes wrong. Several practical questions arise at once: Which servers is a given user allowed to reach? How do we authenticate to each one without scattering secrets? How do we see, in one place, every tool call that happened and who approved it? How do we add a new server without reconfiguring every host?
These are operational problems that the base protocol deliberately leaves open. A common answer is to introduce a layer between hosts and servers so that discovery and access are not handled ad hoc by each application. In this pattern, an MCP gateway centralizes discovery and access across many servers, giving hosts a single endpoint to connect to and giving operators a single place to apply authentication, authorization, logging, and rate limits. Individual servers stay simple; the cross-cutting concerns move to the gateway.
Clearing up frequent confusions
- Client is not host. The host is the whole application; a client is one connection inside it.
- Server is not model. A server exposes capabilities; the model decides whether to use them and lives in the host.
- Tool is not resource. Tools do things and may have side effects; resources are data you read.
- Local versus remote is a deployment choice. The same tool can be served either way, with different trust and performance implications.
Key takeaways
- MCP's roles are the host (the application), the client (one connection per server), and the server (a wrapper around an external system).
- Three things cross the connection: tools (actions), resources (readable data), and prompts (reusable templates).
- Discovery is built in: clients ask servers to list their capabilities, described with JSON Schema over JSON-RPC 2.0.
- The server enforces its own boundaries, and the host is the trust boundary where user approval happens.
- Local servers run as subprocesses; remote servers are networked and shared, with the usual security considerations.
- When many servers are in play, a gateway layer centralizes discovery and access so individual servers and hosts stay simple.
Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes β full credit and traffic to the original publisher.