MCP in 7 Days: Wire Tools Into Any Agent
Taught in ChineseWeek 1 · From Reading the Spec to Shipping a Trustworthy MCP Server
Why a Protocol: the Host/Client/Server Triangle, JSON-RPC Messages, and Three Primitives
Start with the specific duplicated work MCP actually removes, then map the host, client, and server roles onto the tool, resource, and prompt primitives, and finish by reading a real JSON-RPC message field by field.
Writing Your First MCP Server: stdio Transport, the Official SDK, Parameter Schemas, Tool Annotations, and Debugging With Inspector
Use the official SDK to write your first server a real client can load, fill in the parameter schema, output schema, tool annotations, and error classification in one pass, and learn to debug it with Inspector.
Resources and Prompts: URI Templates, Change Notifications, Progress and Logging, Pagination, and Client Capabilities
Turn read-only data into resources and repeated question patterns into prompts, then round out URI templates, pagination, progress, subscriptions, and caching — the things that keep a server usable at real data volumes.
Remote MCP: the Streamable HTTP Binding, the Stateless Model and Request Metadata, OAuth 2.1 Authorization, Container Deployment
Move a server from a local subprocess onto the public internet: one POST endpoint, two response shapes, one set of required headers, plus OAuth 2.1 audience validation and a container deployment that can scale out.
Writing an MCP Client: Discovering and Calling Tools Inside Your Own Agent Loop, Multi-Server Aggregation and Name Collisions
Switch to the client side: hand-write a client that discovers tools, translates them into a shape the model can understand, and feeds results back into the loop, then handle name collisions and failures when aggregating multiple servers.
Security and Governance: Prompt Injection in Tool Descriptions, the Confused Deputy, Least Privilege, Audit Logs, and a Tool Allowlist
Treat MCP as an entry point for untrusted input: what can go wrong in tool descriptions, tool results, state handles, tokens, and local servers, plus a checklist you can tick off item by item.
Productionizing and Retrospective: Writing Evals for Tools, Versioning, Publishing to npm and a Registry, Observability, and a Capstone Project
Turn a server that runs into a server you can maintain long-term: write an eval set for your tools, manage description changes as breaking changes, add tracing and metrics, and turn the week into one portfolio entry.