Skip to content

Latest commit

History

19 Commits

Folders and files

NameName
Last commit message
Last commit date

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 frameworkFastMCP
Raw protocolmcp Python SDK (Chapter 1 only)
LLM host — interactiveClaude Desktop
LLM host — programmaticClaude API (anthropic SDK)
Transportstdio · SSE · HTTP Streamable
External APIshttpx
Databasesqlite3
Testingpytest + pytest-asyncio
DeploymentDocker · 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

#ChapterWhat You Build
00Setup & HostsDev environment, verify Claude Desktop + API
01Protocol FoundationsProtocol explorer, wire spy
02FastMCP IntroductionFirst server, utility tools
03ToolsAsync tools, error handling, system monitor
04ResourcesNotes server, knowledge base
05PromptsDeveloper workflow prompt library
06Transportsstdio, SSE, HTTP — same server, three transports
07Notifications, Progress & LoggingProgress tokens, structured MCP logs
08Sampling & RootsServer-initiated LLM calls
09GitHub Server10 tools + resources against real GitHub API
10SQLite Knowledge BaseFull-text search, resource URIs, full CRUD
11Custom Client + Claude APIMCP client backed by Claude API agent loop
12Multi-Server OrchestrationRoute across servers, three-server pipeline
13Auth & SecurityOAuth SSE, rate limiting, audit logging
14TestingUnit tests, integration tests, protocol compliance
15Inspector & DebuggingMCP Inspector, wire spy, common errors
16Packaging & Deploymentpyproject.toml, Docker, Fly.io
17CapstonePersonal 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

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages