MCP — Model Context Protocol
What Is MCP?
Model Context Protocol (MCP) is an open standard by Anthropic that defines how applications expose tools, resources, and prompts to LLMs in a unified way.
Think of MCP as USB-C for AI — one standard connector so any LLM can plug into any tool/data source.
Docs: https://modelcontextprotocol.io/introduction
Why It Matters
Without MCP: every AI app builds custom integrations per tool (Slack, GitHub, DB, etc.) With MCP: tools expose a standard interface → any MCP-compatible LLM can use them
Key Concepts
| Concept | Description |
|---|---|
| MCP Server | A process that exposes tools/resources/prompts over the protocol |
| MCP Client | The LLM application that connects to servers (Claude Desktop, Claude Code, custom apps) |
| Tools | Functions the LLM can call (e.g., search_github, query_db) |
| Resources | Data the LLM can read (e.g., file contents, API responses) |
| Prompts | Reusable prompt templates exposed by the server |
Architecture
LLM App (MCP Client)
↕ MCP Protocol (JSON-RPC over stdio / HTTP)
MCP Server
↕ Native API
External Tool / Data Source (GitHub, Slack, DB, filesystem...)
Using MCP with LangChain
from langchain_mcp_adapters import MCPClient
# Connect to an MCP server
client = MCPClient("path/to/mcp/server")
# Get tools from the server — use them directly in LangChain
tools = client.get_tools()
# Use in an agent
from langchain.agents import create_agent
agent = create_agent(model="claude-sonnet-4-5", tools=tools)
Lib: https://github.com/langchain-ai/langchain-mcp-adapters
Common MCP Servers
| Server | What it exposes |
|---|---|
@anthropic/mcp-filesystem | Read/write local files |
@anthropic/mcp-github | GitHub repos, PRs, issues |
@anthropic/mcp-brave-search | Web search |
@anthropic/mcp-postgres | PostgreSQL queries |
| Custom servers | Any API you wrap |