Learn how to use MCP with Agno to enable your agents to interact with external systems through a standardized interface.
Find the MCP server you want to use
Initialize the MCP integration
MCPTools
class as a context manager. The recommended way to define the MCP server, is to use the command
or url
parameters. With command
, you can pass the command used to run the MCP server you want. With url
, you can pass the URL of the running MCP server you want to use.For example, to use the “mcp-server-git” server, you can do the following:Provide the MCPTools to the Agent
MCPTools
class in the tools
parameter.The agent will now be ready to use the MCP server:MCPTools
or MultiMCPTools
as an async context manager to ensure proper cleanup of resources: