CourseModel Context Protocol: The Complete Course · Module 5: Building Servers · part 38 of 77
Part 38 · Module 5: Building Servers

Lesson 4: Testing a server the way a host uses it

23 min read·13 Oct 2026
Module 5 · Lesson 4 · About 40 minutes · Needs: Lesson 1 of this module (the packaged server); Module 3 Lesson 3 (results and errors); basic pytest helps

The situation

Monday 21 September 2026, week 3. The notes server became a package this morning, and Tomas is about to ask for a reindex button. Before anyone changes the server again, Nare wants proof that today's behaviour survives: "nap study participants" still finds the lab sync note first, and saving the consent form twice still refuses the second time with a message the model can read.

You write that proof as tests. The server under test is Lesson 1's build_server in notes_assistant/server.py, and the running example is the search search_notes(query="nap study participants"), which should return lab-sync-2026-09-02 with a score of 3.

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.