Ch 15: MCP Servers and Tool Interop
Imagine you move to a new country and every appliance in your house has a different plug. Your laptop needs a Type-C outlet, the fridge needs a Type-G, the TV needs a Type-A. You end up buying a dozen different adapters, each one custom-made. Every time you get a new appliance, you have to figure out its plug, buy another adapter, and wire it up yourself.
Then someone invents a universal socket. One plug shape that every appliance speaks. You plug in the fridge — it works. You plug in a power tool you have never seen before — it works. You do not need to know how the appliance works inside. You just need to know the shape of the plug.
That is what MCP — the idea of a universal adapter — does for your helper's tools. Any provider that fits the universal socket can plug in and work with any helper. A project-tracking service, a data service, a file service — they all connect through one standard plug. Your helper plugs in, asks "what can you do?", and starts running errands it has never seen before.
One plug shape. Infinite providers.
Why Custom Adapters Don't Scale
In the old world, every appliance in your house needed its own custom adapter. Need to use the toaster? Buy a special adapter and wire it up yourself. Need to run the washing machine? Learn its unique plug shape, buy another adapter, wire it from scratch. Need to charge your phone? Yet another adapter, yet another plug shape, yet another afternoon of wiring.
Each adapter takes time and effort to build. Each one works differently — different shapes, different rules, different quirks. And when an appliance maker changes their plug design, your custom adapter breaks. You are not enjoying your appliances — you are maintaining a drawer full of adapters.
The real headache: if you have three houses and five appliances, you need fifteen custom adapters. A universal socket collapses that to three sockets plus five standard plugs. Every house has the same socket. Every appliance has the same plug. They all just work together.
Your helper needs to work with a project-tracking service — find out what projects exist, flag issues, and check on progress. Instead of building a custom adapter for this one service, you plug it into the universal socket. Let's see how it works.
Put the universal adapter steps in the correct order
Drag to reorder, or use Tab + Enter + Arrow keys.
- Plug into the provider through the universal socket
- Discover what errands the provider can handle
- Ask the provider to run a specific errand
- Receive the result from the provider
- Use the result to answer the question
Key Insight
The universal adapter separates finding out what a provider offers from asking the provider to do something. Your helper does not need to know ahead of time what errands are available. It discovers them the moment it plugs in.
This is a big shift. Before the universal socket, your helper could only do what you had manually wired up for it. After the universal socket, your helper's abilities are flexible — plug in a new provider, and the helper instantly gains new capabilities. Unplug a provider, and those errands cleanly disappear.
Think about what this enables: a single helper that adapts to its surroundings. In one house, it plugs into a kitchen provider and gains cooking-related errands. In another house, it plugs into a workshop provider and gains building-related errands. Same helper, different capabilities, zero custom adapters.
The universal socket handles the connection. Your helper just asks: "What can you do?" And the providers answer.
What's Next
Your agent can now discover and use tools from any MCP server — its capabilities are no longer limited to what you hard-coded. But when the agent calls a tool (MCP or built-in), it gets back unstructured text. The agent decides how to interpret the result, which means the output format is unpredictable.
In Chapter 16, you will learn how to force the model to produce structured output — data that matches a specific form template you define. This is the foundation for building reliable data pipelines where every response conforms to a contract.