From the shape of JSON-RPC and the handshake to servers built with the official Python SDK, a dispatcher using only the standard library, tools and how to report failures, annotations and human approval, resources and prompts, Streamable HTTP, and authorization and secrets. Over 20 lessons you get to where you can build an MCP server that follows the spec, safely. The exchanges were run against spec version 2026-07-28 and the official SDK 2.3.0, and you can assemble the server parts in Python right in your browser.
about 2.5 hours in total (estimate)
The 20 lessons are split into 5 chapters. We recommend going in order from chapter 1,
but feel free to dip into whatever catches your interest.
Note: The content follows MCP spec version 2026-07-28 and the official Python SDK 2.3.0 (November 2026). The spec changes quickly, so check the official spec and your SDK version. The server parts use only the Python standard library and run right in your browser; code that uses the SDK runs on your own machine with uv.
Take this chapter's review quiz ›
Learn the roles of MCP hosts, clients, and servers and the JSON-RPC 2.0 message shapes underneath them, then build your first server with the official Python SDK. By the end you'll settle the protocol version both the new way of the 2026-07-28 spec and through the old handshake many clients still use.
Take this chapter's review quiz ›
Without the SDK, you'll build reply shapes, method routing, and the stdio rules one small json-only function at a time. At the end, you'll assemble a server from functions that answers server/discover, tools/list, and tools/call.
Take this chapter's review quiz ›
Learn a tool's definition fields, the two ways to report failure, and annotations and human approval, from both the spec and real measurements. At the end, you'll build a tools/call that validates arguments with inputSchema and returns problems as an isError result.
Take this chapter's review quiz ›
Learn to serve data such as files and listings as resources and templates a person picks as prompts, keep file paths in bounds, and paginate long lists. At the end you'll write an audit that finds instructions hidden in tools/list descriptions and definitions that changed after approval.
Take this chapter's review quiz ›
Step beyond local stdio: learn the rules for serving over Streamable HTTP, how to handle authorization and secrets, and how to check your work with the Inspector and tests. Finally, you'll pull all the parts together into an MCP server that holds up even against hostile input.
Once you finish all 20 lessons, try your server from the connecting side in Claude Code for Beginners, go deeper on web API design in API Design for Beginners, or learn more about authorization in Authentication and Membership for Beginners. Membership unlocks every course.