Building MCP Servers
Design, build and ship Model Context Protocol servers that agents use well, and see how MCP's mental model differs from REST.
3 modules · 8 lessons~26 hoursUpdated 2026-11-02
- Lessons8
- Quizzes8
- Sources56
- Of study~26h
About this course
About this course
MCP servers are how agents reach your systems, and most of them are thin wrappers over a REST API that agents use badly. This course takes the protocol apart (JSON-RPC messages, the stateless 2026 revision, stdio and Streamable HTTP), then builds one server from an existing REST API: tools designed for a model rather than a developer, resources, prompts and confirmations, remote deployment with OAuth, defences against prompt injection, and the tests and agent evaluations that tell you it works. REST is the contrast throughout: what MCP borrowed from it, and where the two deliberately differ. Everything is TypeScript on the official SDK, and the agent evaluations run on your Claude subscription.
About the running example
The examples follow Larchmere, a fictional software company whose support team works in Larchmere Desk, an internal helpdesk with a REST API for tickets, customers, help articles and incidents. You build the MCP server that lets agents work with it: Claude Code for engineers, a triage agent, and Claude for the support team. A ticket is a customer's request, and an incident is an outage that several tickets can be linked to.
What you'll learn.
- 1Explain how MCP's model differs from REST (who decides to call, interface granularity, state, discovery, errors, caching) and when an MCP server is the right interface
- 2Read and write MCP messages on the wire, and serve both current and 2025-era clients over stdio and Streamable HTTP
- 3Design task-shaped tools with clear schemas, structured results, honest annotations and errors a model can act on, instead of wrapping endpoints one to one
- 4Test a server at the protocol level and evaluate it with an agent on checkable tasks, comparing designs with numbers
- 5Add resources, prompts and confirmations, deploy a stateless remote server behind OAuth, and defend it against prompt injection and token misuse
- 6Ship and evolve a server without breaking the agents that depend on it
3 modules, 8 lessons.
9h 55m of lessons
Module 1 · 2 lessons · 2h 35m
The protocol and its mental model
What MCP standardises, how it differs from REST, and what actually crosses the wire.
Module 2 · 3 lessons · 3h
Designing servers agents use well
Task-shaped tools, measured with tests and agent evaluations, plus resources, prompts and asking the user for input.
Module 3 · 3 lessons · 4h 20m
Running servers in production
Remote deployment with OAuth, security against injection and token misuse, and shipping changes safely.
Ship an MCP server for an existing REST API
Turn Larchmere Desk's REST API into larchmere-desk, a production MCP server with task-shaped tools, resources and confirmations, tests in both protocol eras, an agent evaluation against a naive wrapper, OAuth on a stateless HTTP endpoint, a red-team with canaries, and a contract check in CI.