1:1 mentoring with Big Tech AI engineers
RAG & MCP

MCP Discovery

How a host learns what servers offer and builds the one flat tool list a model reads: server/discover and tools/list, who reads each field, many servers and name collisions, ttlMs and list_changed, what annotations mean, and what to do when the menu is too big.

Last updated

After this section you can

  • Trace server/discover and tools/list on the wire, and name the reader of each field
  • Merge several servers into one list without a name collision
  • Set ttlMs, cacheScope and annotations on purpose, and say what each one does not promise
06

MCP Discovery

How a host learns what each server offers, merges the answers into one menu for the model, and keeps that menu fresh.

Key idea

A host asks each server what it offers, merges the answers into one flat list, and sends it to the model with every request. The model reads each tool's name, description and input schema. ttlMs and list_changed decide when the host asks again.

One menu, built by the host
SERVERS, ONE LIST EACH THE HOST THE MODEL CRM server tools/list Jira server tools/list Docs server tools/list The host merges the lists prefixes each name keeps each list for ttlMs The model reads one flat tools list picks one tool, or none name, description, input_schema list list list tools[] ttlMs ends or list_changed: list again

Teal: servers. Purple: the host and its cache. Amber: the model. Blue: requests. Green: results. The figure pans sideways on a phone.

Related

More in RAG & MCP

Get full access to all 149 sections with code examples, diagrams, and interactive animations.

Unlock Premium