Lesson 07.10 · Phase 07 · Model Context Protocol

Testing MCP servers

Unit tests check that your tools compute the right answer. They don't check that the server speaks the protocol, survives what models actually send, or still matches what clients expect after a release. A black-box harness, a seeded fuzzer and a snapshot diff cover those three.

Learning objectives

  • Build a black-box conformance harness that tests any stdio MCP server command against protocol rules.
  • Generate seeded, schema-guided fuzz arguments that mimic a confused model, and check the server never crashes, hangs or returns malformed results.
  • Diff tool-list snapshots between releases and flag breaking changes.
  • Recognise the most common server bugs from the harness output.

Phase 2 · Lesson 11 tested tools as functions. A server can pass all of those tests and still fail in a host:

Loading the full lesson…