Model Context Protocol: The Complete Course
How AI applications connect to tools and data through one open protocol: why it exists, what goes over the wire, how to build servers and hosts, how to authorise and secure them, and how to run them in production, built on one small project from the first lesson to the last.
You build one thing: a research notes assistant for Nare, who runs a small sleep and memory lab with Priya and Tomas. It starts as an MCP server over eight Markdown notes and grows into a host that lets a model search the notes and the lab's equipment calendar, saves new notes only with Nare's approval, checks who is asking over HTTP, resists instructions planted in a note, and runs as two replicas behind a balancer. The lab is fictional and its data is simulated; every lesson also opens with a real, cited case.
Who this course is for
You can write Python: functions, classes, dictionaries, async and await at a basic level, running a notebook. You know roughly what HTTP and JSON are. You do not need to have used MCP before.
| You are... | Start at |
|---|---|
| New to MCP | Module 1, and go in order |
| A developer who has built a small MCP server already | Module 2 (the 2026-07-28 wire format changed a lot), then Module 3 |
| Building a host or an agent that uses MCP servers | Module 1, Lesson 3, then Modules 6 and 10 |
| Responsible for security | Module 1, then Modules 7 and 8 |
| Responsible for running servers in production | Modules 2, 5 and 9 |
| New to calling language models | The LLMs course, Modules 1 and 6, first |
Every module's README lists what you need to know before starting it, so you can check whether it is safe to skip the one before.
What you need
- A Google account, to run code in Google Colab. Nothing to install.
- One free API key, from Groq or Google Gemini, for the lessons where a model chooses tools. Or no key at all, if you run a model on your own computer with Ollama and work in a code editor.
- For a few steps (a desktop host, the MCP Inspector, a real identity provider, containers), your own computer. Those steps say so, and one page covers running the course locally: section 7 of course-guide/02.
Setup takes about fifteen minutes: course-guide/02-setup-colab-and-llm-providers.md.
The modules
| # | Module | What you add to the notes assistant | Needs first |
|---|---|---|---|
| 1 | Foundations | The notes, NoteStore, chat() for three providers, "search my notes" with function calling and then as an MCP server, in memory and over stdio | Python |
| 2 | Protocol Architecture and Transports | A raw wire driver, the error codes, versions and discovery, stdio and Streamable HTTP, Origin and Host checks | Module 1 |
| 3 | Tools | search_notes and create_note with schemas, annotations, results and errors; tool choice measured on 20 questions | Module 1 |
| 4 | Resources, Prompts, and User Interaction | notes://index, notes://{note_id}, summarise_topic; confirmation by form; a key collected by URL, never in the chat | Modules 1 and 3 |
| 5 | Building Servers | The server as a configured, tested package; a long-running reindex with progress and cancellation | Modules 1, 3 and 4 |
| 6 | Building Clients and Hosts | A host with an agent loop, a second server, namespacing, approvals, timeouts and a tool search | Modules 3 and 5 |
| 7 | Authorization | Token verification with audience and scopes on the HTTP server: read for Priya and Tomas, write for Nare | Modules 2 and 5 |
| 8 | Security | Six attacks run and then stopped, pinned tool definitions, defences measured layer by layer | Modules 3 and 6; Module 7 helps |
| 9 | Production and Ecosystem | Stateless replicas, rate limits, redacted logs, tracing, a resumable bulk import, a registry entry, a container | Modules 2, 5 and 7 |
| 10 | Design Patterns and Agentic Systems | A task-shaped server, composition, a retrieval server, an evaluation with a regression gate | Modules 3 and 6 |
| 11 | Capstone | The finished repository against an acceptance checklist, six questions, and a record of what broke | The modules before it |
Where other courses go deeper
This course stays on the protocol and the systems built around it. For depth elsewhere:
- How language models choose tools, structured output and tool calling without MCP: Module 6 of the LLMs course.
- Agents that act unattended, with durable state, where MCP is one tool among many: the Agentic AI Engineer course. Its Module 4 is a shorter introduction to MCP; this course links to it where the two overlap.
- Retrieval pipelines (chunking, embeddings, hybrid search, reranking): the RAG course. Module 10 here builds only a small retrieval server.
- Web services, databases and deployment as general engineering: the AI Engineering course.
How each lesson works
Every lesson is a walk through one example from Nare's lab, one picture at a time:
- The situation: a specific problem in the lab.
- A real case, first: something that really happened, from a published source, cited.
- The idea: fifteen to thirty figures, one idea each, one running example.
- Run it: code with a walkthrough of every line.
- Break it: a failure you cause on purpose.
- In production: what teams do with this at scale.
- Check yourself: questions, one exercise, key terms and sources.
Each module ends with a lab (a guided piece of the notes assistant) and an incident file (a real, published failure replayed in the lab and fixed). Every output shown in the course comes from a real run. More detail: course-guide/01-how-this-course-works.md.
The tools you will use
Python throughout. The official MCP Python SDK (mcp 2.3.0, protocol revision 2026-07-28, checked 13 October 2026) for every server and client. LangChain for calling models and LangGraph for loops and approvals, so the same code works with Groq, Gemini or Ollama. PyJWT for tokens, OpenTelemetry for tracing, Redis (with fakeredis in a notebook) and RQ for jobs, pytest for tests, and Docker for the container. Everything is open source apart from the hosted model services.
Course guide
| File | Read it when |
|---|---|
| 01-how-this-course-works.md | Before your first lesson |
| 02-setup-colab-and-llm-providers.md | Before you run any code; it also shows how MCP runs in a notebook and how to work locally |
| 03-the-notes-assistant.md | To meet the lab, the people, the fixed names, the dates and the repository |
| 06-shared-data.md | To see the notes and fixtures every module reuses |
| 04-style-guide.md | Only if you are writing or editing lessons |
| 05-image-style-guide.md | Only if you are drawing the course figures |
The one measure
When a model reaches a tool through your server, does it get exactly what it should, only what it should, and only when the person it acts for would agree? Almost everything in this course exists to answer that with tests you can run.