# MCP (/demo-os/mcp)



This walkthrough follows [Demo OS at the reviewed revision](https://github.com/agno-agi/demo-os/tree/985b72e2064a77a0c4cfc204f945a844f3d4db31), which pins Agno **2.8.1**. Use the application’s checked-in requirements.

The registered **Agno Expert** agent (`agno-expert`) consumes the documentation MCP server through this tool configuration:

```python
from agno.tools.mcp import MCPTools

documentation_tools = MCPTools(url="https://docs.agno.com/mcp")
```

The application attaches MCPTools to its Agent with persistence, history, and documentation-focused instructions. It discovers the remote tool surface when connecting; the source does not guarantee particular tool names or a tool call on every question.

## What MCP gives you [#what-mcp-gives-you]

MCP provides tool discovery and calls across a process or HTTP boundary. The Agent’s model chooses among available tools. Connection lifecycle and refresh settings determine when the available tool list is refreshed; a new question does not imply arbitrary rediscovery.

For this pinned SDK, a local command is supplied as a complete command string, such as `MCPTools(command="uvx mcp-server-time")`, or through supported server parameters. Separate `args=` and top-level `headers=` are not accepted constructor options. Static HTTP headers belong in `StreamableHTTPClientParams` passed as `server_params`.

## When to use MCP vs writing a tool [#when-to-use-mcp-vs-writing-a-tool]

Use MCP when another process or service owns the capability and its tool contract. Use a Python tool when the application owns the function and can invoke it directly. The documentation server remains an external dependency of this demo.

## See it in action [#see-it-in-action]

[Start Demo OS](/demo-os/overview#run-it-locally), choose **Agno Expert**, and ask how to build an Agno agent. Inspect the discovered documentation tools and their results. A remote server’s current roster and availability must be verified at connection time.

## MCP as a context provider in Scout [#mcp-as-a-context-provider-in-scout]

The [standalone Scout application](/deploy/templates/scout/overview) has a separate MCP registry and context-provider configuration. Follow its own source and dependency pin when adapting that pattern.

## Next [#next]

[agents/mcp/agent.py](https://github.com/agno-agi/demo-os/blob/985b72e2064a77a0c4cfc204f945a844f3d4db31/agents/mcp/agent.py) · [agents/mcp/instructions.py](https://github.com/agno-agi/demo-os/blob/985b72e2064a77a0c4cfc204f945a844f3d4db31/agents/mcp/instructions.py)

[Run Demo OS](/demo-os/overview#run-it-locally) · [Current AgentOS documentation](/agent-os/introduction)
