cookbook/91_tools/mcp/README.md
Model Context Protocol (MCP) gives Agents the ability to interact with external systems through a standardized interface. Using Agno's MCP integration, you can build Agents that can connect to any MCP-compatible service.
filesystem.py)This example demonstrates how to create an agent that can explore, analyze, and provide insights about files and directories on your computer.
github.py)This example shows how to create an agent that can explore GitHub repositories, analyze issues, pull requests, and more.
groq_mcp.py)This example uses the file system MCP agent with Groq running the Llama 3.3-70b-versatile model.
include_exclude_tools.py)This example shows how to include and exclude tools from the MCP agent. This is useful for reducing the number of tools available to the agent, or for focusing on a specific set of tools.
multiple_servers.py)This example shows how to use multiple MCP servers in the same agent.
sequential_thinking.py)This example shows how to use the MCP agent to perform sequential thinking.
airbnb.py)This example shows how to create an agent that uses MCP and Gemini 2.5 Pro to search for Airbnb listings.
Install the required dependencies:
uv pip install agno mcp openai
Export your API keys:
export OPENAI_API_KEY="your_openai_api_key"
For the GitHub example, create a Github PAT following these steps.
python filesystem.py
python github.py
These examples use Agno to create agents that leverage MCP servers. The MCP servers provide standardized access to different data sources (filesystem, GitHub), and the agents use these servers to answer questions and perform tasks.
The workflow is:
You can modify these examples to: