Skip to content
Hands-on course · 17 days

MCPA hands-on

You build MCP servers and your own host with a local language model, attack them, secure them with OAuth 2.1 and run them on Kubernetes – and answer 165 exam questions, including a timed practice exam with 60 questions.

  • Free · no subscription
  • 17 days · 90–90 min each
  • 138 drills · with expected output

Companion code on GitHub

Day 6 · Drill 5: Links from a tool
# on cp1, in ~/mcpa/tag06
$ jq -c 'select(.id==9) | .result.content' r.out

Expected

[{"mimeType":"text/plain","name":"dpkg.log","type":"resource_link","uri":"log://dpkg.log"}]

As a book · Edition 2026 · PDF and EPUB

The whole course to take with you, for reading away from the screen. Reading online stays free.

With Pro: as your book of the month Pro launches soon. With a free account you can join the Pro waitlist.
Leanpub · soon Amazon · soon

What you'll be able to do

  • Build MCP servers with the official Python SDK that offer tools, resources and prompts with schemas and structured results
  • Read and hand-craft every MCP message of specification 2026-07-28 – over stdio and Streamable HTTP, with headers, error codes and multi round-trip requests
  • Write your own host that connects a local language model to several servers, asks for consent and fends off attacks such as tool poisoning and rug pulls
  • Protect an MCP server with OAuth 2.1 and Keycloak, run it on Kubernetes behind a gateway and observe it with an audit log and OpenTelemetry

What you need

LabThree VMs with Ubuntu 24.04, SSH access and sudo on a shared network – one with 4 vCPU/12 GB for the language model, two with 2 vCPU/8 GB; no GPU needed

BackgroundLinux in the terminal, reading Python, basic HTTP and JSON

InternetInternet access from the VMs for packages, Python libraries, the language model and images – after that everything runs locally, without API keys

Prior knowledgeThe course is self-contained: language model, servers, host, Keycloak and Kubernetes are built in the course. It is for administrators, platform engineers and developers preparing for the MCPA or connecting internal systems safely through MCP.

Set up your labKubernetes locally · Lab VMs

Training plan

One day = one sitting. Every day ends with a checkpoint and a challenge. About 2 hours in total.

Training days

  1. Day 0 The terrain – three VMs, a local language model and the problem MCP solvesset up access to three VMs, install Python tools and Ollama, run a language model locally, and experience by hand how a tool call works without MCP 90 min
  2. Day 1 Why MCP – host, client, server and your first serverunderstand the architecture of MCP, write a first server with the Python SDK, talk to it by hand over stdio and capture what a real client sends
  3. Day 2 JSON-RPC and messages – requests, responses, errors, versionsbe able to read and hand-write every MCP message, know the error codes and understand how protocol versions are negotiated – including with clients that still speak the old handshake
  4. Day 3 Schemas and structured databuild tools with precise input and output schemas, deliver structured results, let the schema validate inputs, and describe tools with titles and annotations
  5. Day 4 The host – connecting the language model and MCP serverswrite your own host that connects two MCP servers and the local language model, and trace the flow of a tool call from question to answer
  6. Day 5 Tools in detail – lifecycle, errors, consent, handlesKnow the full lifecycle of a tool call, write error messages a model can keep working with, run state-changing tools only with consent, and model state with handles instead of sessions
  7. Day 6 Resources – data as contextOffer and read resources and resource templates, deliver text and binary data, set cache hints, fend off path attacks, and use resources as context in the host
  8. Day 7 Prompts and completionOffer prompt templates with arguments, use them in the host as slash commands, and have arguments for prompts and resource templates completed
  9. Day 8 Streamable HTTPrun an MCP server over HTTP, talk to it directly with curl, understand headers, status codes, JSON and SSE responses, protect the server against DNS rebinding, and use it from the host
  10. Day 9 Subscriptions and progressSubscribe to server changes with subscriptions/listen, report and display the progress of long-running tools, and build clients that react to events
  11. Day 10 Follow-up questions from the serverunderstand how a server requests input from the client in the middle of a call (multi-round-trip), build follow-up questions to the human (elicitation) and to the client's model (sampling), protect the state between rounds, and write a client with matching callbacks
  12. Day 11 Trust boundariesname the trust boundaries in an MCP setup, demonstrate an indirect prompt injection and a rug pull against your own host, and build countermeasures that actually protect
  13. Day 12 Authorization Iprotect an MCP server over HTTP with OAuth 2.1, set up Keycloak as the authorization server, and walk the path from the first 401 to a valid token once by hand and once with the SDK
  14. Day 13 Authorization IIGrant rights per tool with scopes and step-up, try the three ways of client registration, and build a server that calls a second server on behalf of a human – without token passthrough and without a confused deputy
  15. Day 14 Audit and observabilityLog every call to an MCP server verifiably, trace calls across machine boundaries with OpenTelemetry, run a server with several replicas on Kubernetes, and put a gateway with rules and limits in front of it
  16. Day 15 Ecosystem and portabilityfind MCP servers in a registry and publish your own, run a private registry for the company, add the same server to different hosts, use extensions such as MCP Apps and Skills, and migrate an old server to SDK 2

More