Skip to content

MCP server exposing QuantTradingOS tools for AI/chatbot clients

Notifications You must be signed in to change notification settings

QuantTradingOS/mcp-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

QuantTradingOS MCP Server

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.

Tools

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

Prerequisites

  • Orchestrator and data-ingestion-service (or full Docker stack) must be running so the MCP server can call them.
  • Python 3.10+ (the mcp package requires 3.10+). If your default python is older, use python3.11 -m qtos_mcp.server (and set that in Cursor MCP command/args).

Setup

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)

Run

Stdio (for Cursor / CLI clients) — client launches the server as a subprocess and talks over stdin/stdout:

python -m qtos_mcp.server

SSE (HTTP) — server listens on a URL; clients connect via SSE:

python -m qtos_mcp.server --transport sse --port 8002

Then connect to http://127.0.0.1:8002/sse (e.g. with MCP Inspector: npx -y @modelcontextprotocol/inspector).

Cursor

To use the MCP server from Cursor:

  1. Ensure the orchestrator and data service are running (e.g. docker-compose -f orchestrator/docker-compose.full.yml up or run them locally).
  2. 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).

Environment

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).

License

MIT (same as QuantTradingOS).

About

MCP server exposing QuantTradingOS tools for AI/chatbot clients

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages