Skip to main content
Glama

QuantConnect MCP Server

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
MCP_HOSTNoServer host address0.0.0.0
MCP_PATHNoHTTP endpoint path/mcp
MCP_PORTNoServer port number8000
LOG_LEVELNoLogging verbosity levelINFO
MCP_TRANSPORTNoTransport method for the serverstreamable-http
QUANTCONNECT_USER_IDYesYour QuantConnect user ID (required for authentication)
QUANTCONNECT_API_TOKENYesYour QuantConnect API token found in settings
QUANTCONNECT_ORGANIZATION_IDNoOptional organization ID for QuantConnect

Schema

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription
system_infoGet comprehensive system information.
server_statusGet QuantConnect MCP server status and statistics.
tools_summaryGet summary of available QuantConnect tools.
performance_metricsGet server performance metrics.

Tools

Functions exposed to the LLM to take actions

NameDescription
configure_quantconnect_auth
Configure QuantConnect API authentication credentials. Args: user_id: Your QuantConnect user ID (from email) api_token: Your QuantConnect API token (from Settings page) organization_id: Your organization ID (from organization URL) Returns: Dictionary containing authentication configuration status
validate_quantconnect_auth
Validate current QuantConnect authentication configuration. Returns: Dictionary containing authentication validation results
get_auth_status
Get current authentication status and configuration. Returns: Dictionary containing authentication status information
test_quantconnect_api
Test QuantConnect API connectivity with current authentication. Args: endpoint: API endpoint to test (default: authenticate) method: HTTP method to use (default: POST) Returns: Dictionary containing API test results
clear_quantconnect_auth
Clear current QuantConnect authentication configuration. Returns: Dictionary containing operation status
get_auth_headers_info
Get information about authentication headers (without exposing sensitive data). Returns: Dictionary containing header information
create_project
Create a new project in your QuantConnect organization. Args: name: Project name (must be unique within organization) language: Programming language - "C#" or "Py" (default: "Py") organization_id: Optional organization ID (uses default if not specified) Returns: Dictionary containing project creation result with project details
read_project
Read project details by ID or list all projects if no ID provided. Args: project_id: Optional project ID to get specific project details. If not provided, returns list of all projects. Returns: Dictionary containing project details or list of all projects
update_project
Update a project's name and/or description. Args: project_id: ID of the project to update name: Optional new name for the project description: Optional new description for the project Returns: Dictionary containing update result
create_file
Create a new file in a QuantConnect project. Args: project_id: ID of the project to add the file to name: Name of the file (e.g., "main.py", "algorithm.cs") content: Content of the file Returns: Dictionary containing file creation result
read_file
Read a specific file from a project or all files if no name provided. Args: project_id: ID of the project to read files from name: Optional name of specific file to read. If not provided, reads all files. Returns: Dictionary containing file content(s) or error information
update_file_content
Update the content of a file in a QuantConnect project. Args: project_id: ID of the project containing the file name: Name of the file to update content: New content for the file Returns: Dictionary containing update result
update_file_name
Update the name of a file in a QuantConnect project. Args: project_id: ID of the project containing the file old_file_name: Current name of the file new_name: New name for the file Returns: Dictionary containing update result
create_backtest
Create a new backtest for a compiled project. Args: project_id: ID of the project to backtest compile_id: Compile ID from a successful project compilation backtest_name: Name for the backtest parameters: Optional dictionary of parameters for the backtest (e.g., {"ema_fast": 10, "ema_slow": 100}) Returns: Dictionary containing backtest creation result and backtest details
read_backtest
Read backtest results and statistics from a project. Args: project_id: ID of the project containing the backtest backtest_id: ID of the specific backtest to read chart: Optional chart name to include chart data in response Returns: Dictionary containing backtest results, statistics, and optional chart data
read_backtest_chart
Read chart data from a backtest. Args: project_id: Project ID containing the backtest backtest_id: ID of the backtest to get chart from name: Name of the chart to retrieve (e.g., "Strategy Equity") count: Number of data points to request (default: 100) start: Optional UTC start timestamp in seconds end: Optional UTC end timestamp in seconds Returns: Dictionary containing chart data or loading status
read_backtest_orders
Read orders from a backtest. Args: project_id: ID of the project containing the backtest backtest_id: ID of the backtest to read orders from start: Starting index of orders to fetch (default: 0) end: Last index of orders to fetch (default: 100, max range: 100) Returns: Dictionary containing orders data and total count
read_backtest_insights
Read insights from a backtest. Args: project_id: ID of the project containing the backtest backtest_id: ID of the backtest to read insights from start: Starting index of insights to fetch (default: 0) end: Last index of insights to fetch (default: 100, max range: 100) Returns: Dictionary containing insights data and total count
initialize_quantbook
Initialize a new QuantBook instance for research operations. Args: instance_name: Name identifier for this QuantBook instance organization_id: Optional organization ID for QuantConnect token: Optional API token for QuantConnect Returns: Dictionary containing initialization status and instance info
list_quantbook_instances
List all active QuantBook instances. Returns: Dictionary containing all active QuantBook instances
get_quantbook_info
Get information about a specific QuantBook instance. Args: instance_name: Name of the QuantBook instance Returns: Dictionary containing instance information
remove_quantbook_instance
Remove a QuantBook instance from memory. Args: instance_name: Name of the QuantBook instance to remove Returns: Dictionary containing removal status
add_equity
Add an equity security to the QuantBook instance. Args: ticker: Stock ticker symbol (e.g., "AAPL", "SPY") resolution: Data resolution (Minute, Hour, Daily) instance_name: QuantBook instance name Returns: Dictionary containing the added security information
add_multiple_equities
Add multiple equity securities to the QuantBook instance. Args: tickers: List of stock ticker symbols resolution: Data resolution (Minute, Hour, Daily) instance_name: QuantBook instance name Returns: Dictionary containing results for all added securities
get_history
Retrieve historical data for specified symbols. Args: symbols: Single ticker or list of tickers to get history for start_date: Start date in YYYY-MM-DD format end_date: End date in YYYY-MM-DD format resolution: Data resolution (Minute, Hour, Daily) instance_name: QuantBook instance name fields: Specific fields to return (open, high, low, close, volume) Returns: Dictionary containing historical data
add_alternative_data
Add alternative data source to a security. Args: data_type: Type of alternative data (e.g., "SmartInsiderTransaction") symbol: Symbol to add alternative data for instance_name: QuantBook instance name Returns: Dictionary containing alternative data subscription info
get_alternative_data_history
Retrieve historical alternative data. Args: data_type: Type of alternative data symbols: Symbol(s) to get alternative data for start_date: Start date in YYYY-MM-DD format end_date: End date in YYYY-MM-DD format instance_name: QuantBook instance name Returns: Dictionary containing alternative data history
perform_pca_analysis
Perform Principal Component Analysis on historical returns. Args: symbols: List of symbols to analyze start_date: Start date in YYYY-MM-DD format end_date: End date in YYYY-MM-DD format n_components: Number of components to compute (default: all) instance_name: QuantBook instance name Returns: Dictionary containing PCA results
test_cointegration
Perform Engle-Granger cointegration test between two assets. Args: symbol1: First symbol for cointegration test symbol2: Second symbol for cointegration test start_date: Start date in YYYY-MM-DD format end_date: End date in YYYY-MM-DD format trend: Trend specification ('c' for constant, 'ct' for constant+trend) lags: Number of lags to include instance_name: QuantBook instance name Returns: Dictionary containing cointegration test results
analyze_mean_reversion
Analyze mean reversion signals for given symbols. Args: symbols: List of symbols to analyze start_date: Start date in YYYY-MM-DD format end_date: End date in YYYY-MM-DD format lookback_period: Lookback period for moving average and std instance_name: QuantBook instance name Returns: Dictionary containing mean reversion analysis results
calculate_correlation_matrix
Calculate correlation matrix for given symbols. Args: symbols: List of symbols to analyze start_date: Start date in YYYY-MM-DD format end_date: End date in YYYY-MM-DD format instance_name: QuantBook instance name Returns: Dictionary containing correlation matrix and statistics
sparse_optimization
Perform sparse optimization algorithm with Huber Downward Risk minimization. Args: portfolio_symbols: List of symbols for the portfolio benchmark_symbol: Benchmark symbol to track start_date: Start date in YYYY-MM-DD format end_date: End date in YYYY-MM-DD format max_iterations: Maximum iterations for optimization tolerance: Convergence tolerance max_weight: Maximum weight per asset penalty_param: Penalty parameter (p) huber_param: Huber statistics M-value lambda_param: Penalty weight (l) instance_name: QuantBook instance name Returns: Dictionary containing optimized portfolio weights and performance
calculate_portfolio_performance
Calculate portfolio performance metrics for given weights. Args: symbols: List of portfolio symbols weights: List of weights corresponding to symbols start_date: Start date in YYYY-MM-DD format end_date: End date in YYYY-MM-DD format benchmark_symbol: Optional benchmark for comparison instance_name: QuantBook instance name Returns: Dictionary containing portfolio performance metrics
optimize_equal_weight_portfolio
Create and analyze an equal-weight portfolio with rebalancing. Args: symbols: List of symbols for the portfolio start_date: Start date in YYYY-MM-DD format end_date: End date in YYYY-MM-DD format rebalance_frequency: Rebalancing frequency (daily, weekly, monthly, quarterly) instance_name: QuantBook instance name Returns: Dictionary containing equal-weight portfolio analysis
get_etf_constituents
Get ETF constituents for a specific date using ETF universe data. Args: etf_ticker: ETF ticker symbol (e.g., "QQQ", "SPY") date: Date in YYYY-MM-DD format to get constituents for instance_name: QuantBook instance name Returns: Dictionary containing ETF constituent information
add_etf_universe_securities
Add all ETF constituent securities to the QuantBook instance. Args: etf_ticker: ETF ticker symbol date: Date in YYYY-MM-DD format to get constituents for resolution: Data resolution (Minute, Hour, Daily) instance_name: QuantBook instance name Returns: Dictionary containing results of adding securities
select_uncorrelated_assets
Select uncorrelated or highly correlated assets from a universe. Args: symbols: List of symbols to analyze start_date: Start date in YYYY-MM-DD format end_date: End date in YYYY-MM-DD format num_assets: Number of assets to select method: Selection method ("lowest_correlation", "highest_correlation") instance_name: QuantBook instance name Returns: Dictionary containing selected assets and correlation analysis
screen_assets_by_criteria
Screen assets based on various performance and risk criteria. Args: symbols: List of symbols to screen start_date: Start date in YYYY-MM-DD format end_date: End date in YYYY-MM-DD format min_return: Minimum annualized return threshold max_volatility: Maximum annualized volatility threshold min_sharpe: Minimum Sharpe ratio threshold max_correlation: Maximum correlation with benchmark threshold benchmark_symbol: Optional benchmark symbol for correlation screening instance_name: QuantBook instance name Returns: Dictionary containing screened assets and their metrics

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/taylorwilsdon/quantconnect-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server