← All questions
Agent Protocols & ToolsMedium· MCP (Model Context Protocol)

Explain the MCP architecture — what are hosts, clients,...

Three layers, and the one-to-one relationship between clients and servers is the detail worth remembering:

  • Host — the AI application the user actually interacts with, like a desktop app or an IDE. This is where the orchestration happens.
  • Client — lives inside the host and maintains a dedicated one-to-one connection to exactly one MCP server. A host with three external tools runs three clients, not one client juggling three connections.
  • Server — a lightweight, focused program exposing a specific set of tools, resources, or prompts through the protocol. Nothing about the server needs to know which host or client is calling it.

A host talking to Google Drive, GitHub, and Slack runs three separate clients internally, each dedicated to one of those three servers, and the host itself is what decides which server to reach for at any given moment. Communication between a client and its server runs over JSON-RPC, either locally over stdio or remotely over HTTP with server-sent events, depending on where the server actually lives.

Code playground (Python)