Skip to content
Back to search

quantconnect-mcp

QuantConnect Algorithmic Trading Platform Orchestration MCP - Agentic LLM Driven Trading Strategy Design, Research & Implementation

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today

Check it deeper on your machine

It has changed since its scan on 11 Nov 2026.

As a Claude Code plugin, install it and then ask Claude Code:

/plugin marketplace add keithmackay/mackayi/plugin install scanskillsafety@mackayiDo a deep scan of https://github.com/taylorwilsdon/quantconnect-mcp with scanskillsafety

Or from a terminal, clone it and run it:

git clone https://github.com/keithmackay/scanskillsafety-skill ~/.claude/skills/scanskillsafetynode ~/.claude/skills/scanskillsafety/cli.cjs --deep 'https://github.com/taylorwilsdon/quantconnect-mcp'

It checks the exact commit: every file, its packages against OSV (api.osv.dev), how it compares with this page's scan (findsafeskills.com receives the repository's address), and, if you agree, Claude reading every file with your own Claude subscription. It never runs the code.

Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/taylorwilsdon--quantconnect-mcp/badge.svg)](/listings/taylorwilsdon--quantconnect-mcp)

HTML

<a href="/listings/taylorwilsdon--quantconnect-mcp"><img src="/api/listings/taylorwilsdon--quantconnect-mcp/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

Get up and running in under 2 minutes:

