Udemy
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
MCP: Model Context Protocol Server Development in TypeScript
New
3 students

MCP: Model Context Protocol Server Development in TypeScript

Build MCP servers callable from AI assistants and editors. 50 auto-graded labs: remote MCP, OAuth, npm. No API keys
Created byM Sakai
Last updated 10/2026
English

What you'll learn

  • Build MCP servers from scratch in TypeScript with the official SDK, Zod schemas, structured output, validation, and actionable errors.
  • Use Tools, Resources, and Prompts with URI templates, subscriptions, binary data, and links between tools and resources.
  • Protect practical servers with safe file access, read-only SQLite, rate limiting, pagination, and automated tests.
  • Implement MCP clients, sampling, elicitation, roots, completion, and a small agent that runs a tool-use loop.
  • Move from stdio to Streamable HTTP and implement stateless design, Origin validation, OAuth metadata, and JWT verification.
  • Add automated testing, prompt-injection defenses, OpenTelemetry tracing, Tasks, MCP Apps, and npm packaging.
  • Build a capstone MCP server for a real problem and distinguish passing automated tests from useful behavior in a real client.

Course content

7 sections • 104 lectures • 8h 21m total length
  • Course Overview - The map of 50 exercises and how to work through them10:03
  • How to Work - From opening the material to passing your first grading8:58
  • Exercise materials and Google Cloud Shell setup3:01
  • Google Cloud Shell documentation and usage limits0:46

Requirements

  • Basic TypeScript or JavaScript syntax: variables, functions, objects, imports, and enough asynchronous code to read the examples.
  • A PC with internet and a modern browser. Cloud Shell requires a Google account verified as age 18+. Upload the exercise ZIP and run the setup script. Free quota: 50 hours/week, 5GB storage. A local alternative is included.
  • Grading requires no API keys or paid Google Cloud resources. External API grading tests use stubs. Save work in the home directory and back it up for long-term storage.
  • For the local alternative, install Node 24 or newer, then run npm ci and npm run smoke. No prior MCP knowledge is required.

Description

This course contains the use of artificial intelligence.

"I get MCP as a user. But what about building one?" This course answers that question in code.

MCP (Model Context Protocol) is a shared standard connecting AI assistants to outside tools and data. Most material available today leans toward the using side: plugging an existing MCP server into an AI tool. But the real value appears when you move to the other side and expose your own business data and internal systems in a form an AI can call. This course covers only that building side, as 50 exercises in TypeScript.

This is not a course you read, or a course you watch. All 50 exercises run to the same rhythm: task, acceptance criteria, implement it yourself, grade it with npm run check, then check your work in the review video. There are two videos per exercise. The problem video hands you the knowledge and the expected result, you pause there and write it yourself, and the review video covers the model answer, common errors and the design decisions. Nothing about this course lets you watch it through with your hands still.

The curriculum is six chapters. Chapter 1 covers Tools in 10 exercises: registerTool, Zod schemas, structured output, error design, progress notifications and logging. Chapter 2 covers Resources and Prompts in 8 exercises: URI templates, binary data, subscription notifications, prompts with arguments, and resource_link. Unlike Tools-heavy material, all three primitives are practised evenly, by hand.

From Chapter 3 the servers get practical. In the file exercises, the test actually attacks your server with path traversal. Read-only SQLite queries, REST API wrappers, rate limiting, CSV analysis, pagination. It also gets into a design question specific to MCP: how to return results without eating up the context window. Chapter 4 turns to the client side. In exercise 29 you write the test harness that has been grading you all along, which pulls back the curtain on the grading system. You then implement sampling, elicitation, roots and completion, and finish by assembling a mini agent that runs a tool use loop, so you feel in your hands that MCP is a component inside an agent.

Chapter 5 is going remote and authentication. You move from stdio to Streamable HTTP, design it stateless (and prove with a test that it still works when requests are round-robined across two independent servers), validate Origin, implement Protected Resource Metadata (RFC 9728), and hand-write JWT verification with no external library so that tools are exposed by audience and scope. Chapter 6 is quality and extension. Exercise 44 is the one with the structure reversed: the server is finished, and you write the tests. Prompt injection defence, tracing with OpenTelemetry, the Tasks extension, the groundwork for MCP Apps, and publishing to npm.

The last exercise, 50, is a capstone. You turn a problem from your own work into an MCP server, write ten realistic questions an LLM ought to be able to answer against it, and verify with a real client. Your tests turning green and an LLM genuinely using your server well are two different problems, and experiencing that gap is how the course closes.

No local Node installation is required. Upload the exercise ZIP to Google Cloud Shell and run the included setup script to prepare the dependencies. Node 24 or newer supports all 50 grading exercises. A Google account is required, with a free quota of 50 hours per week and 5GB of storage. Cloud Shell is unavailable to accounts under age 18 or with an unknown age. A local Node 24+ alternative is included. When videos show CodeSandbox, use the updated startup lecture instead. Grading requires no API keys or paid Google Cloud resources; external API tests use stubs.

Who this course is for:

  • Developers who have used MCP tools and now want to build their own MCP servers.
  • Engineers who want to expose business data and internal systems as tools and resources callable by AI assistants.
  • Learners who prefer hands-on exercises and automated grading to watching videos without writing code.
  • Agent developers who want to standardize their tool layer with MCP.
  • Developers who want to move beyond local prototypes to HTTP servers, authentication, testing, and observability.
  • TypeScript developers seeking a practical introduction to implementing AI tool integrations.