> ## Documentation Index
> Fetch the complete documentation index at: https://phidatainc.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# MCP Demo

> Expose AgentOS agents and custom tools through MCP with OAuth, dynamic headers, and managed MCPTools lifespans.

| Example                                                                                | Description                                                                                                                                   |
| -------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
| [Example AgentOS app with MCP enabled](/examples/agent-os/mcp-demo/mcp-server-example) | After starting this AgentOS app, you can test the MCP server with the test\_client.py file.                                                   |
| [MCP Tools Advanced Example](/examples/agent-os/mcp-demo/mcp-tools-advanced-example)   | Run an AgentOS support agent wired to both a remote Agno docs MCP server and a stdio Brave Search MCP server.                                 |
| [MCP Tools Example](/examples/agent-os/mcp-demo/mcp-tools-example)                     | AgentOS handles the lifespan of the MCPTools internally.                                                                                      |
| [MCP Tools Existing Lifespan](/examples/agent-os/mcp-demo/mcp-tools-existing-lifespan) | Pass a custom FastAPI lifespan to AgentOS alongside agent MCPTools, whose lifespan AgentOS still manages.                                     |
| [Test Client](/examples/agent-os/mcp-demo/test-client)                                 | MCP client example: an agent that operates an AgentOS through its MCP server.                                                                 |
| [Dynamic Headers](/examples/agent-os/mcp-demo/dynamic-headers/overview)                | Pass request-specific headers from AgentOS through MCPTools to an MCP server.                                                                 |
| [Custom MCP Tool Example](/examples/agent-os/mcp-demo/custom-mcp-tool-example)         | AgentOS app that exposes ONE custom MCP tool routed through an agent, with the built-in MCP tools disabled and the server gated to its owner. |
| [OAuth with WorkOS AuthKit](/examples/agent-os/mcp-demo/oauth-authkit-example)         | Bring a FastMCP AuthProvider backed by WorkOS AuthKit to the AgentOS MCP endpoint.                                                            |
| [Built-in OAuth](/examples/agent-os/mcp-demo/oauth-builtin-example)                    | Use the AgentOS built-in authorization server to protect the MCP endpoint.                                                                    |
