Skip to main content
Pass a list to mcp_urls and the agent loads the tools from every server and can use them together in a single run. The model sees the union of both toolsets and decides which to call; each call is routed back to the server that owns it.

Build it

1

Install and set your key

2

Pass a list instead of a string

mcp_urls is the only change from the single-server examples. Routing, transport selection, and name collisions are handled for you.
3

Give it more than one loop

Two servers means at least two rounds of tool calls before the model can answer. max_loops=1 will cut it off after the first — the run returns, but half the question is unanswered.
4

Ask something that needs both

Naming the sources in the task keeps the model from trying to answer the Azure half out of the repo server.

The complete script

Mixing authenticated and open servers

mcp_api_key applies to every server that does not define its own credential. When servers need different keys, give each one a connection object:
Strings and MCPConnection objects can be mixed in the same list. See authentication patterns for the full set of credential shapes.

Local servers

The same list works for servers you run yourself — useful when a private tool server sits alongside a public one:
Start the servers first — see build your own server.

When to stop adding servers

Tools are not free. Every schema occupies context on every call, and a model choosing among forty tools picks wrong more often than one choosing among four.