CONCEPT Three roles: Host, Client, Server
MCP follows a client–server architecture with three participants. The official architecture doc defines them exactly:
- MCP Host — "The AI application that coordinates and manages one or multiple MCP clients." This is the app the user runs: Claude Desktop, Claude Code, VS Code, Cursor. The host also runs the LLM.
- MCP Client — "A component that maintains a connection to an MCP server and obtains context from an MCP server for the MCP host to use."
- MCP Server — "A program that provides context to MCP clients" — it exposes the tools, resources, and prompts.
CONCEPT Two layers: data (JSON-RPC) over transport
The spec splits MCP into two layers. The data layer is the inner layer: the JSON-RPC 2.0 protocol itself — lifecycle management, and the core primitives. The transport layer is the outer layer: the actual channel that moves bytes (connection setup, message framing, auth). The same JSON-RPC message format runs unchanged over any transport.
Servers expose three server primitives, and clients can expose client primitives back:
| Side | Primitive | What it is |
|---|---|---|
| Server exposes | Tools | Executable functions the AI can invoke (API calls, DB queries) — tools/list, tools/call |
| Resources | Data sources providing context (file contents, records) — resources/list, resources/read | |
| Prompts | Reusable interaction templates (system prompts, few-shot) — prompts/list, prompts/get | |
| Client exposes | Sampling | Server asks the host's LLM for a completion — sampling/createMessage |
| Elicitation | Server asks the user for more input — elicitation/create | |
| Logging | Server sends log messages to the client |
*/list to find what's
available, then */get or */call to use it. Discovery is dynamic — the client asks at
runtime rather than hard-coding a fixed set.DIAGRAM One host, many clients, 1:1 to servers
(Filesystem)"] S2["Server B · local
(Database)"] S3["Server C · remote
(Sentry)"] C1 ---|"dedicated 1:1"| S1 C2 ---|"dedicated 1:1"| S2 C3 ---|"dedicated 1:1"| S3 LLM -.->|"uses context"| C1 classDef host fill:#d4edda,stroke:#28a745,color:#155724; classDef srv fill:#ffe8cc,stroke:#ff9f40,color:#9a4a0a; class C1,C2,C3,LLM host; class S1,S2,S3 srv;
CODE The Claude-side connector: host declares its servers
When Claude is the host (Messages API MCP connector, beta mcp-client-2025-11-20), you declare
each server in mcp_servers and reference it from a mcp_toolset. Claude spins up one
client per server — the host/client/server roles made concrete.
# Python — Claude as MCP host connecting to a remote server response = client.beta.messages.create( model="claude-opus-4-8", max_tokens=1024, betas=["mcp-client-2025-11-20"], # The HOST declares each SERVER (one client is created per entry) mcp_servers=[ { "type": "url", "name": "example-mcp", "url": "https://example.com/mcp" } ], # Reference the server by name so its tools are exposed to the model tools=[{ "type": "mcp_toolset", "mcp_server_name": "example-mcp" }], messages=[{ "role": "user", "content": "Use the MCP tools" }], )
TRADE-OFFS One client per server vs. one shared connection
✅ 1:1 client-per-server (the MCP model)
- Clean isolation — one server's failure or restart affects only its client
- Per-server capability negotiation and auth
- Local (stdio) and remote (HTTP) servers coexist naturally
⚠️ Imagining one client multiplexing all servers
- Fewer connection objects to track
- But: not how MCP works — capabilities, lifecycle, and auth are per-connection
- A shared pipe couples unrelated servers together
EXAM TRAPS
PRACTICE
Q1 · A host connects to a Filesystem server and a Sentry server. How many clients exist?
Two — one client per server, each holding its own dedicated 1:1 connection. The host instantiates a separate MCP client object for every server it connects to.
Q2 · Name the three server primitives and the pattern used to access them.
Tools, resources, and prompts. Each is accessed via
*/list for discovery and then */call (tools) or */get / */read
to use it. Discovery is dynamic, done at runtime.
Q3 · Which layer is JSON-RPC 2.0, and which handles message framing?
JSON-RPC 2.0 is the data layer (the inner layer: lifecycle + primitives). Connection setup, message framing, and auth are the transport layer (the outer layer). The same JSON-RPC messages ride unchanged over whichever transport is in use.