Agents, Tool Use & MCP·Question 8 of 90Basic

Describe MCP's architecture and its primitives.

Type it the way you would explain it to an interviewer. A few sentences is enough; you can't break anything.

Model answer: the part to lead with

Three roles: host, client, server. The host is the LLM application (Claude Desktop, an IDE, an agent harness). Inside the host, each connection to a server is managed by a dedicated client - one client per server, 1:1. The server is a (often small) program exposing capabilities: it might wrap a database, a SaaS API, or the local filesystem. Communication is JSON-RPC 2.0 over a transport. Since the 2026-07-28 revision, version negotiation is per request rather than per connection: every message declares its revision through the io.modelcontextprotocol/protocolVersion key in _meta (carried as the MCP-Protocol-Version header on Streamable HTTP), and the server accepts or rejects each request independently, returning UnsupportedProtocolVersionError listing the versions it does support. A client that wants to settle the version up front can call server/discover, a mandatory RPC returning supported versions, capabilities and identity in one round trip, but calling it is optional. The older initialize/initialized capability-negotiation handshake is now the backward-compatibility path for revisions 2025-11-25 and earlier.

Full worked answer with diagram

Three roles: host, client, server. The host is the LLM application (Claude Desktop, an IDE, an agent harness). Inside the host, each connection to a server is managed by a dedicated client - one client per server, 1:1. The server is a (often small) program exposing capabilities: it might wrap a database, a SaaS API, or the local filesystem. Communication is JSON-RPC 2.0 over a transport. Since the 2026-07-28 revision, version negotiation is per request rather than per connection: every message declares its revision through the io.modelcontextprotocol/protocolVersion key in _meta (carried as the MCP-Protocol-Version header on Streamable HTTP), and the server accepts or rejects each request independently, returning UnsupportedProtocolVersionError listing the versions it does support. A client that wants to settle the version up front can call server/discover, a mandatory RPC returning supported versions, capabilities and identity in one round trip, but calling it is optional. The older initialize/initialized capability-negotiation handshake is now the backward-compatibility path for revisions 2025-11-25 and earlier.

Server-side primitives (what a server offers):

  • Tools - model-controlled actions ("call create_issue with these args"). Discovered via tools/list, invoked via tools/call. This is the primitive that maps onto function calling.
  • Resources - application-controlled data: documents, schemas, file contents, identified by URI. The host decides what to load into context; the model doesn't fetch them by itself.
  • Prompts - user-controlled templates the host can surface (e.g., slash commands) that expand into structured prompt content.

The tools/resources/prompts split is a deliberate control hierarchy - model-chosen vs app-chosen vs user-chosen - and naming it is what separates a real answer from a buzzword answer.

Client-side primitives (what a server can ask of the host):

  • Sampling - the server requests an LLM completion through the host, so servers can use model intelligence without holding API keys (host/user keeps approval control). Deprecated in the 2026-07-28 revision: servers are now expected to call model APIs directly.
  • Roots - the host tells the server which filesystem locations it may operate in. Also deprecated in 2026-07-28, in favour of paths passed as tool parameters, resource URIs or server configuration.
  • Elicitation (added in the 2025 spec revisions) - the server asks the host to collect input from the user mid-operation. In 2026-07-28 it survives as a multi round-trip request: the server returns an input-required result, and the client re-issues the original call with the user's answers attached.

Transports: stdio - the host spawns the server as a subprocess and speaks over stdin/stdout; simplest, local-only, inherits local privileges. Streamable HTTP - a single HTTP endpoint with optional SSE streaming for remote/shared servers with real auth; it replaced the older HTTP+SSE two-endpoint transport in the 2025-03-26 spec revision.

Worth sketching. The one-client-per-server line and the arrow pointing back at the host are the two things people get wrong.

flowchart LR
    A["Host: the LLM app"] --> B["Client 1"]
    A --> C["Client 2"]
    B -->|"JSON-RPC 2.0 over stdio"| D["Server: filesystem<br/>tools, resources, prompts"]
    C -->|"JSON-RPC 2.0 over HTTP"| E["Server: GitHub"]
    E -->|"elicitation, only mid-request"| A

What a good answer covers

  • The host is the LLM application (Claude Desktop, an IDE, an agent harness)
  • Inside the host, each connection to a server is managed by a dedicated client - one client per server, 1:1
  • The server is a (often small) program exposing capabilities
  • Communication is JSON-RPC 2.0 over a transport
  • Since the 2026-07-28 revision, version negotiation is per request rather than per connection

Key terms: host · client · server · Server-side primitives · Tools · Resources · Prompts · Client-side primitives · Sampling · Roots

Interviewer follow-ups to expect

  1. Why does sampling route through the host instead of the server calling a model API directly?

  2. When would you expose data as a resource instead of a "search" tool?

Worked answer from AI-Engineer-Interview-Questions by Om (MIT), reformatted for LLM Prep · answer text last updated 6 November 2026 · scoring and review schedule by LLM Prep