A hands-on Python curriculum for learning the Model Context Protocol (MCP) from the ground up — protocol internals, building real servers with FastMCP, connecting to Claude Desktop and the Claude API, and shipping production-grade tools.
- A raw protocol explorer that speaks JSON-RPC directly to a server
- A wire spy that intercepts and logs live Claude Desktop ↔ server traffic
- A GitHub integration server with 10 tools and real API calls
- A SQLite knowledge base with full-text search and resource URIs
- A custom MCP client backed by the Claude API
- A multi-server orchestrator that routes tool calls across servers
- A fully packaged, Dockerized, deployable production server
| Server framework | FastMCP |
| Raw protocol | mcp Python SDK (Chapter 1 only) |
| LLM host — interactive | Claude Desktop |
| LLM host — programmatic | Claude API (anthropic SDK) |
| Transport | stdio · SSE · HTTP Streamable |
| External APIs | httpx |
| Database | sqlite3 |
| Testing | pytest + pytest-asyncio |
| Deployment | Docker · Fly.io |
git clone https://github.com/sourcecode369/mcp-playbook.git
cd mcp-playbook/src
python -m venv .venv && source .venv/bin/activate
pip install fastmcp mcp anthropic httpx python-dotenv starlette uvicorn pytest pytest-asyncio
cp .env.example .env
# Add your ANTHROPIC_API_KEY and GITHUB_TOKEN to .envClaude Desktop config:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
| # | Chapter | What You Build |
|---|---|---|
| 00 | Setup & Hosts | Dev environment, verify Claude Desktop + API |
| 01 | Protocol Foundations | Protocol explorer, wire spy |
| 02 | FastMCP Introduction | First server, utility tools |
| 03 | Tools | Async tools, error handling, system monitor |
| 04 | Resources | Notes server, knowledge base |
| 05 | Prompts | Developer workflow prompt library |
| 06 | Transports | stdio, SSE, HTTP — same server, three transports |
| 07 | Notifications, Progress & Logging | Progress tokens, structured MCP logs |
| 08 | Sampling & Roots | Server-initiated LLM calls |
| 09 | GitHub Server | 10 tools + resources against real GitHub API |
| 10 | SQLite Knowledge Base | Full-text search, resource URIs, full CRUD |
| 11 | Custom Client + Claude API | MCP client backed by Claude API agent loop |
| 12 | Multi-Server Orchestration | Route across servers, three-server pipeline |
| 13 | Auth & Security | OAuth SSE, rate limiting, audit logging |
| 14 | Testing | Unit tests, integration tests, protocol compliance |
| 15 | Inspector & Debugging | MCP Inspector, wire spy, common errors |
| 16 | Packaging & Deployment | pyproject.toml, Docker, Fly.io |
| 17 | Capstone | Personal AI Hub — multi-module production server |
- Python 3.10+
- Basic async Python (
async/await,asyncio) - Familiarity with REST APIs
- Anthropic API key (pay-per-use, ~$5–10 covers the full curriculum)
MIT