Skip to content

sourcecode369/mcp-playbook

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 

Repository files navigation

MCP Playbook

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.


What You Will Build

  • 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

Stack

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

Quick Start

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 .env

Claude Desktop config:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json

Chapters

# 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

Prerequisites

  • 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)

License

MIT

About

Learn MCP inside out: protocol foundations, FastMCP, Claude Desktop & Claude API hosts, real projects, testing, and production deployment.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages