
Here's the failure this course is built around, what you'll have built by the end against revision 2026-07-28, and how every lab runs on your machine with one Docker Compose command.
Ten minutes now saves you an hour of guessing later. Install Docker, check Compose, and run one test container before the first lab.
The same call works on replica A and fails on replica B. Work out what the request itself carries, what lives in application state, and which evidence tells the two apart.
Read one self-contained request from the headers down to the tool arguments, separate routing metadata from input, and find the places where the two can contradict each other.
Transport error, protocol error, or a tool that ran and failed? Learn to tell them apart from the request and response alone, and where a client trace stops being proof.
Start the lab and build tool discovery and invocation in TypeScript, then throw valid and malformed messages at it and read what comes back.
Build the same contract in Python, run the shared fixtures against both servers and compare their answers line by line.
Add discovery and capability checks, try a supported and an unsupported version, and send calls through alternating replicas to prove no request leans on the one before it.
A timeout after the write. Follow it through the business operation and see why the request id can't tell you whether a retry will do the work twice.
Return an explicit handle and check it on every later use. Then test the three ways it goes wrong: unknown, expired, and owned by somebody else.
Move state out of one process into shared storage, restart a replica mid-workflow and check which guarantees actually survived.
Make a repeated business operation detectable with an atomic receipt and a retention window, then fire duplicates, conflicting payloads and concurrent attempts at it.
A tool call that needs a person's yes before it can finish. Find where the approval belongs and list everything that can go wrong while you wait for it.
Build the input-required result and the client retry that carries the answer, and keep request ids and workflow state from being mistaken for each other.
Tie the approval to the exact caller and operation it was given for. Reject changed arguments, an expired approval and a second use after the work is done.
Say no, walk away halfway, restart the service mid round trip. In every case, check that nothing unapproved got written.
Add cache hints to tool, prompt and resource results, and test how a client reads expiry and scope.
Build cache keys that know who asked. Run two callers and a permission change, and catch the moment one would have seen the other's result.
Make list order and pagination predictable, then change the catalog under it and see the difference between stable ordering and frozen data.
Run the same workload cached and uncached. Report latency, upstream calls and stale results, and say plainly what the numbers don't prove.
Route on method and name headers through a local gateway, and make the server refuse a request whose headers disagree with its body.
Expose a chosen tool argument as a routing header with x-mcp-header, and handle the cases where it's missing or written two different ways.
Run the encoding rules against a fixture table, reject the bad cases, and audit which argument values would end up in gateway logs.
Add per-tenant rate limits and regional routing at the gateway, then spoof the tenant and blow through the limit to make sure both get caught.
Bring up a local authorization server, a client and a protected MCP server, and follow discovery and the authorization-code flow with PKCE step by step.
Check that the authorization response came from the issuer you expected, and see what breaks when issuer data is missing, wrong or tied to another server.
Serve a client metadata document locally and validate its identity and redirect setup, keeping clear which parts are lab fixtures and which a deployment needs.
Validate tokens and enforce scopes on discovery and on calls. Then send a wrong-audience token, an expired one and one without enough scope.
Check that the client supports the tasks extension before you start a task, and keep what the protocol requires apart from what your app decides.
Start an export as a persisted task, poll it from a client, and restart the worker to prove status and results survive.
Add task input and cancellation with explicit state transitions, then race two workers and send the same input twice.
Subscribe to just the notifications a caller should get, drop the stream on purpose, and recover the real task state afterwards.
The health check is green and a tool still fails. Separate "the process is up" from "this request can be served", and gather the evidence for each.
Put the whole thing together: auth, caching, gateway policy and durable work behind a local load balancer with more than one replica.
Break a dependency and replace a replica in the middle of a workload. Check readiness, draining, and timeouts that actually end.
Add correlated logs and per-tool metrics without blowing up label cardinality, and work out what a workload costs from measured usage.
Rehearse a release with acceptance checks and a candidate built to fail, roll back, and confirm the old version still reads what the new one wrote.
What 2026-07-28 changes in a running server: the handshake and sessions that are gone, and the deprecated features that are still here for now.
Run compatibility fixtures against an older server and its clients, and write down every transport, session and capability assumption before you touch the code.
Convert a 2025-11-25 implementation to explicit handles and request-driven input, keeping the business behavior exactly as it was.
Find what still depends on deprecated registration and client features, test a move to client metadata documents, and know which fixes are only interim.
Build a rollout plan from tested compatibility and dated sources, with rollback triggers, and keep an earliest-removal date from turning into a made-up deadline.
From a call that failed on one replica to a rollout plan with a stop condition: the habit that connects them, and how it carries to a service this course never saw.
Watch an injected document drive a naive host into an export, then stop it in the host: catalog, schema, egress allowlist and a person's confirmation, in that order.
You approved a server's tools last week, and this morning one description asks the model to export the notebook first. Pin what you approved, quarantine what changed and keep two servers' same-named tools apart.
Your server can't choose the host in front of it, so its guarantees can't depend on one. Validate inputs, grant by scope, rate limit, confine reads to a root and sanitize what goes back out.
A green suite can pass with a control deleted. Remove each check in a throwaway copy, run only the attack written for it and watch it fail on an assertion, not a crash.
This course contains the use of artificial intelligence.
A tool call times out at two in the morning. The server had already written the order before the connection dropped. Your client retries, the load balancer sends the retry to another replica, and now there are two orders. Nothing in the response tells you which one is real, and every test you have still passes, because they all ran against one process.
That's the distance between an MCP server that works on your laptop and one that holds up in production. Most Model Context Protocol material ends at the first tool call that works. This course starts there and puts your server through what production does to it: two replicas behind a gateway, OAuth tokens that were issued for some other service, a person who has to approve something halfway through a call, and a release you might have to roll back at short notice.
What you'll build
One request contract in Python, and the same contract in TypeScript, sent through a proxy to alternating replicas until you can prove both give the same answer.
Explicit handles with an owner and an expiry in place of session state, and a business operation that you can tell has already run when the retry shows up.
A human approval inside a tool call with Multi Round-Trip Requests, where saying no, walking away and replaying an old answer all fail safely.
Caching that never shows one caller another caller's data, measured on a workload you can rerun yourself.
MCP authentication done properly: a local OAuth flow with PKCE, and issuer, audience and scope checked at the server, including every request you're supposed to turn away.
Durable tasks that survive a restart, then the whole service behind a load balancer with health checks, logs, per-tool metrics and a rollback you've actually rehearsed.
Written against the current spec
Everything targets revision 2026-07-28, the stateless one: no initialization handshake, no protocol sessions, and input requests that come back inside the result. If you run a server on 2025-11-25, module 9 is about moving it, with compatibility tests and the deprecated features that are still in the spec for now. You don't need to learn the old model first.
Fourteen labs, and they have to pass
Every lesson was written against a lab that had already passed on a real machine. Docker Compose is the only thing you install. Images are pinned by digest, nothing asks for a cloud account or an API key, and each lab ships checks that break the code on purpose, so you watch the tests catch the exact defect they were written for.
Five extra modules
They go past the core contract into MCP security and what real deployments need. Agent security treats tool output as data and pins the tool definitions you approved, which is where prompt injection gets in. Resources and prompts are served without ever confirming what a caller can't see. The production-gaps module covers one trace across the gateway, tokens from a real identity provider and a rate limit that holds across replicas. A decisions module maps each need to a pattern and what it costs you. The last one puts it all into a reference server with a black-box conformance suite you can point at your own server.
Who it's for
Backend and platform engineers who already write Python and can read an HTTP request and a stack trace. If you've shipped an MCP tool and wondered what happens to it behind a load balancer, this was written for you. It isn't an introduction to LLMs, and it doesn't teach MCP from zero.