CourseModel Context Protocol: The Complete Course · Module 4: Resources, Prompts, and User Interaction · part 32 of 77
Part 32 · Module 4: Resources, Prompts, and User Interaction

Lab: Resources, a prompt and questions for Nare

46 min read·13 Oct 2026
Module 4 · Lab · About 75 minutes · Needs: lessons 1 to 4 of this module, the Module 1 lab, and Module 3 Lesson 1; a free Groq or Gemini key for Step 6 (course-guide/02)

What you are building

EXAMPLES/ (MODULE 4 FILES) m03_server.py build_m03_server m04_server.py build_m04_server m04_interaction _server.py notes://index resource notes://{id} template summarise _topic prompt import_zotero key by URL create_note asks only if similar m04_lab.py prompt to model 9 tests scripted users one server, built up in two files; tests cover both
One server grows in two files: Module 3's tools, then resources, the prompt and a confirming create_note (blue), Zotero by URL, a script that calls the model (amber) and nine tests (green).

It is Thursday 17 September 2026, the end of week 2. Nare wants her notes in a sidebar that updates by itself, a /summarise_topic sleep command, a question before the assistant saves a note that looks like one she already has, and Priya wants her Zotero references without typing her key into a chat. The four lessons built each of these in a separate notebook server. This lab puts them on one server, built on Module 3's canonical build_m03_server, in two repository files: examples/m04_server.py (resources, the prompt, change events and a confirming create_note) and examples/m04_interaction_server.py (the same server plus import_zotero and its /connect/zotero page). A script sends Nare's slash command to a model, and tests/test_m04_interaction.py holds it all in place.

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.