Status: Active · Layer: Core · Integration: OS-integrated
MCP server that exposes QuantTradingOS as tools for AI clients (chatbots, Cursor, Claude Desktop). The server calls your existing REST APIs (orchestrator + data-ingestion-service); it does not replace them.
| Tool | Description | Backend |
|---|---|---|
run_backtest |
Run a backtest for a symbol; returns metrics (PnL, Sharpe, CAGR, max drawdown). | Orchestrator POST /backtest |
get_prices |
Get OHLCV price history for a symbol. | Data service GET /prices/{symbol} |
get_news |
Get recent news for a symbol. | Data service GET /news/{symbol} |
get_insider |
Get recent insider transactions for a symbol. | Data service GET /insider/{symbol} |
run_decision |
Run the full pipeline (regime → portfolio → allocation). | Orchestrator POST /decision |
- Orchestrator and data-ingestion-service (or full Docker stack) must be running so the MCP server can call them.
- Python 3.10+ (the
mcppackage requires 3.10+). If your defaultpythonis older, usepython3.11 -m qtos_mcp.server(and set that in Cursor MCPcommand/args).
cd mcp-server
pip install -r requirements.txt
cp config/env.example config/.env
# Edit config/.env: set ORCHESTRATOR_URL and DATA_SERVICE_URL (e.g. http://localhost:8000, http://localhost:8001)Stdio (for Cursor / CLI clients) — client launches the server as a subprocess and talks over stdin/stdout:
python -m qtos_mcp.serverSSE (HTTP) — server listens on a URL; clients connect via SSE:
python -m qtos_mcp.server --transport sse --port 8002Then connect to http://127.0.0.1:8002/sse (e.g. with MCP Inspector: npx -y @modelcontextprotocol/inspector).
To use the MCP server from Cursor:
- Ensure the orchestrator and data service are running (e.g.
docker-compose -f orchestrator/docker-compose.full.yml upor run them locally). - In Cursor: Settings → MCP (or Cursor Settings → Features → MCP). Add a server, e.g.:
{
"mcpServers": {
"quant-trading-os": {
"command": "python",
"args": ["-m", "qtos_mcp.server"],
"cwd": "/path/to/QuantTradingOS/mcp-server",
"env": {
"ORCHESTRATOR_URL": "http://localhost:8000",
"DATA_SERVICE_URL": "http://localhost:8001"
}
}
}
}If your default python is older than 3.10, use "command": "python3.11" (or the path to your Python 3.10+ interpreter).
Use your actual workspace path for cwd. If you use config/.env, you can omit env (the server loads it).
| Variable | Default | Description |
|---|---|---|
ORCHESTRATOR_URL |
http://localhost:8000 |
Base URL of the orchestrator API. |
DATA_SERVICE_URL |
http://localhost:8001 |
Base URL of the data-ingestion-service API. |
You can set these in config/.env or in the environment (e.g. Cursor MCP env).
MIT (same as QuantTradingOS).