Skip to main content
Set mcp=True to serve an MCP endpoint at /mcp alongside the AgentOS REST API.
mcp_server.py
Install the AgentOS, MCP, and model dependencies:
Set OPENAI_API_KEY, then run python mcp_server.py. The MCP endpoint is available at http://localhost:7777/mcp. The default MCP surface provides eight tools for discovering registered components, running agents, teams, and workflows, continuing or cancelling paused runs, and reading session history.

Publish Selected Components

Use MCPConfig to publish selected components or custom callables as MCP tools:
Published components use the same AgentOS execution, persistence, and authorization paths as the built-in run tools. Lifecycle tools remain available by default so MCP clients can continue or cancel paused runs.

Connect MCP Clients

Choose the connection method based on where the client runs.

ChatGPT and Claude

Deploy AgentOS to a public HTTPS URL. In ChatGPT or Claude, open Settings → Connectors → Add custom connector and enter:
The endpoint must be publicly reachable over HTTPS. For ChatGPT and Claude, a secured MCP endpoint must use OAuth. Their connector UIs do not accept bearer tokens. When using AgentOSBuiltinAuth, set AGENTOS_URL to the exact public origin, leave the optional OAuth client ID and client secret fields empty, then enter MCP_CONNECT_SECRET on the consent page. See the built-in OAuth example.

Local MCP Clients

Run Agno Connect on the machine where Claude Code, Claude Desktop, Codex, or Cursor is installed:
Agno Connect discovers the MCP endpoint, updates each detected client’s configuration, and verifies the connection with an MCP handshake. Pass the AgentOS base URL without /mcp. The command also works with a local AgentOS, such as http://localhost:7777.

Choose the MCP Direction

Developer Resources