
QuantConnect
Connects AI workflows to QuantConnect's algorithmic trading platform for backtesting, research, and portfolio management. Enables programmatic access to financial data, project management, and live trading operations.
Integrates with QuantConnect's quantitative finance platform to provide historical data retrieval, statistical analysis, portfolio optimization, universe selection, alternative data access, backtest execution, and project management for algorithmic trading research and financial analytics workflows.
What it does
- Retrieve historical financial data
- Execute algorithmic trading backtests
- Manage QuantConnect projects and files
- Deploy and monitor live trading algorithms
- Perform statistical analysis on portfolios
- Access alternative financial datasets
Best for
About QuantConnect
QuantConnect is a community-built MCP server published by taylorwilsdon that provides AI assistants with tools and capabilities via the Model Context Protocol. Access portfolio optimization, Yahoo Finance historical prices, and advanced analytics with QuantConnect for powerful al It is categorized under finance, analytics data.
How to install
You can install QuantConnect in your AI client of choice. Use the install panel on this page to get one-click setup for Cursor, Claude Desktop, VS Code, and other MCP-compatible clients. This server runs locally on your machine via the stdio transport.
License
QuantConnect is released under the MIT license. This is a permissive open-source license, meaning you can freely use, modify, and distribute the software.
◆ QuantConnect MCP Server
Production-ready Model Context Protocol server for QuantConnect's algorithmic trading platform
Integrate QuantConnect's research environment, statistical analysis, and portfolio optimization into your AI workflows. Locally hosted, secure & capable of dramatically improving productivity
◉ Quick Start • ◉ Documentation • ◉ Architecture • ◉ Contributing
Demo – Claude
◈ Is this crazy?
- Full Project Lifecycle:
Create,read,update,compile, and manage QuantConnect projects and files programmatically. - End-to-End Backtesting:
Compileprojects,create backtests,read detailed results, and analyzecharts,orders, andinsights. - Live Trading Management:
Deploy,monitor,liquidate, andcontrollive algorithms with comprehensive runtime statistics and logging. - Historical Data Access: Comprehensive data retrieval capabilities for historical and
alternative dataanalysis. - Advanced Analytics: Perform
Principal Component Analysis (PCA),Engle-Granger cointegration tests,mean-reversion analysis, andcorrelation studies. - Portfolio Optimization: Utilize sophisticated
sparse optimizationwith Huber Downward Risk minimization, calculate performance, and benchmark strategies. - Universe Selection: Dynamically
screen assetsby multiple criteria, analyzeETF constituents, and select assets based on correlation. - Enterprise-Grade Security: Secure,
SHA-256 authenticatedAPI integration with QuantConnect. - High-Performance Core: Built with an
async-firstdesign for concurrent data processing and responsiveness. - AI-Native Interface: Designed for seamless interaction via
natural languagein advanced AI clients.
◉ Table of Contents
- ◈ Quick Start
- ◈ Authentication
- ◈ Natural Language Examples
- ◈ Comprehensive API Reference
- ◈ Architecture
- ◈ Advanced Configuration
- ◈ Testing
- ◈ Contributing
- ◈ License
◈ Quick Start
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 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)
- Download: Grab the latest
quantconnect-mcp.dxtfrom the “Releases” page - Install: Double-click the file – Claude Desktop opens and prompts you to Install
- Configure: In Claude Desktop → Settings → Extensions → QuantConnect MCP, paste your user ID and API token
- 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."
◈ Authentication
Getting Your Credentials
| Credential | Where to Find | Required |
|---|---|---|
| User ID | Email received when signing up | ◉ Yes |
| API Token | QuantConnect Settings | ◉ Yes |
| Organization ID | Organization URL: /organization/{ID} | ◦ Optional |
Configuration Methods
Method 1: Environment Variables (Recommended)
# Add to your .bashrc, .zshrc, or .env file
export QUANTCONNECT_USER_ID="123456"
export QUANTCONNECT_API_TOKEN="your_secure_token_here"
export QUANTCONNECT_ORGANIZATION_ID="your_org_id" # Optional
Demo – Roo Code
◈ Natural Language Examples
This MCP server is designed to be used with natural language. Below are examples of how you can instruct an AI assistant to perform complex financial analysis tasks.
Factor‑Driven Portfolio Construction Pipeline
“Build a global equity long/short portfolio for 2025:
- Pull the constituents of QQQ, SPY, and EEM as of 2024‑12‑31 (survivor‑bias free).
- For each symbol, calculate Fama‑French 5‑factor and quality‑minus‑junk loadings using daily data 2022‑01‑01 → 2024‑12‑31.
- Rank stocks into terciles on value (B/M) and momentum (12‑1); go long top tercile, short bottom, beta‑neutral to the S&P 500.
- Within each book, apply Hierarchical Risk Parity (HRP) for position sizing, capped at 5 % gross exposure per leg.
- Target annualised ex‑ante volatility ≤ 10 %; solve with CVaR minimisation under a 95 % confidence level.
- Benchmark against MSCI World; report annualised return, vol, Sharpe, Sortino, max DD, hit‑rate, turnover for the period 2023‑01‑01 → 2024‑12‑31.
- Export the optimal weights and full tear‑sheet as
csv.- Schedule a monthly rebalance job and push signals to the live trading endpoint.”
Robust Statistical‑Arbitrage Workflow
“Test and refine a pairs‑trading idea: • Universe: US Staples sector, market cap > $5 B, price > $10. • Data: 15‑minute bars, 2023‑01‑02 → 2025‑06‑30. • Step 1 – For all pairs, calculate rolling 60‑day distance correlation; keep pairs with dCor ≥ 0.80. • Step 2 – Run Johansen cointegration (lag = 2) on the survivors; retain pairs with trace‑stat < 5 % critical value. • Step 3 – For each cointegrated pair: – Estimate half‑life of mean‑reversion; discard if > 7 days. – Compute Hurst exponent; require H < 0.4. • Step 4 – Simulate a Bayesian Kalman‑filter spread to allow time‑varying hedge ratios. • Entry: z‑score crosses ±2 (two‑bar confirmation); Exit: z = 0 or t_max = 3 × half‑life. • Risk: cap pair notional at 3 % NAV, portfolio gross leverage ≤ 3 ×, stop‑loss at z = 4. • Output: trade log, PnL attribution, bootstrapped p‑value of alpha, and Likelihood‑Ratio test for regime shifts.”
Automated Project, Backtest & Hyper‑Parameter Sweep
“Spin up an experiment suite in QuantConnect:
- Create project ‘DynamicPairs_Kalman’ (Python).
- Add files: •
alpha.py– signal generation (placeholder) •risk.py– custom position sizing •config.yaml– parameter grid:yaml entry_z: [1.5, 2.0, 2.5] lookback: [30, 60, 90] hedge: ['OLS', 'Kalman']- Trigger a parameter‑sweep backtest labelled ‘GridSearch‑v1’ using in‑sample 2022‑23.
- When jobs finish, rank runs by Information Ratio and max DD < 10 %; persist top‑3 configs.
- Automatically launch out‑of‑sample backtests 2024‑YTD for the winners.
- Produce an executive summary: tables + charts (equity curve, rolling Sharpe, exposure histogram).
- Package the best model as a Docker image, push to registry, and deploy to the live‑trading cluster with a kill‑switch if 1‑day loss > 3 σ.”
Statistical Analysis Workflow
"Are Coca-Cola (KO) and Pepsi (PEP) cointegrated? Run the test for the period from 2023 to 2024. If they are, analyze their mean-reversion properties with a 20-day lookback."
Project and Backtest Management
"I need to manage my QuantConnect projects. First, create a new Python project named 'My_Awesome_Strategy'. Then, create a file inside it called 'main.py' and add this code:
...your algorithm code here.... After that, compile it and run a backtest named 'Initial Run'. When it's done, show me the performance resu
README truncated. View full README on GitHub.
Alternatives
Related Skills
Browse all skillsTransform data into compelling narratives using visualization, context, and persuasive structure. Use when presenting analytics to stakeholders, creating data reports, or building executive presentations.
Advanced content and topic research skill that analyzes trends across Google Analytics, Google Trends, Substack, Medium, Reddit, LinkedIn, X, blogs, podcasts, and YouTube to generate data-driven article outlines based on user intent analysis
No API KEY needed for free tier. Professional-grade cryptocurrency market data integration for real-time prices, historical charts, and global analytics.
World-class data science skill for statistical modeling, experimentation, causal inference, and advanced analytics. Expertise in Python (NumPy, Pandas, Scikit-learn), R, SQL, statistical methods, A/B testing, time series, and business intelligence. Includes experiment design, feature engineering, model evaluation, and stakeholder communication. Use when designing experiments, building predictive models, performing causal analysis, or driving data-driven decisions.
Expert data scientist for advanced analytics, machine learning, and statistical modeling. Handles complex data analysis, predictive modeling, and business intelligence. Use PROACTIVELY for data analysis tasks, ML modeling, statistical analysis, and data-driven insights.
Master dbt (data build tool) for analytics engineering with model organization, testing, documentation, and incremental strategies. Use when building data transformations, creating data models, or implementing analytics engineering best practices.