MCP Tutorial
Welcome to the MCP (Model Context Protocol) tutorial. This course is based on the official MCP documentation and the 2026-07-28 specification. It treats MCP as a standalone protocol course: how Host, Client, and Server collaborate; how Tools, Resources, and Prompts expose context; and how to build a reusable server with the official Python SDK.
The official metaphor: MCP is USB-C for AI applications. One standard plugs local files, HTTP APIs, GitHub, browsers, and other systems into hosts such as Claude Code, Cursor, VS Code, and ChatGPT—without a one-off plugin for every product.
This course teaches the protocol. MCP chapters inside Cursor, Claude Code, Codex, and OpenCode are client-specific wiring. We link them instead of duplicating product menus and troubleshooting.
Table of Contents
Basics
- Introduction — Why MCP, the USB-C metaphor, who should learn
- Architecture — Host / Client / Server, local vs remote, data and transport layers
- Primitives — Tools, Resources, Prompts, and conceptual JSON-RPC examples
- Transports — Stdio, Streamable HTTP, and leftover SSE
Development
- Installation — Node / Python,
pip install mcp, Inspector - Quick Start — A tiny add tool and Inspector
- Python Server — Official SDK: tool + resource + prompt
- Connect Clients — Cursor, Claude Code, Codex, OpenCode snippets
Operations
- Official Servers — filesystem, GitHub, Fetch / Playwright, marketplace
- Security — Approval, sandbox, allowlists, supply chain
- Practical Examples — Local notes, wrap a public API, one server in two hosts
- Resources — Spec, SDKs, this site's agent courses
Learning Path
Use Inspector before an IDE or CLI host. Inspector lists tools, resources, and prompts directly, which is faster than guessing whether a chat model “saw” your tool.
Prerequisites
- Python 3.10+ basics (decorators, type hints, virtual environments)
- Comfort with JSON and request/response thinking; JSON-RPC itself is optional
- At least one MCP-capable host (Cursor, Claude Code, Codex, …). Inspector is enough if you have no host yet
- Node.js for Inspector and most
npxreference servers (Inspector currently documents a newer Node floor—see Installation) - On Windows use PowerShell; Unix / macOS commands are listed alongside
You do not need an LLM application framework. MCP does not dictate how an app uses the model; it only standardizes how context is exchanged.
Related courses on this site
The current specification is 2026-07-28: a stateless protocol core, with capability discovery via server/discover. Sampling is deprecated; this course mentions it once and does not teach it as current practice.
How to read this: picture Host / Client / Server and the three primitives first, run a tiny server in Inspector, then paste the same process into a product config. If a chat “cannot see the tool,” go back to Inspector before blaming the model.