CourseModel Context Protocol · Module 2: The Protocol and Its Transports · part 9 of 83
Part 9 · Module 2: The Protocol and Its Transports

Topic 1: Module 2 at a glance, and the setup

11 min read·22 Sept 2026

By the end of this module, you'll have:

  • Driven the notes server by hand over raw stdio and over HTTP with curl, and read every request, response, notification, and error as it crossed the wire.
  • Called server/discover, sent the per-request _meta envelope the 2026-07-28 revision requires, and provoked real -32700, -32600, -32601, -32602, -32603, -32020, -32021, and -32022 errors.
  • Watched the legacy initialize handshake and Mcp-Session-Id sessions in action, and compared them with the stateless design on the same server.
  • Carried state across connections with a tool-returned handle (a start_reading_list tool), and used pagination, progress, cancellation, completions, and resource links.
  • Diagnosed a polluted stdout, blocked a DNS rebinding request, and measured latency and bytes on the wire for in-memory, stdio, and HTTP.

Prerequisites: Module 1 (roles, JSON-RPC, primitives, and the tiny search_notes server in examples/m01_first_server.py). Comfortable with curl, HTTP status codes, and async/await.

Where we are: Module 1 connected a client to a one-tool server and let the SDK hide every message. This module takes the cover off. We look at the exact bytes a host and a server exchange, learn the rules that make those bytes a protocol, and see how they travel over the two standard transports.

The rest of this course is yours to keep

This course is bought on its own, once, and stays readable afterwards, including the parts added to it later.