Skip to main content
Integrate external tools into your agents via Model Context Protocol (MCP) servers or web search.

agno/tools/mcp

Connects to a Model Context Protocol (MCP) server, giving agents access to external tools.

Config

Outputs

Example — Remote MCP server

Example — Local stdio server

Dependencies

Depends on: Nothing directly, but env and headers fields on MCP tools support FieldReferences. Depended on by:
  • agno/agent — in the tools list
  • agno/team — in the tools list

Notes

  • For MCP tools, you must provide exactly one of command or url.
  • The transport type is auto-detected if not specified: command implies stdio, url implies sse.
  • The include_run_context_headers option forwards the agent’s user ID, session ID, and run ID as HTTP headers to the MCP server.
  • Web search requires the ddgs package, which is automatically included as a pip dependency.