# Agno

Source: https://docs.tradefloor.dev/agno.html

> Connect an Agno agent to tradefloor's local MCP server over stdio with MCPTools, list its 22 tools and call one without a model or an API key.

Agno's `MCPTools` toolkit connects an Agno agent to tradefloor's [local MCP server](https://docs.tradefloor.dev/mcp-local.html). That gives the agent 19 simulation and evaluation tools, such as `evaluate_strategies`, `run_stress_scenario` and `explain_price_move`. With the session tools a model can trade step by step in a simulated market the server keeps open, and no order reaches a real broker.

## Install

```
pip install "agno[mcp]"
```

`MCPTools` needs `fastmcp` to open a connection, and the `mcp` extra adds it. The server runs in a separate environment through `uvx`, which needs [uv](https://docs.astral.sh/uv/).

## Connect

`MCPTools` starts the server as a subprocess and registers each MCP tool as an Agno function in `toolkit.functions`. This example lists them, then calls `list_scenarios` with no model or API key.

```
import asyncio
import json

from agno.tools.mcp import MCPTools


async def main():
    async with MCPTools(
        command='uvx --with "tradefloor[mcp]" tradefloor mcp',
        timeout_seconds=60,
    ) as toolkit:
        names = sorted(toolkit.functions)
        print(len(names), "tools:", ", ".join(names[:4]), "...")

        result = await toolkit.functions["list_scenarios"].entrypoint()
        scenarios = json.loads(result.content)["shipped"]
        print("scenarios:", ", ".join(s["name"] for s in scenarios))


asyncio.run(main())
```

```
22 tools: build_scenario, build_universe, check_envelope, check_job ...
scenarios: curve_shock, geopolitical_conflict, liquidity_crisis, oil_price_spike, policy_regime_shift, rate_shock, recession, recession_2008
```

To give the tools to an agent, pass the connected toolkit inside the `async with` block, as in `Agent(model=..., tools=[toolkit])`. `timeout_seconds` is Agno's read timeout for the MCP client and defaults to 10. Use `include_tools` or `exclude_tools` on `MCPTools` to limit which tools the agent sees.

## Tested with

Python 3.12.14, agno 3.1.1, fastmcp 4.0.11 and mcp 2.3.0 on macOS, and tradefloor 0.11.0.