> **Prerequisites:** You must have QuantConnect credentials (User ID and API Token) before running the server. The server will not function without proper authentication. See [Authentication](#-authentication) section for details on obtaining these credentials.

**Install with uvx (Recommended)**

# Install and run directly from PyPI - no cloning required!
uvx quantconnect-mcp

# Or install with uv/pip
uv pip install quantconnect-mcp
pip install quantconnect-mcp

One-Click Claude Desktop Install (Recommended)

1. **Download:** Grab the latest `quantconnect-mcp.dxt` from the “Releases” page 2. **Install:** Double-click the file – Claude Desktop opens and prompts you to **Install** 3. **Configure:** In Claude Desktop → **Settings → Extensions → QuantConnect MCP**, paste your user ID and API token 4. **Use it:** Start a new Claude chat and call any QuantConnect tool

**Why DXT?** > Desktop Extensions (`.dxt`) bundle the server, dependencies, and manifest so users go from download → working MCP in **one click** – no terminal, no JSON editing, no version conflicts.

2. **Set Up QuantConnect Credentials (Required)**

**The server requires these environment variables to function properly:**

export QUANTCONNECT_USER_ID="your_user_id"        # Required
export QUANTCONNECT_API_TOKEN="your_api_token"    # Required
export QUANTCONNECT_ORGANIZATION_ID="your_org_id" # Optional

3. **Launch the Server**

# STDIO transport (default) - Recommended for MCP clients
uvx quantconnect-mcp

# HTTP transport
MCP_TRANSPORT=streamable-http MCP_PORT=8000 uvx quantconnect-mcp

4. **Interact with Natural Language**

Instead of calling tools programmatically, you use natural language with a connected AI client (like Claude, a GPT, or any other MCP-compatible interface).

> "Add GOOGL, AMZN, and MSFT, then run a PCA analysis on them for 2023."

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 204 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

This file has changed since it was scanned, so this is not exactly the text that was scanned, and no line is marked. The findings are listed with the safety scan above.

  1. <div align="center">
  2. # ◆ QuantConnect MCP Server
  3. [![Python](https://img.shields.io/badge/Python-3.12%2B-blue.svg)](https://python.org)
  4. [![FastMCP](https://img.shields.io/badge/FastMCP-4.x-green.svg)](https://gofastmcp.com)
  5. [![License](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
  6. [![PyPI Downloads](https://static.pepy.tech/badge/quantconnect-mcp)](https://pepy.tech/projects/quantconnect-mcp)
  7. **Give your AI assistant the QuantConnect cloud: write LEAN algorithms, compile, backtest, optimize, and manage live trading through the Model Context Protocol.**
  8. </div>
  9. <details open>
  10. <summary>Demo: Claude</summary>
  11. <div align="center">
  12. <video width="832" src="https://github.com/user-attachments/assets/61e96e0e-05b2-482b-8fe3-ccf078d64cc5"></video>
  13. </div>
  14. </details>
  15. ## ◈ What it does
  16. 61 tools that cover the [QuantConnect REST API v2](https://www.quantconnect.com/docs/v2/cloud-platform/api-reference):
  17. - **Research loop**: create projects and files, check syntax, compile (the tool waits for the build), backtest, and read statistics, orders, insights, charts, and full reports.
  18. - **Optimization**: estimate cost, then run grid-search parameter sweeps on typed parameter ranges and constraints.
  19. - **Live trading**: deploy, monitor portfolio, orders, logs, and charts, send commands, liquidate, and stop.
  20. - **Object Store**: list, inspect, upload, download, and delete organization data.
  21. - **LEAN coding help**: QuantConnect's AI tools for syntax checks, error explanations, documentation search, and code completion.
  22. Every request is validated in CI against QuantConnect's published OpenAPI spec.
  23. ## ◈ Quick start
  24. You need [uv](https://docs.astral.sh/uv/) (it fetches Python 3.12+ and the server for you) and a QuantConnect account.
  25. 1. Get your **User ID** and **API token** from [quantconnect.com/settings](https://www.quantconnect.com/settings/).
  26. 2. Add the server to your MCP client. For Claude Desktop, Claude Code, Cursor, and most clients:
  27. ```json
  28. {
  29. "mcpServers": {
  30. "quantconnect": {
  31. "command": "uvx",
  32. "args": ["quantconnect-mcp"],
  33. "env": {
  34. "QUANTCONNECT_USER_ID": "123456",
  35. "QUANTCONNECT_API_TOKEN": "your-api-token"
  36. }
  37. }
  38. }
  39. }
  40. ```
  41. With Claude Code you can run `claude mcp add quantconnect -e QUANTCONNECT_USER_ID=123456 -e QUANTCONNECT_API_TOKEN=your-api-token -- uvx quantconnect-mcp`.
  42. 3. Ask for something: *"Create a Python project with an EMA crossover on SPY, backtest it over 2020 to 2024, and summarize the Sharpe ratio and drawdown."*
  43. ### Claude Desktop extension
  44. The 1.0 release does not ship a prebuilt `.dxt`, and the bundles attached to 0.x releases contain the old server, so build it from a checkout:
  45. ```bash
  46. git clone https://github.com/taylorwilsdon/quantconnect-mcp && cd quantconnect-mcp
  47. npx @anthropic-ai/dxt pack . quantconnect-mcp.dxt
  48. ```
  49. Double-click the file and enter your credentials under **Settings > Extensions > QuantConnect MCP**. The extension starts the server with `uv run`, so uv must be installed.
  50. ## ◈ Configuration
  51. All settings come from environment variables. Credentials are never accepted through tool calls, so they stay out of model transcripts.
  52. The server does not read a `.env` file on its own, because MCP clients start it from inside your project and that project's `.env` is not meant for it. To keep settings in a file, copy [`.env.example`](.env.example) and pass it explicitly, for example `uv run --env-file .env quantconnect-mcp`.
  53. | Variable | Default | Purpose |
  54. |----------|---------|---------|
  55. | `QUANTCONNECT_USER_ID` | required | Your QuantConnect user ID |
  56. | `QUANTCONNECT_API_TOKEN` | required | Your QuantConnect API token |
  57. | `QUANTCONNECT_ORGANIZATION_ID` | your preferred org | Organization for new projects, the Object Store, and broadcasts |
  58. | `QUANTCONNECT_API_URL` | `https://www.quantconnect.com/api/v2/` | API base URL; change it only to point at a proxy or mock |
  59. | `REQUEST_TIMEOUT` | `60` | Seconds to wait for a QuantConnect response |
  60. | `MCP_TRANSPORT` | `stdio` | `stdio` or `streamable-http` |
  61. | `MCP_HOST` | `127.0.0.1` | HTTP bind address |
  62. | `MCP_PORT` | `8000` | HTTP port |
  63. | `MCP_PATH` | `/mcp` | HTTP endpoint path |
  64. | `MCP_AUTH_TOKEN` | unset | Bearer token that HTTP clients must send |
  65. | `LOG_LEVEL` | `INFO` | `DEBUG`, `INFO`, `WARNING`, or `ERROR` (logs go to stderr) |
  66. Blank optional variables count as unset. If a required variable is missing or a value is invalid, the server exits at startup and names the offending variables.
  67. The API client keeps one pooled connection, retries failed connections, and retries once on HTTP 429 after waiting for `Retry-After` (capped at 30 seconds).
  68. ## ◈ Security model
  69. These tools can deploy algorithms and liquidate positions on real brokerage accounts. The server is built around that fact:
  70. - **Credentials** live only in the server environment and are held as secrets in memory.
  71. - **HTTP transport** binds to `127.0.0.1` by default. Binding anywhere else requires `MCP_AUTH_TOKEN`, or the server refuses to start. Clients send `Authorization: Bearer <token>`.
  72. - **Tool annotations** mark every tool as read-only, mutating, or destructive, so clients can require confirmation for deletes, liquidation, live deployment, and live commands.
  73. - **Errors** come back as proper MCP tool errors with QuantConnect's message. Unexpected internal failures are masked.
  74. ### Running over HTTP
  75. ```bash
  76. export MCP_AUTH_TOKEN=$(openssl rand -hex 32)
  77. MCP_TRANSPORT=streamable-http uvx quantconnect-mcp
  78. ```
  79. The endpoint is `http://127.0.0.1:8000/mcp`. Point a client at it with the token:
  80. ```json
  81. {
  82. "mcpServers": {
  83. "quantconnect": {
  84. "type": "http",
  85. "url": "http://127.0.0.1:8000/mcp",
  86. "headers": { "Authorization": "Bearer your-mcp-auth-token" }
  87. }
  88. }
  89. }
  90. ```
  91. ### Docker
  92. ```bash
  93. docker build -t quantconnect-mcp .
  94. docker run -p 8000:8000 \
  95. -e QUANTCONNECT_USER_ID -e QUANTCONNECT_API_TOKEN -e MCP_AUTH_TOKEN \
  96. quantconnect-mcp
  97. ```
  98. The image serves HTTP on `0.0.0.0:8000` as a non-root user, so it will not start without `MCP_AUTH_TOKEN`.
  99. ## ◈ Tools
  100. | Area | Tools |
  101. |------|-------|
  102. | Account | `validate_quantconnect_auth`, `get_auth_status`, `read_account`, `read_lean_versions`, `authorize_connection` |
  103. | Projects | `create_project`, `read_project`, `update_project`, `delete_project`, `create_project_collaborator`, `read_project_collaborators`, `update_project_collaborator`, `delete_project_collaborator`, `read_project_nodes`, `update_project_nodes` |
  104. | Files | `create_file`, `read_file`, `update_file_content`, `update_file_name`, `delete_file` |
  105. | Compile | `compile_project`, `read_compilation_result` |
  106. | Backtests | `create_backtest`, `read_backtest`, `list_backtests`, `read_backtest_chart`, `read_backtest_orders`, `read_backtest_insights`, `read_backtest_report`, `update_backtest`, `delete_backtest` |
  107. | Optimizations | `estimate_optimization_time`, `create_optimization`, `read_optimization`, `list_optimizations`, `update_optimization`, `abort_optimization`, `delete_optimization` |
  108. | Live trading | `create_live_algorithm`, `read_live_algorithm`, `list_live_algorithms`, `read_live_logs`, `read_live_chart`, `read_live_portfolio`, `read_live_orders`, `read_live_insights`, `liquidate_live_algorithm`, `stop_live_algorithm`, `create_live_command`, `broadcast_live_command` |
  109. | Object Store | `list_object_store`, `read_object_store_properties`, `get_object_store_download`, `upload_object_store_object`, `delete_object_store_object` |
  110. | LEAN coding help | `check_syntax`, `initialize_backtest`, `enhance_error`, `search_quantconnect`, `complete_code`, `convert_to_pep8` |
  111. Each tool returns QuantConnect's response payload. A few behaviors are worth knowing:
  112. - **Compiling**: `compile_project` polls until the build reaches `BuildSuccess` or `BuildError` and reports progress. After about two minutes it fails with the compile ID so you can check later with `read_compilation_result`. Pass `wait=false` to return immediately.
  113. - **Paging**: page limits are enforced before the request is sent. Backtest orders and all insights allow 99 items per call, live orders 1,000, and live logs 250 lines. `end` is exclusive.
  114. - **Charts**: `read_backtest_chart` and `read_live_chart` need `start` and `end` as Unix timestamps. Charts, orders, and reports can answer with a loading status while QuantConnect generates them; call again.
  115. - **Optimizations**: grid search only. `target` and constraints use `SharpeRatio`, `CompoundingAnnualReturn`, `ProbabilisticSharpeRatio`, or `Drawdown`. `create_optimization` spends QuantConnect Credit and needs the `estimated_cost` from `estimate_optimization_time`.
  116. - **Live deployment**: `create_live_algorithm` takes a `brokerage` object with an `id`, for example `{"id": "QuantConnectBrokerage"}` for paper trading. `authorize_connection` returns an OAuth URL for Alpaca, TradeStation, Charles Schwab, or tastytrade that a person must open in a browser.
  117. - **Object Store**: uploads store text. Downloads take two steps: call `get_object_store_download` with `keys` to start a job, then with the returned `job_id` until the response has a URL.
  118. ## ◈ Upgrading from 0.x
  119. 1.0 is a rewrite on FastMCP 4. Tool names are unchanged except as noted below; see [CHANGELOG.md](CHANGELOG.md) for every signature change.
  120. - Removed `configure_quantconnect_auth`, `clear_quantconnect_auth`, `test_quantconnect_api`, and `get_auth_headers_info`. Set credentials through the environment; the server no longer starts without them.
  121. - HTTP now binds to `127.0.0.1` instead of `0.0.0.0`, and any other bind address requires `MCP_AUTH_TOKEN`. Existing Docker and remote deployments must set a token and send it as a bearer header.
  122. - `MCP_TRANSPORT` accepts only `stdio` and `streamable-http`. The generic `PORT` variable is no longer read; set `MCP_PORT`.
  123. - The entry point moved from `quantconnect_mcp.main` to `quantconnect_mcp.server`. The `quantconnect-mcp` command is unchanged, and `python -m quantconnect_mcp` now works.
  124. - Failed calls now return MCP errors instead of `{"status": "error"}` payloads, and successful calls return the API payload directly.
  125. - Optimization tools take typed `parameters` (`name`, `min`, `max`, `step`), a `target`, and a `target_to`.
  126. - `create_live_algorithm` takes one `brokerage` object in place of `brokerage_id` and `brokerage_config`, `update_file_name` takes `name` and `new_name`, and `update_project_collaborator` requires both `write` and `live_control`.
  127. - New tools: the Object Store, the LEAN coding help set, `read_backtest_report`, `read_lean_versions`, `create_live_command`, and `broadcast_live_command`.
  128. - The install is much smaller: pandas, numpy, scipy, scikit-learn, matplotlib, and the other unused scientific packages are gone. Runtime dependencies are fastmcp, httpx2, pydantic, and pydantic-settings.
  129. - The analytics features previously described in this README (PCA, cointegration, universe screening, portfolio optimization) were never implemented and are no longer advertised.
  130. ## ◈ Development
  131. ```bash
  132. git clone https://github.com/taylorwilsdon/quantconnect-mcp && cd quantconnect-mcp
  133. uv sync
  134. uv run pytest # tool, client, server, and OpenAPI contract tests
  135. uv run ruff check && uv run ruff format --check
  136. uv run mypy # strict
  137. uv run pre-commit install # optional: run ruff and mypy on commit
  138. ```
  139. CI runs the same checks on Python 3.12 and 3.13.
  140. The layout is small on purpose:
  141. ```
  142. quantconnect_mcp/
  143. settings.py configuration (pydantic-settings)
  144. client.py signed, pooled QuantConnect API client
  145. server.py FastMCP server, bearer auth, entry point
  146. tools/ one module per API area, one short function per tool
  147. ```
  148. To add a tool, write an async function in the matching `tools/` module, decorate it with `@tool(annotations=...)`, take `qc: QuantConnectClient = CLIENT`, add it to that module's `TOOLS`, and add a row to `tests/cases.py`. The contract test checks the payload against `tests/fixtures/quantconnect-openapi.yaml`, which is vendored from [QuantConnect/Documentation](https://github.com/QuantConnect/Documentation).
  149. To release, run `uv run release.py`: it bumps the version in `pyproject.toml`, `manifest.json`, and `uv.lock`, tags, pushes, and drafts a GitHub release. Publishing that draft triggers the workflow that uploads to PyPI through trusted publishing.
  150. ## ◈ License
  151. MIT. See [LICENSE](LICENSE).

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.