Transports in the Model Context Protocol (MCP) define how messages are sent and received. The Agno integration supports the three existing types:
stdio,
SSE and
Streamable HTTP.The stdio (standard input/output) transport is the default one in Agno’s integration. It works best for local integrations.To use it, simply initialize the MCPTools class with its command argument.
The command you want to pass is the one used to run the MCP server the agent will have access to.For example uvx mcp-server-git, which runs a git MCP server:
Copy
Ask AI
from agno.agent import Agentfrom agno.models.openai import OpenAIChatfrom agno.tools.mcp import MCPToolsasync with MCPTools(command=f"uvx mcp-server-git") as mcp_tools: agent = Agent(model=OpenAIChat(id="gpt-5-mini"), tools=[mcp_tools]) await agent.aprint_response("What is the license for this project?", stream=True)
You can also use multiple MCP servers at once, with the MultiMCPTools class. For example:
Copy
Ask AI
import asyncioimport osfrom agno.agent import Agentfrom agno.tools.mcp import MultiMCPToolsasync def run_agent(message: str) -> None: """Run the Airbnb and Google Maps agent with the given message.""" env = { **os.environ, "GOOGLE_MAPS_API_KEY": os.getenv("GOOGLE_MAPS_API_KEY"), } async with MultiMCPTools( [ "npx -y @openbnb/mcp-server-airbnb --ignore-robots-txt", "npx -y @modelcontextprotocol/server-google-maps", ], env=env, ) as mcp_tools: agent = Agent( tools=[mcp_tools], markdown=True, ) await agent.aprint_response(message, stream=True)# Example usageif __name__ == "__main__": # Pull request example asyncio.run( run_agent( "What listings are available in Cape Town for 2 people for 3 nights from 1 to 4 August 2025?" ) )