CourseModel Context Protocol: The Complete Course · Module 6: Building Clients and Hosts · part 42 of 77
Part 42 · Module 6: Building Clients and Hosts

Lesson 1: Connecting a model to MCP servers

24 min read·13 Oct 2026
Module 6 · Lesson 1 · About 45 minutes · Needs: Module 1 Lesson 2 (chat(), ChatReply) and Module 3 Lesson 1 (the notes server, as_model_sees_it); Module 2 Lesson 3 helps (stdio and Streamable HTTP)

The situation

Thursday 24 September 2026, week 3. Nare's notes server works, but only clients you drive by hand have called it. Nare wants to type "How many participants will the nap study have?" and get an answer. That needs a host: the program that holds the model, opens a client to each server, offers the model the tools and runs the ones it picks. Today you build one and trace that question through it, to the call notes__search_notes(query="nap study participants") and back.

TODAY: A HOST BETWEEN NARE AND HER NOTES Nare how many participants? Host Model chooses Client per server Notes server search_notes create_note notes__search_notes(query="nap study participants")
The host holds the model (amber) and one client per server (blue); this lesson traces Nare's question through it to search_notes and back.

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.