The Model Context Protocol (MCP) is an open standard that lets LLM applications connect to external data sources and tools through a unified interface. This lesson covers the protocol architecture, transport layers, and the three core primitives.
Before MCP, every LLM application had to build custom integrations for each data source or tool. This led to fragmented, N×M integration problems: N applications × M data sources = N×M custom connectors.
MCP solves this by defining a universal protocol between LLM applications (hosts) and data/tool providers (servers). Any MCP-compatible host can connect to any MCP server without custom integration code.
Analogy: MCP is to LLM applications what USB is to peripherals. Before USB, every device needed a custom port. MCP provides a standard “port” for connecting AI models to the world.
MCP was created by Anthropic and released as an open-source specification in late 2024. It is supported by Claude Desktop, Claude Code, and a growing number of third-party hosts.
MCP defines three roles:
| Role | What It Does | Examples |
|---|---|---|
| Host | The LLM application that users interact with | Claude Desktop, Claude Code, IDEs |
| Client | Maintains a 1:1 connection with a server (lives inside the host) | MCP client library in the host process |
| Server | Exposes tools, resources, and prompts via MCP protocol | Filesystem server, GitHub server, Slack server |
A single host can connect to multiple servers simultaneously. Each connection is managed by a separate client instance. The host aggregates capabilities from all connected servers and makes them available to the LLM.
┌─────────────────────────────────────┐
│ HOST (Claude Desktop) │
│ ┌──────────┐ ┌──────────┐ │
│ │ Client A │ │ Client B │ ... │
│ └────┬─────┘ └────┬─────┘ │
└───────│──────────────│──────────────┘
│ │
┌────▼─────┐ ┌────▼─────┐
│ Server A │ │ Server B │
│(filesystem)│ │ (GitHub) │
└──────────┘ └──────────┘
MCP supports two transport mechanisms for communication between client and server:
Under both transports, messages use JSON-RPC 2.0 encoding. The transport is just the delivery mechanism; the message format is the same.
MCP servers expose three types of capabilities:
| Primitive | Controlled By | Analogy | Example |
|---|---|---|---|
| Tools | Model (LLM decides when to call) | POST endpoint | create_issue, run_query |
| Resources | Application (host decides what to include) | GET endpoint | file://config.json, db://users |
| Prompts | User (selects from a menu) | Template | “Summarise this PR”, “Debug this error” |
Key distinction: Tools are actions the model takes. Resources are data the application loads into context. Prompts are templates the user selects. Getting this right is essential for good MCP server design.
The MCP ecosystem is growing rapidly. Hundreds of servers are available for common integrations:
| Category | Servers |
|---|---|
| Developer tools | GitHub, GitLab, Linear, Sentry |
| Data & databases | PostgreSQL, SQLite, Elasticsearch |
| Productivity | Slack, Google Drive, Notion, Jira |
| Web & search | Brave Search, Fetch, Puppeteer |
| File systems | Filesystem, S3, Google Cloud Storage |
You can find servers on the official MCP servers repository and community registries. In the next lesson, you will build your own.
Live demonstration: connecting Claude Desktop to an MCP server.
claude_desktop_config.json)