MCP (Model Context Protocol): How LLMs Connect to External Tools and Data Sources
What It Is
MCP, short for *Model Context Protocol*, is an open communication protocol published by Anthropic in November 2024. It defines a standardized interface that allows a large language model (LLM) to interact with external tools, data sources, and services — local files, databases, REST APIs, Git repositories, and more — without requiring a custom integration for every model × tool combination.
Before MCP, every LLM vendor or AI agent framework had to design its own tool-use mechanism: OpenAI introduced *function calling* in June 2023, LangChain has its *tools* abstraction, AutoGPT had plugins. These approaches are functionally similar but syntactically incompatible, forcing developers to rewrite connectors every time they switch models or frameworks. MCP proposes a shared abstraction layer: an MCP server exposes capabilities (tools, resources, prompts), and an MCP client — typically the application orchestrating the LLM — consumes them via a JSON-RPC 2.0 protocol transported over stdio or HTTP+SSE.
How It Works
The MCP architecture involves three entities: the **client**, the **server**, and the **host**. The host is the user-facing application (Claude Desktop, an IDE, a custom agent). The client is the library embedded in the host that speaks the MCP protocol. The server is a separate process — often a Node.js or Python script — that exposes **primitives**: **tools** (callable functions), **resources** (readable data, such as a file or URL), and **prompts** (reusable parameterized templates).
The default transport is **stdio**: the host spawns the MCP server as a subprocess, and the two communicate over stdin/stdout using JSON-RPC 2.0. For remote scenarios, MCP supports HTTP with Server-Sent Events (SSE), enabling an MCP server to be hosted on a web endpoint. Capability negotiation happens at startup via an `initialize` / `initialized` handshake: the client announces its protocol version (currently `2024-11-05`), and the server responds with the primitives it supports.
Concrete example: a developer configures Claude Desktop to use the official `@modelcontextprotocol/server-filesystem` MCP server (available on npm). This server exposes a `read_file` tool and a `write_file` tool. When the user asks Claude "Read my `config.yaml` file and fix the syntax errors," Claude generates a structured tool call, the MCP client routes it to the filesystem server, which reads the file from disk and returns its contents. Claude receives that content in its context and produces the corrected output — without Anthropic having to hard-code a filesystem integration inside Claude Desktop.
The tool description schema is close to standard JSON Schema. Each tool declares a `name`, a natural-language `description` (used by the LLM to decide when to call it), and an `inputSchema` JSON Schema object. This description is injected into the model's context at inference time, which means the quality of the `description` field directly influences tool-use reliability. MCP servers can also expose **resources** with a URI (e.g., `file:///home/user/notes.md`) that the client can read on demand, and **prompts** that users can invoke directly from the host interface.
Why It Matters Now
The problem MCP solves is integration fragmentation in agentic systems. An AI agent that needs to access GitHub, Slack, a PostgreSQL database, and a local filesystem currently has to maintain four separate connectors, often tightly coupled to a specific framework (LangChain, LlamaIndex, CrewAI). If the team switches models — say from GPT-4o to Claude 3.5 Sonnet — the connectors must be rewritten or adapted. MCP decouples the server (which knows the tool) from the client (which knows the model): an MCP server written once works with any MCP client, regardless of the underlying LLM.
For teams building production agents, this reduces technical debt and speeds up the addition of new capabilities. For tool vendors (Notion, Linear, Brave Search, etc.), it opens a standardized channel to make their products accessible to AI agents without depending on a direct partnership with OpenAI or Anthropic. By early 2025, companies including Block, Replit, Sourcegraph, and Zed had announced native MCP integrations, and the official `modelcontextprotocol/servers` repository already lists dozens of reference servers covering filesystem, Git, SQL databases, Brave Search, Google Drive, and Puppeteer.
Key Players
**Anthropic** authored the protocol and maintains the official SDKs in TypeScript (`@modelcontextprotocol/sdk`, v1.x) and Python (`mcp`, v1.x on PyPI), along with a collection of reference servers on GitHub. **Claude Desktop** (macOS and Windows) is the first mainstream MCP host. **Zed** (code editor) and **Replit** have integrated MCP on the IDE side. **LangChain** published an MCP adapter for its tools abstraction (`langchain-mcp-adapters`). **OpenAI** has not officially adopted MCP as of March 2025 and continues to maintain its own function-calling format, though the community has produced bridges. Notable third-party servers include `mcp-server-git` (Anthropic), `mcp-server-postgres` (Anthropic), `mcp-server-brave-search` (Anthropic), and `mcp-server-github` (GitHub/community).
Further Reading
- **Official MCP Documentation** — [modelcontextprotocol.io/docs](https://modelcontextprotocol.io/docs) — The complete protocol reference: specification, quickstart guides, and detailed architecture walkthroughs.
- **GitHub repo `modelcontextprotocol/servers`** — [github.com/modelcontextprotocol/servers](https://github.com/modelcontextprotocol/servers) — Official collection of reference MCP servers (filesystem, Git, databases, APIs) with annotated source code.
- **Python SDK `mcp`** — [github.com/modelcontextprotocol/python-sdk](https://github.com/modelcontextprotocol/python-sdk) — Official Python SDK for building MCP clients and servers, with worked examples.
- **Protocol Specification** — [spec.modelcontextprotocol.io](https://spec.modelcontextprotocol.io) — Formal, versioned technical specification including message schemas and capability negotiation rules.
- **Anthropic Launch Blog Post (Nov. 2024)** — [anthropic.com/news/model-context-protocol](https://www.anthropic.com/news/model-context-protocol) — Design rationale, motivations, and partner integration examples from the protocol's public launch.
Summary generated by Claude — human-verified