Skip to main content
The Model Context Protocol (MCP) enables Agents to interact with external systems through a standardized interface. You can give your Agents access to MCP tools using the MCPTools class. Read more about using MCP tools here. Your MCPTools work normally within AgentOS. AgentOS connects and disconnects them automatically.
If you are using MCPTools within AgentOS, you should not use reload=True when serving your AgentOS. This can break the MCP connection during the FastAPI lifecycle.

Example

mcp_tools_example.py
Refreshing the connection to MCP servers is not automatically handled. Set refresh_connection=True to re-establish the connection on each run.
See here for a full example.