MCP architecture: host, client, server
MCP is client-server and has three participants:
- MCP Host — the AI application itself (Claude Code, Claude Desktop, VS Code). It manages one or many clients.
- MCP Client — the component that maintains a connection to one server. The host creates one client per server.
- MCP Server — a program that supplies context and tools. It can be local (a process on your machine) or remote (over the network).
A nuance worth noticing: "server" here does not necessarily mean a remote machine. An MCP server giving filesystem access runs as a separate process on your own machine and is still called a server.
The protocol has two layers:
- The data layer — the exchange protocol built on JSON-RPC 2.0: message structure, capability declaration, primitives.
- The transport layer — the communication channel: inter-process (stdio) or network (HTTP).
The separation pays off in practice: the same JSON-RPC message format works over every transport. When writing a server you mostly deal with the data layer; the SDK supplies the transport.
| Server primitive | What it is | Android example |
|---|---|---|
| Tools | Functions the model can invoke — they take action | `get_crash_details(issue_id)`, `run_instrumented_test(module)` |
| Resources | Data sources for context — they are read | Internal API docs, design-system tokens |
| Prompts | Reusable interaction templates | A "triage this crash" template |
The client side has its own primitive too: elicitation — a server can ask the user for more information or a confirmation. As of protocol version 2026-07-28 the previously available sampling and logging client primitives are deprecated; new implementations are advised not to rely on them.
Discovery works like this: the client sends a tools/list request asking what the server offers. The response carries a name, a description and an inputSchema (JSON Schema) for each tool. The model reads those descriptions to decide which tool to call.
That has a practical consequence: tool descriptions are the only thing the model sees. A badly written description means a tool that never gets used — exactly as with a skill's description field.
📚 Sources and documentation
- MCP architectureofficialmodelcontextprotocol.io
Participants, layers, primitives and a step-by-step walkthrough of the JSON-RPC exchange.
- MCP specificationofficialmodelcontextprotocol.io