# CrewAI

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

> Give a CrewAI agent tradefloor's simulation and evaluation tools through the local MCP server, with a tested example that lists the 22 tools.

A CrewAI agent can use the 22 tools in tradefloor's [local MCP server](https://docs.tradefloor.dev/mcp-local.html). They build simulated markets, score strategies written as data and explain price moves. 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.

## Connect

CrewAI's `MCPServerAdapter` starts an MCP server and hands its tools to a CrewAI agent. CrewAI's MCP support needs `mcp` below 2.0, and the server needs 2.0 or later. Run the server in a separate environment with `uvx`, as below, and install CrewAI where your agent runs:

```
pip install crewai "crewai-tools[mcp]"
```

```
from crewai_tools import MCPServerAdapter
from mcp import StdioServerParameters

server = StdioServerParameters(
    command="uvx", args=["--with", "tradefloor[mcp]", "tradefloor", "mcp"])
with MCPServerAdapter(server) as tools:
    print(len(tools), "tools")
    print(", ".join(tool.name for tool in tools[:4]))
```

```
22 tools
describe_simulator, check_envelope, validate_strategy, evaluate_strategies
```

Inside the `with` block, pass the tools to an agent as `Agent(role=..., goal=..., backstory=..., tools=tools)`. The block was tested with `crewai-tools` 1.15.23 and needs [uv](https://docs.astral.sh/uv/) for `uvx`.

## Tested with

`crewai` 1.15.23, `crewai-tools` 1.15.23 and tradefloor 0.11.0.
