CourseModel Context Protocol · Module 6: Clients and Hosts · part 39 of 83
Part 39 · Module 6: Clients and Hosts

Topic 6: Module 6 milestone and interview questions

8 min read·22 Sept 2026

Project Milestone

The running project now has a host. Your notes-assistant folder should look like this (new in this module marked with a comment):

text
notes-assistant/
  requirements.txt
  notes/                        8 sample notes
  notes_assistant/
    __init__.py
    store.py                    NoteStore (Module 1)
    llm.py                      chat() for groq / gemini / ollama (Module 1)
    config.py                   Settings (Module 5)
    server.py                   build_server(store) and main() (Module 5)
    host.py                     Host, HostConfig, to_openai_tool, approval helpers   # new
  examples/
    m06_common.py               shared setup: server params, ScriptedModel          # new
    m06_connect.py              stdio, HTTP, and in-memory connections timed        # new
    m06_convert.py              MCP tools to Chat Completions specs                  # new
    m06_loop.py                 agent loop stop rules with a scripted model          # new
    m06_no_progress.py          ProgressGuardHost                                   # new
    m06_parallel.py             task groups, fail_after, run_round_parallel          # new
    m06_ask.py                  real-model command-line assistant                   # new
    m06_calendar_server.py      second server with a colliding tool name            # new
    m06_multi.py                shadowing versus namespacing                        # new
    m06_tool_search.py          find_tools meta-tool over 37 tools                  # new
    m06_policy.py               PolicyHost: allow, ask, deny, per-server timeouts   # new
    m06_consent.py              diff preview approval                               # new
    m06_failures.py             slow, failing, and disconnected servers             # new
    m06_fatigue.py              approval prompts counted under four policies        # new
    m06_lab.py                  the Module Lab                                      # new
  tests/
    test_host.py                seven host tests                                    # new

Code explained

  • In simple words: a map of the project after this module.
  • What happens: the only new file inside the package is notes_assistant/host.py; everything that experiments with policy lives in examples/ so the canonical host stays small. Module 8 will extend host.py with tool pinning; the rest of the course imports it as it is.
  • Comes out: you can now run python examples/m06_ask.py "..." with a real model, or the lab with none.

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.