Architecture
Hosts, Clients and Servers
MCP splits the work into three roles: the host connects to the model, a client handles each connection, and a server provides the tools and data.
MCP Hoste.g. Claude Code
stdiostdioHTTPLLMoften a cloud API
Host appchat, approvals
Client 1
Client 2
Client 3
Filesystem serverlocal process
Database serverlocal process
GitHub serverremote, over HTTPS
GitHub API
Host
The AI application that talks to the LLM, asks users before tools run, and runs one client per server. Examples: Claude Code, Claude Desktop, ChatGPT, Cursor and VS Code.
Client
A connector inside the host that keeps a stateful connection to exactly one server. It negotiates capabilities and relays messages.
Server
A program that exposes tools, resources and prompts over MCP. It runs locally as a subprocess or remotely as a web service.