RAG & Agents Engineering

M38 lab, MCP foundations

Every server in the config talks on every call.

The lesson 38.4 chatbot reads server_config.json, connects to each server, and sends every tool it finds to the model on every request. Switch servers on and off. The tool lists are the real list_tools replies, recorded with MCP SDK 1.30.0.

Servers in server_config.json, in file order
Tool definitions per call
Characters of tool JSON
About this many tokens
Names sent twice

What each server sends and receives

One row per server

ServerTools sentCharactersCalls it getsTool names
Every request

Characters count each definition the chatbot builds (name, description, input_schema) as compact JSON. Tokens use the four-characters-per-token rule of thumb. “Calls it gets” counts the tool names that tool_to_session routes to that server.

One call through the router

Results recorded from @modelcontextprotocol/server-filesystem 2.1.0. research_server.py sits in the project folder, which the page calls mcp_project; handbook/ is a folder inside it.