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

Topic 6: Module 2 milestone and interview questions

9 min read·22 Sept 2026

Project Milestone

After this module your working copy of notes-assistant contains the Module 1 files plus these new examples:

text
notes-assistant/
  examples/
    m02_server.py            the Module 2 prototype server (stdio and Streamable HTTP)
    m02_wire.py              raw stdio JSON-RPC driver, no SDK
    m02_wiretap.py           records every stdio line between a client and a server
    m02_raw_stdio.py         discover, call, progress, cancellation on the raw wire
    m02_errors.py            the error catalogue over stdio
    m02_curl_errors.sh       HTTP-only errors (-32700, -32600, -32020, 405)
    m02_curl_legacy.sh       the initialize handshake and Mcp-Session-Id by hand
    m02_legacy_vs_modern.py  the SDK Client in auto and legacy mode, through the wiretap
    m02_handles.py           a reading-list handle used across connections
    m02_paged_server.py      a low-level server with cursor pagination
    m02_pagination.py        the cursor loop, and -32602 versus -32603 for bad cursors
    m02_utilities.py         progress, cancellation, ping, completions, resource links
    m02_noisy_server.py      a server with stray print() calls (the failure case)
    m02_noisy_demo.py        what a polluted stdout looks like to two clients
    m02_env_demo.py          credentials reach stdio servers only through env
    m02_curl.sh              Streamable HTTP by hand: JSON and SSE responses
    m02_start_http.sh        starts the HTTP server on port 8020 (logs in http.log)
    m02_json_mode.sh         the same progress call against json_response=True
    m02_http_cancel.sh       cancellation by closing the HTTP stream
    m02_stdout_check.sh      the empty-stdin check for a polluted stdout
    m02_security.sh          Origin and Host checks against DNS rebinding
    m02_bind_demo.sh         the 0.0.0.0 pitfall and the allowlist fix
    m02_old_sse_server.py    the deprecated HTTP+SSE transport, for comparison
    m02_old_sse_demo.sh      its two-connection flow by hand
    m02_latency.py           in-memory versus stdio versus HTTP timings
    m02_bytes.sh             bytes on the wire, modern versus legacy
    m02_lab.py               the Module Lab

Code explained

  • In simple words: the file map of the project after Module 2.
  • What happens: every file above is a script you ran in this module. None of them change notes_assistant/; the prototype server imports NoteStore from it, as Module 1's did. The scripts write only wire.log, stdout.txt, http.log, and server.pid in the project root, which you can delete.
  • Comes out: the design has moved one step closer to the canonical server of Module 5: search_notes, notes://{note_id}, notes://index, and summarise_topic exist with their final names, logs go to stderr, and the HTTP entry point binds to 127.0.0.1 by default. Still missing are create_note, input validation with Field constraints, annotations, configuration through Settings, and tests; Modules 3 to 5 add them. The reading-list tools and reindex_notes are teaching props for this module and do not carry forward.

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.