Supports storing authentication credentials and configuration options in .env files for secure and flexible deployment.
Referenced for repository hosting, issue reporting, and feature requests through GitHub's issues and discussions systems.
Mentioned as part of the contribution workflow, allowing developers to enforce code quality standards through pre-commit hooks.
Integrated for comprehensive test suite execution, including coverage reporting and parallel test running.
Built on Python 3.12+, with full type annotations and mypy verification for maximum reliability.
Provides deep integration with QuantConnect's algorithmic trading platform, offering tools for financial research, statistical analysis, portfolio optimization, project management, and backtesting capabilities. Includes features for ETF constituent analysis, correlation studies, PCA analysis, and authentication with the QuantConnect API.
Integrated for code linting as part of the development workflow and quality standards.
🚀 QuantConnect MCP Server
Professional-grade Model Context Protocol server for QuantConnect's algorithmic trading platform
Seamlessly integrate QuantConnect's research environment, statistical analysis, and portfolio optimization into your AI workflows
🎯 Quick Start • 📖 Documentation • 🏗️ Architecture • 🤝 Contributing
✨ Why QuantConnect MCP Server?
Transform your algorithmic trading research with a production-ready MCP server that provides:
- 🧪 Research Environment: Full QuantBook integration for interactive financial analysis
- 📊 Advanced Analytics: PCA, cointegration testing, mean reversion analysis, and correlation studies
- 🎯 Portfolio Optimization: Sophisticated sparse optimization with Huber Downward Risk minimization
- 🌐 Universe Selection: ETF constituent analysis and multi-criteria asset screening
- 🔐 Enterprise Security: SHA-256 authenticated API integration with QuantConnect
- ⚡ High Performance: Async-first design with concurrent data processing
📋 Table of Contents
- 🎯 Quick Start
- 🛠️ Installation
- 🔑 Authentication
- 🚀 Usage Examples
- 📖 Comprehensive API Reference
- 🏗️ Architecture
- 🔧 Advanced Configuration
- 🧪 Testing
- 🤝 Contributing
- 📄 License
🎯 Quick Start
Get up and running in under 3 minutes:
1. Install Dependencies
2. Set Up QuantConnect Credentials
3. Launch the Server
4. Start Analyzing
🛠️ Installation
Prerequisites
- Python 3.12+ (Type-annotated for maximum reliability)
- QuantConnect LEAN (Installation Guide)
- Active QuantConnect Account with API access
Standard Installation
Verify Installation
🔑 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)
Method 2: Runtime Configuration
Method 3: Interactive Setup
🚀 Usage Examples
Financial Research Pipeline
Statistical Analysis Workflow
Project and Backtest Management
📖 Comprehensive API Reference
🔐 Authentication Tools
Tool | Description | Key Parameters |
---|---|---|
configure_quantconnect_auth | Set up API credentials | user_id , api_token , organization_id |
validate_quantconnect_auth | Test credential validity | - |
get_auth_status | Check authentication status | - |
test_quantconnect_api | Test API connectivity | endpoint , method |
clear_quantconnect_auth | Clear stored credentials | - |
📊 Project Management Tools
Tool | Description | Key Parameters |
---|---|---|
create_project | Create new QuantConnect project | name , language , organization_id |
read_project | Get project details or list all | project_id (optional) |
update_project | Update project name/description | project_id , name , description |
📁 File Management Tools
Tool | Description | Key Parameters |
---|---|---|
create_file | Create file in project | project_id , name , content |
read_file | Read file(s) from project | project_id , name (optional) |
update_file_content | Update file content | project_id , name , content |
update_file_name | Rename file in project | project_id , old_file_name , new_name |
🧪 QuantBook Research Tools
Tool | Description | Key Parameters |
---|---|---|
initialize_quantbook | Create new research instance | instance_name , organization_id , token |
list_quantbook_instances | View all active instances | - |
get_quantbook_info | Get instance details | instance_name |
remove_quantbook_instance | Clean up instance | instance_name |
📈 Data Retrieval Tools
Tool | Description | Key Parameters |
---|---|---|
add_equity | Add single equity security | ticker , resolution , instance_name |
add_multiple_equities | Add multiple securities | tickers , resolution , instance_name |
get_history | Get historical price data | symbols , start_date , end_date , resolution |
add_alternative_data | Subscribe to alt data | data_type , symbol , instance_name |
get_alternative_data_history | Get alt data history | data_type , symbols , start_date , end_date |
🔬 Statistical Analysis Tools
Tool | Description | Key Parameters |
---|---|---|
perform_pca_analysis | Principal Component Analysis | symbols , start_date , end_date , n_components |
test_cointegration | Engle-Granger cointegration test | symbol1 , symbol2 , start_date , end_date |
analyze_mean_reversion | Mean reversion analysis | symbols , start_date , end_date , lookback_period |
calculate_correlation_matrix | Asset correlation analysis | symbols , start_date , end_date |
💰 Portfolio Optimization Tools
Tool | Description | Key Parameters |
---|---|---|
sparse_optimization | Advanced sparse optimization | portfolio_symbols , benchmark_symbol , optimization params |
calculate_portfolio_performance | Performance metrics | symbols , weights , start_date , end_date |
optimize_equal_weight_portfolio | Equal-weight optimization | symbols , start_date , end_date , rebalance_frequency |
🌐 Universe Selection Tools
Tool | Description | Key Parameters |
---|---|---|
get_etf_constituents | Get ETF holdings | etf_ticker , date , instance_name |
add_etf_universe_securities | Add all ETF constituents | etf_ticker , date , resolution |
select_uncorrelated_assets | Find uncorrelated assets | symbols , num_assets , method |
screen_assets_by_criteria | Multi-criteria screening | symbols , min_return , max_volatility , etc. |
🔥 Backtest Management Tools
Tool | Description | Key Parameters |
---|---|---|
create_backtest | Create new backtest | project_id , compile_id , backtest_name |
read_backtest | Get backtest results | project_id , backtest_id , chart |
read_backtest_chart | Get chart data | project_id , backtest_id , name |
read_backtest_orders | Get order history | project_id , backtest_id , start , end |
read_backtest_insights | Get insights data | project_id , backtest_id , start , end |
🏗️ Architecture
Core Design Principles
- 🏛️ Modular Architecture: Each tool category is cleanly separated for maintainability
- 🔒 Security First: SHA-256 authenticated API with secure credential management
- ⚡ Async Performance: Non-blocking operations for maximum throughput
- 🧪 Type Safety: Full type annotations with mypy verification
- 🔧 Extensible: Plugin-based architecture for easy feature additions
🔧 Advanced Configuration
Transport Options
Environment Variables
Variable | Description | Default | Example |
---|---|---|---|
MCP_TRANSPORT | Transport method | stdio | streamable-http |
MCP_HOST | Server host | 127.0.0.1 | 0.0.0.0 |
MCP_PORT | Server port | 8000 | 3000 |
MCP_PATH | HTTP endpoint path | /mcp | /api/v1/mcp |
LOG_LEVEL | Logging verbosity | INFO | DEBUG |
System Resources
Monitor server performance and status:
🧪 Testing
Run the Test Suite
Manual Testing
🤝 Contributing
We welcome contributions! This project follows the highest Python development standards:
Development Setup
Code Quality Standards
- ✅ Type Hints: All functions must have complete type annotations
- ✅ Documentation: Comprehensive docstrings for all public functions
- ✅ Testing: Minimum 90% test coverage required
- ✅ Formatting: Black code formatting enforced
- ✅ Linting: Ruff linting with zero warnings
- ✅ Type Checking: mypy verification required
Development Workflow
Pull Request Guidelines
- 📝 Clear Description: Explain what and why, not just how
- 🧪 Test Coverage: Include tests for all new functionality
- 📖 Documentation: Update README and docstrings as needed
- 🔍 Code Review: Address all review feedback
- ✅ CI Passing: All automated checks must pass
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
Built with ❤️ for the algorithmic trading community
This server cannot be installed
LLM Driven Trading Platform Orchestration - Strategy Design, Research & Implementation
Related MCP Servers
- -securityAlicense-qualityEnables seamless integration with any LLM client supporting MCP for creating and optimizing technical content and product positioning using Open Strategy Partners' methodologies.Last updated -149PythonCC BY-SA 4.0
- -securityAlicense-qualityProvides a semantic memory layer that integrates LLMs with OpenSearch, enabling storage and retrieval of memories within the OpenSearch engine.Last updated -PythonApache 2.0
- -securityFlicense-qualityEnables interaction with lightning addresses and common lightning tools via your LLM, providing Lightning Network functionality through natural language.Last updated -101TypeScript
- -securityFlicense-qualityEnables communication and coordination between different LLM agents across multiple systems, allowing specialized agents to collaborate on tasks, share context, and coordinate work through a unified platform.Last updated -4TypeScript