Loading

from first concept to confident practice

Model Context Protocol (MCP)

Build an MCP server: design tools and schemas, connect stdio or HTTP, and secure AI integrations with hands-on code and quizzes.

Start learning 16 lessons · first lesson about 15 min · free · no account needed
About this track

The Model Context Protocol (MCP) is the open standard AI applications use to plug into tools and data - one protocol instead of a custom integration for every pair of app and service.

Build an MCP server step by step: understand the host-client-server architecture and JSON-RPC messages, choose stdio or Streamable HTTP, design tools, resources and prompts with clear schemas, handle multi-round-trip requests, and secure the connection with OAuth and prompt-injection defenses. Interactive message-flow diagrams, a schema playground, tool-safety challenges, quizzes, and coding exercises make each concept hands-on. Build and inspect a server locally with the official TypeScript SDK, then use Python browser exercises and a hand-built capstone to understand protocol mechanics and practice a private support-ticket lookup. Content follows the MCP 2026-07-28 specification; SDK APIs evolve, so check the official versioned guides before deploying.

Before you start
  • No prior MCP experience needed.
  • Basic Python and JSON help; examples introduce the code as you go.
  • A modern browser with JavaScript enabled.
  • Node.js 20 or later and npm are needed for the optional local TypeScript SDK lab.
Loading progress…
  1. Unit 1 · 0/5 lessons

    MCP foundations

    Learn the architecture, capability types, JSON-RPC messages, request lifecycle and transports. Badge: Protocol navigator

    1. 0x001Understand the Model Context ProtocolSee the problem MCP solves and the roles of hosts, clients and servers. 15 min 0/1 exercises solved 15 min 0/1 exercises solved
    2. 0x102Compare tools, resources, and promptsLearn the three server primitives and who decides when each one is used. 16 min 0/1 exercises solved 16 min 0/1 exercises solved
    3. 0x203Read MCP messages: JSON-RPC 2.0Learn the four message shapes every MCP exchange is built from, and the standard error codes. 18 min 0/2 exercises solved 18 min 0/2 exercises solved
    4. 0x304Follow the stateless request lifecycleSee how every request carries its own version and capabilities, and how clients discover servers. 20 min 0/2 exercises solved 20 min 0/2 exercises solved
    5. 0x405Move messages: stdio and Streamable HTTPSee how messages travel to local and remote servers, and why HTTP headers must match the body. 20 min 0/2 exercises solved 20 min 0/2 exercises solved
  2. Unit 2 · 0/4 lessons

    Build servers

    Design tools with schemas, return results and errors, and expose resources and prompts. Badge: Capability builder

    1. 0x506Design a useful MCP toolWrite tool names, descriptions and JSON Schemas that models use correctly - and validate every call. 22 min 0/2 exercises solved 22 min 0/2 exercises solved
    2. 0x607Return results, errors and behavior hintsChoose between protocol errors and tool errors, and describe tool behavior with annotations. 20 min 0/1 exercises solved 20 min 0/1 exercises solved
    3. 0x708Serve resources and promptsExpose readable context through URIs and templates, and reusable prompts with arguments - safely. 20 min 0/2 exercises solved 20 min 0/2 exercises solved
    4. 0x809Ship an MCP server with the TypeScript SDKTurn a useful tool into a real MCP server with the official SDK, stdio, and a safe path to remote hosting. 35 min 35 min
  3. Unit 3 · 0/3 lessons

    Clients and advanced requests

    Combine servers in a host, ask users for input mid-request, and manage state and subscriptions. Badge: Workflow weaver

    1. 0x9010Build client workflows with MCPDiscover capabilities, page through and cache lists, avoid name collisions, and keep the user in control. 20 min 0/2 exercises solved 20 min 0/2 exercises solved
    2. 0xA011Ask the user mid-call: multi round-trip requestsLet a server request input or a model completion during a call, without keeping server-side state. 22 min 0/2 exercises solved 22 min 0/2 exercises solved
    3. 0xB012Keep state with handles, and listen for changesCarry state across calls with explicit handles, and get notified when lists or resources change. 20 min 0/1 exercises solved 20 min 0/1 exercises solved
  4. Unit 4 · 0/3 lessons

    MCP security and operations

    Authorize with OAuth, block common attacks, and defend against prompt injection. Badge: Secure connector

    1. 0xC013Authorize remote servers with OAuthFollow how a client discovers the authorization server, gets a token for one server, and steps up scopes. 25 min 0/2 exercises solved 25 min 0/2 exercises solved
    2. 0xD014Secure and operate MCP integrationsRecognize the main attacks on MCP deployments and apply the spec’s mitigations. 22 min 0/1 exercises solved 22 min 0/1 exercises solved
    3. 0xE015Defend against prompt injection and tool poisoningSee how instructions hidden in tool results and definitions hijack agents, and how hosts defend. 20 min 0/1 exercises solved 20 min 0/1 exercises solved
  5. Unit 5 · 0/1 lessons

    Capstone

    Build a working stdio server and a private support-ticket tool. Badge: MCP engineer

    1. 0xF016Capstone: build a stdio MCP serverWrite a working MCP server from scratch that discovers, lists and calls a tool over stdio. 50 min 0/2 exercises solved 50 min 0/2 exercises solved