πŸ“˜ Basics

MCP (Model Context Protocol): The USB-C for AI Agents

Anthropic's open standard for connecting Claude/GPT to tools, databases, and APIs. Build your first MCP server in 30 minutes.

πŸ“… June 30, 2026 πŸ“Š Level: intermediate πŸ“¦ GitHub: modelcontextprotocol/modelcontextprotocol

MCP: The USB-C for AI Agents

MCP (Model Context Protocol) is Anthropic’s open standard for connecting AI agents to external tools. Released Nov 2024, hit 1M+ MCP servers by mid-2026.

What is MCP?

Think USB-C for AI:

The architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    MCP     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Host     │◄─────────►│  MCP Server  β”‚
β”‚ (Claude)   β”‚   JSON-RPC β”‚ (your tool)  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜            β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Your first MCP server (Python)

pip install mcp
# weather_server.py
from mcp.server import Server
from mcp.types import Tool

app = Server("weather")

@app.tool()
def get_weather(city: str) -> str:
    """Get current weather for a city."""
    return f"Sunny, 72Β°F in {city}"

app.run()

Connect from Claude Code

Add to ~/.config/claude-code/mcp.json:

{
  "mcpServers": {
    "weather": {
      "command": "python",
      "args": ["weather_server.py"]
    }
  }
}

Now in Claude Code: β€œWhat’s the weather in Beijing?” β€” Claude uses your MCP tool automatically.

Real-world examples

Key takeaways