MCP architecture: hosts, clients, and servers
TL;DR
MCP has a three-layer architecture. The host holds the user or model context. A client, bounded by one connection per server, translates that context into protocol requests. Servers expose tools, resources, and prompts. Hosts, clients, and servers exchange JSON-RPC messages over stdio or HTTP, negotiating capabilities during initialization.
The three layers
The MCP specification defines three explicit layers. The host application manages multiple client instances and provides the surrounding context. Each client maintains exactly one connection to one server. Each server exposes the protocol primitives for a particular capability. Keeping these separate produces a clean division of responsibility.
Request lifecycle
A request begins at the host, is translated by a client into a JSON-RPC message, travels over the transport to the server, is processed, and the response returns through the client to the host. Both sides may also send notifications, which require no response.
Capability negotiation
During initialize, the client declares the capabilities it supports and the server declares its own. This tells each side which features to rely on. Negotiation lets servers and clients of different implementations interoperate safely.
Transports
The message layer is transport-agnostic. Local servers use stdio. Remote servers use HTTP. The choice affects security, authentication, and deployment, but the protocol layer stays the same.