Building MCP Servers for Claude Code: From Zero to Production
Go from zero to production MCP server developer for Claude Code. Build a learning server across tools, resources, prompts, sampling, roots, and elicitation, then ship a production one with Streamable HTTP, OAuth, observability, packaging, and registry publishing in TypeScript.
View badge details
About This Course
A comprehensive, hands-on TypeScript course that takes you from zero MCP knowledge to shipping production-grade Model Context Protocol servers for Claude Code. You'll build a learning server (Track 1) covering tools, resources, prompts, sampling, roots, and elicitation, then a production server (Track 2) covering Streamable HTTP, OAuth 2.1 + PKCE, real-world API/database integration, observability, packaging (MCPB), and registry publishing. Every lab uses the DotNetClaude container with Node.js 22 and the Claude Code CLI pre-installed so you build, register, and use your own MCP servers inside Claude Code from day one. Capstone: design, document, and prepare your own MCP server for publication, choosing from a DevOps, Knowledge, or Data track.
Course Curriculum
20 Lessons
MCP Foundations & The Claude Code Integration Model
Teaching lesson: Learn what MCP is, why it exists, the host/client/server architecture, the three primitives (tools, resources, prompts), how Skills compare to MCP, transports at a glance, and the 2026 state of the protocol.
MCP Foundations - Lab Exercises
Hands-on exercises: connect the official filesystem MCP server in Claude Code, inspect protocol traffic with MCP Inspector, and explore @-resource and /-prompt discovery.
Building Your First MCP Server
Teaching lesson: Anatomy of a TypeScript MCP server project, the McpServer class, registerTool, StdioServerTransport, the critical stdio-stdout rule, MCP Inspector, and adding your server to Claude Code.
Building Your First MCP Server - Lab Exercises
Hands-on exercises: build a hello-world MCP server with greet and add_numbers tools, test with MCP Inspector, and register it in Claude Code.
Tools In Depth: Schemas, Validation, and Structured Output
Teaching lesson: tool definition anatomy, Zod schema patterns, description-driven discovery, structured output with outputSchema, multi-modal content, tool annotations, and isError vs throwing.
Tools In Depth - Lab Exercises
Hands-on exercises: build a multi-tool utility server with fetch_url, format_json, and calculate tools using full Zod input AND output schemas.
Resources, URI Templates, and Prompt Templates
Teaching lesson: resources vs tools, static resources, URI-templated resources, list_changed notifications, prompt templates, and embedded resources in tool results.
Resources and Prompts - Lab Exercises
Hands-on exercises: expose project knowledge via static resources, URI-templated resources (wiki://), and a prompt template (incident-triage) registered as a Claude Code slash command.
Advanced Capabilities: Sampling, Roots, and Elicitation
Teaching lesson: sampling (servers asking the client to run completions), roots (filesystem boundaries), and elicitation (pausing for user input mid-task).
Sampling, Roots, and Elicitation - Lab Exercises
Hands-on exercises: build an interactive MCP server using sampling, roots enforcement, and elicitation for structured user input. Includes summarize_file and generate_commit_message tools.
Transports: stdio vs Streamable HTTP for Remote Servers
Teaching lesson: stdio recap, Streamable HTTP, Express + StreamableHTTPServerTransport, stateful vs stateless mode, CORS and origin validation, and adding HTTP servers to Claude Code.
Streamable HTTP - Lab Exercises
Hands-on exercises: convert your stdio server to Streamable HTTP with Express, session management, origin allowlists, and concurrent client testing.
Authentication, OAuth 2.1, and Production Security
Teaching lesson: MCP server threat model, OAuth 2.1 + PKCE, resource indicators (RFC 8707), JWT validation, separating authorization and resource servers, CIMD, short-lived tokens, secrets hygiene, and authenticated servers in Claude Code.
OAuth 2.1 with PKCE - Lab Exercises
Hands-on exercises: add OAuth 2.1 + PKCE bearer-token middleware to your Streamable HTTP server, implement .well-known/oauth-protected-resource, and verify forged/expired token rejection.
Real-World Integration Patterns
Teaching lesson: auth-aware tool implementation (per-user data scoping, token forwarding, scope enforcement), API-wrapper pattern, read-only database pattern, vendor-proxy pattern, dynamic tools, pagination, cost-aware design, and idempotency.
API-Wrapper Server - Lab Exercises
Hands-on exercises: build an authenticated API-wrapper MCP server with JWT-scoped REST and SQLite tools, per-user cache keys, scope-required write tools, and cross-tenant isolation tests.
Error Handling, Observability, and Production Readiness
Teaching lesson: protocol errors vs tool errors, structured logging via notifications/message, stderr logging for stdio, OpenTelemetry integration, graceful shutdown, health checks, AbortSignal cancellation, and self-healing schema errors.
Observability and Error Recovery - Lab Exercises
Hands-on exercises: harden the API-wrapper server with pino structured logging, OpenTelemetry tracing, /healthz and /livez endpoints, graceful shutdown, and chaos-tested error recovery.
Packaging, Distribution, and the 2026 MCP Frontier
Teaching lesson: npm packaging for stdio servers, MCPB (the new DXT) bundles, building with @anthropic-ai/dxt, the official MCP Registry, Server Cards, the Tasks primitive, MCP Apps (SEP-1865), and a Python/FastMCP comparison.
Capstone Project - Build, Document, and Publish Your Own MCP Server
Capstone exercise: design and ship your own production-grade MCP server. Choose one of three tracks (DevOps, Knowledge, or Data) and deliver a fully tested, documented, and packaged server ready for the MCP Registry.