Feature Request: Expose Backtest Results as MCP Resources
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
Research direction
Start by tracing the existing read_backtest, read_backtest_orders, read_backtest_chart, and related Tool implementations to understand their API integration. Read the MCP Resources specification alongside the proposed qc:// URI patterns and capability declarations. Done means resources can be discovered and selectively read for the proposed backtest data while existing Tools remain unchanged.
Written by the indexing model from the issue text.
Description
Feature Request: Expose Backtest Results as MCP Resources
Summary
Expose backtest (and live algorithm) results as MCP Resources in addition to the existing Tools, enabling application-controlled, lazy-loaded access to result data via URIs.
Motivation
The current MCP server provides excellent Tool-based access to backtest results via read_backtest, read_backtest_chart, read_backtest_orders, etc. These work well but have a limitation in LLM-driven workflows: Tools return full JSON responses directly into the context window, which can be problematic for large backtests with extensive order histories or chart data.
The MCP specification explicitly distinguishes between:
- Tools: Model-controlled, data returned inline, ideal for actions and small responses
- Resources: Application-controlled, lazy-loaded via URI, ideal for "large reference materials that shouldn't be automatically loaded but should be available on demand"
Backtest results fit the Resource pattern well. A multi-year backtest might generate thousands of orders, megabytes of chart data, and extensive logs—but an LLM workflow often only needs specific slices of this data at any given time.
Proposed Design
Current Flow (Tools only)
create_backtest → backtestId
read_backtest → full JSON in context
read_backtest_orders → full order list in context
Proposed Flow (Resources + Tools)
create_backtest → backtestId
# Resources become discoverable:
resources/list → [
qc://backtest/{id}/summary,
qc://backtest/{id}/orders,
qc://backtest/{id}/chart,
...
]
# User/client selects which to load:
resources/read(uri) → only requested data fetched
Suggested Resource URIs
Using a custom qc:// URI scheme per RFC 3986:
| Resource | URI Pattern | Description |
|---|---|---|
| Summary | qc://backtest/{id}/summary |
High-level stats: Sharpe, drawdown, total trades, net P&L, CAGR |
| Orders | qc://backtest/{id}/orders |
Full order history (paginated via query params if needed) |
| Chart | qc://backtest/{id}/chart/{name} |
Specific chart data series (e.g., "Strategy Equity") |
| Logs | qc://backtest/{id}/logs |
Algorithm debug/info logs |
| Insights | qc://backtest/{id}/insights |
Alpha model insights (if applicable) |
| Errors | qc://backtest/{id}/errors |
Runtime errors and stack traces |
The same pattern could extend to live algorithms:
| Resource | URI Pattern |
|---|---|
| Portfolio | qc://live/{projectId}/portfolio |
| Orders | qc://live/{projectId}/orders |
| Logs | qc://live/{projectId}/logs |
Resource Templates
Per the MCP spec, these could be exposed as resource templates for dynamic discovery:
{
"resourceTemplates": [
{
"uriTemplate": "qc://backtest/{backtestId}/summary",
"name": "Backtest Summary",
"description": "High-level performance statistics for a backtest",
"mimeType": "application/json"
},
{
"uriTemplate": "qc://backtest/{backtestId}/orders",
"name": "Backtest Orders",
"description": "Complete order history from a backtest",
"mimeType": "application/json"
}
]
}
Capability Declaration
{
"capabilities": {
"resources": {
"subscribe": true,
"listChanged": true
}
}
}
The listChanged capability would allow the server to notify clients when new backtests complete, making resources available dynamically.
Benefits
-
Context window efficiency: LLMs can request only what they need (e.g., just the summary to decide if orders are worth examining)
-
Client-controlled loading: Host applications (Claude Desktop, custom agents) can present resources in a picker UI, letting users decide what context to include
-
Progressive disclosure: Start with summary → drill into orders if needed → examine specific chart if anomalies detected
-
Subscription support: Clients could subscribe to live algorithm resources for real-time updates during trading
-
Spec alignment: Follows MCP's intended separation between model-controlled actions (Tools) and application-controlled context (Resources)
Backwards Compatibility
This is purely additive—existing Tools would continue to work unchanged. Resources provide an alternative access pattern for clients that support them.
Implementation Notes
The existing Tool implementations (read_backtest, read_backtest_orders, etc.) already contain the API integration logic. Resources would largely wrap the same underlying API calls, just exposed through the Resources protocol instead of Tools.
References
- Dominant language
- Python
- Stars
- 77
- Forks
- 33
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from QuantConnect/mcp-server
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
QuantConnect/mcp-server#56 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
QuantConnect/mcp-server#51 · 2 comments ·
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 45/100
QuantConnect/mcp-server#58 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 65/100
QuantConnect/mcp-server#57 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
QuantConnect/mcp-server#55 ·
All issues in QuantConnect/mcp-server
Similar issues
-
area/auth bug comp/agent P3 platform/discord type/security
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
NousResearch/hermes-agent#117848 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
bancolombia/sentinel#23 ·
-
test md OpenCI
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
langchain-ai/deepagents#6450 ·
-
bug client
Difficulty 2/5 1-3 hours Newbie friendliness 88/100