Build an MCP Client That Uses Many Servers in Python
I gave two MCP servers a tool called search each. Merge their tools by name, and one of them vanishes.
Video #28 ยท AI agents and MCP
Steps in the video
Files
- compare.py (44 lines)
- flights_server.py (28 lines)
- hub.py (36 lines)
- shop_server.py (28 lines)
Tested with
Python 3.12.15 | mcp==2.3.0, ollama==0.6.3
What this does not show
Two made up servers and six easy questions with tool names that explain themselves. Only the first tool the model chose was checked, not its arguments. The hub has no approval step, no timeouts and no call log.
Sources
Learning IT by Example.