MCP Unlocked · second edition
Build MCP servers that work. Then let your AI read the book.
A short, practical guide to Model Context Protocol servers with the official Python SDK, written against the protocol as it is now, with every listing executed before it went in.
name it at checkout
PDF, markdown, every code listing with its tests, the MCP server, and a license key. 30-day refund. Be the first to review it.
$ npx -y mcp-unlocked --license YOUR-KEY mcp-unlocked: serving 10 chapters to you@example.com > search_book("what does a 421 mean") 1. Chapter 7 › The 421 wall Deploy that behind a real hostname and every request fails: HTTP/1.1 421 Misdirected Request. This is not a bug. The app has no way to know which hostname it'll be served behind. → read_chapter(chapter=7, section="The 421 wall") >
01 · Why a second edition
Written against the protocol as it is now
The 2026-07-28 revision of MCP removed the connection handshake and sessions. The Python SDK moved to a 2.x major and renamed its server class. Most tutorials you'll find predate both, and their code no longer runs as printed.
This edition pins its versions and ran every listing on the day it was finished. If a command is in the book, its output is the real output. If a block is an excerpt, the full file is in the download, with the tests that ran against it.
- Python SDK
-
mcp2.3.0 - Protocol
- 2026-07-28
- Listings run
- All
- Test suites
- Two
02 · Contents
Nine chapters, start to deployed
- What MCP is forHosts, clients, servers, and who decides to use a tool, a resource, or a prompt. A sixteen-line server plugged into Claude Code.
- ToolsType hints as the schema, structured output, and the three different ways a tool can fail.
- Resources and promptsURI templates, MIME types, path safety, and prompts that carry documents with them.
- What's on the wireA raw JSON-RPC exchange, the stateless protocol, stdio versus Streamable HTTP, and why stdout is the wire.
- A real serverSQLite, lifespan, typed context, progress reporting, and tests with the in-memory client.
- Asking before actingConfirmation without a back-channel: resolvers, accept, decline, cancel.
- On the internetThe 421 wall, workers, bearer tokens, and the attacks the spec names.
- Living with hostsClaude Code, Claude Desktop, Cursor, VS Code, the Inspector, the Registry, and a table of what each error means.
- How we got hereFive spec revisions in twenty months, what got deprecated, and what to bet on.
03 · The server
The book runs as an MCP server
One command and a license key, and the chapters are available inside Claude Code, Cursor, or Claude Desktop whenever you're working on a server. Search it, read a section, or point its review prompt at your own code.
It's also the shortest demo of what the book teaches: a few hundred lines, and a model can read a book.
| Tools |
search_book, read_chapter, list_chapters
|
|---|---|
| Resources | Every chapter, addressable by URI, so a host can attach one as context |
| Prompts |
review_server_security audits your server against the go-live list. explain_concept and plan_my_server do what they say. |
| Install |
npx -y mcp-unlocked, or the tarball in your download for machines without registry access |
04 · Who it's for
You, if you have something an AI should reach
A database, an internal service, a pile of documents, a device. You write software and you're comfortable with Python functions and type hints. You don't need to know anything about MCP yet.
Not for you if you want TypeScript samples. The book is Python because the Python SDK is the one that implements the current protocol, and every listing had to run. If you only want to use other people's servers, chapter 8 alone is worth the price and the rest will keep.
05 · Questions
Does the server work offline?
Yes. The key is checked with Gumroad once, then cached on your machine. The download includes a tarball for machines that can't reach npm.
What if the protocol changes again?
Updates to this edition are free. The last chapter is a reading guide to the spec's changelog and deprecation registry, so keeping up costs about an hour a quarter.
Is the code copy-paste safe?
Every listing is pinned to mcp 2.3.0 and ran on the day the book was finished. Two chapter projects ship with pytest suites. Where a block in the text is an excerpt, the full file is in the download.
Why pay what you want?
Because the floor is the price of a coffee and the book is worth more than that to the people it's for. Pay what it's worth to you. 30-day refund either way.
How many machines?
One purchase, one reader, any number of your own machines. Don't share the key or the text.
06
Build a server your AI can actually use.
Then let it read the book that showed you how.