Model Context Protocol (MCP)
The open standard developed by Anthropic for connecting AI models to data sources, tools, and application contexts over a unified protocol.
Model Context Protocol (MCP - Anthropic, 2024) is an open client-server protocol that standardizes how AI applications provide context, prompt templates, and tool capabilities to LLMs. Instead of writing custom API integration code for every data source (GitHub, Postgres, Slack, Google Drive) for each distinct AI application, MCP establishes a universal interface: MCP Servers expose Resources, Tools, and Prompts, while MCP Clients (Claude Desktop, IDEs) consume them over standardized JSON-RPC 2.0 transport layers (stdio / SSE).
The N×M Integration Problem vs MCP Standard
BEFORE MCP (Custom N × M Matrix):
Claude Desktop ──► Custom Github Code ──► GitHub API
VS Code Copilot──► Custom Github Code ──► GitHub API
Custom Agent ──► Custom Postgres Code ─► Postgres DB
AFTER MCP (Universal Standard Interface):
[ MCP CLIENTS ] [ MCP SERVERS ]
- Claude Desktop ─────── (JSON-RPC) ──────► GitHub MCP Server ──► GitHub API
- Cursor / VS Code ───── (Over stdio/SSE) ──► Postgres MCP Server ──► Postgres DB
- Custom AI Agents ────────────────────────► Slack MCP Server ────► Slack API
Three Core MCP Primitives
MCP PRIMITIVES
┌──────────────────────────┬──────────────────────────┬──────────────────────────┐
│ 1. RESOURCES │ 2. TOOLS │ 3. PROMPTS │
├──────────────────────────┼──────────────────────────┼──────────────────────────┤
│ Read-only data sources │ Executable functions │ Parameterized prompt │
│ (File contents, database │ (API calls, SQL queries, │ templates exposed to the │
│ rows, API responses). │ file operations). │ client UI. │
│ URI: `file:///log.txt` │ Schema: JSON Schema │ Args: `{"repo": "vllm"}` │
└──────────────────────────┴──────────────────────────┴──────────────────────────┘
Transport Architecture
- Local Process Transport (
stdio): Client launches MCP Server sub-process locally, communicating via standard input/output streams. Ideal for Desktop apps and IDE extensions. - Remote Network Transport (
SSE): Client connects over HTTP using Server-Sent Events (SSE) for server-to-client streaming, and POST endpoints for client-to-server JSON-RPC requests.
Example MCP Tool Registration (Python SDK)
from mcp.server.fastmcp import FastMCP
mcp = FastMCP("Database Explorer")
@mcp.tool()
def execute_sql_query(query: str) -> str:
"""Executes a read-only SQL query against the SQLite database."""
# MCP automatically generates JSON Schema from docstrings & type hints!
return db.execute(query).fetchall()
if __name__ == "__main__":
mcp.run(transport="stdio")
Say this out loud
"Model Context Protocol (MCP) is Anthropic's open standard unifying how AI models connect to tools and data sources. MCP Servers expose Resources (data), Tools (functions), and Prompts (templates) over JSON-RPC 2.0 via stdio or SSE. MCP eliminates N×M custom API integrations, enabling any AI client to interact with any MCP server seamlessly."
Follow-ups to expect
- How does MCP handle security and authorization? MCP Servers enforce explicit capability negotiation during initialization. MCP Clients require user consent before executing any Tool call or granting access to specific Resource URIs.
- What open MCP servers currently exist? Official open-source MCP servers exist for GitHub, PostgreSQL, SQLite, Slack, Google Drive, Puppeteer (web browsing), and local filesystem access.
Check yourself
Question 1 of 3
What core problem does the Model Context Protocol (MCP) solve for AI developers?