Skip to main content
Agno’s MCP integration supports connecting an Agent to multiple MCP servers at once: create one MCPTools instance per server and pass them all to the Agent.
MultiMCPTools was removed in Agno v3.0. Importing it raises an ImportError; use one MCPTools instance per server, as below. Note that env= is per-instance — pass it to the server that needs it.

Prerequisites

1

Set up your virtual environment

Install the Python dependencies and Node.js, then verify the runtimes:
Export the keys used by the examples you run:
The @modelcontextprotocol/server-google-maps npm package is deprecated and no longer supported. The snippets below document this legacy server. Use maintained MCP servers for new projects.

Using multiple MCPTools instances

multiple_mcp_servers.py

Handling Connection Failures

connect() does not raise when a server is unreachable: it logs the error and leaves the instance uninitialized, so the Agent can still run with the servers that did connect. To fail fast when a server is required, check initialized after connecting:
Using async with MCPTools(...) as a context manager instead raises on connection failure.

Avoiding tool name collisions

When using multiple MCP servers, you may encounter tool name collisions. This often happens when the same tool is available in multiple of the servers you are using. To avoid this, you can use the tool_name_prefix parameter. This will add the given prefix to all tool names coming from the MCPTools instance.