AI Ready
Point an AI at your own backtests.
StrategyLens can be driven directly by an AI assistant — Claude, or any other MCP-compatible client — computing real metrics from the MT5 reports already on your machine. The report files themselves stay on your machine.
Report files are read from disk by a local process and never uploaded anywhere. Parsing and every metric computation run in your own Node process, using the same engine that powers the web app. The computed results — metrics, trade rows, symbols, strategy names — are returned to your MCP client, which forwards them to whichever model it is configured with. If that model is cloud-hosted, those results are sent to it, the same as any other tool call. Only a fully local model keeps everything on-device.
How to connect
Add the server to your MCP client’s configuration using @latest so it always resolves to the current release. Note: a floating version can change engine behavior between sessions — if you need to compare two runs made days apart with guaranteed-identical results, pin an exact version instead and update it deliberately.
{
"mcpServers": {
"strategy-lens": {
"command": "cmd",
"args": ["/c", "npx", "-y", "@trendsurfers/strategy-lens-mcp@latest", "C:/MT5Reports"]
}
}
}{
"mcpServers": {
"strategy-lens": {
"command": "npx",
"args": ["-y", "@trendsurfers/strategy-lens-mcp@latest", "/Users/you/MT5Reports"]
}
}
}"command": "npx" on its own fails silently. npx is actually npx.cmd, and Windows will not spawn a .cmdfile directly the way it spawns a real executable — the client reports no useful error, the server just never starts. Always route through cmd /c as shown above.Every argument after @trendsurfers/strategy-lens-mcp@latest is a folder the server is allowed to read reports from — pass one or more absolute paths, one per MT5 terminal’s Reports folder or wherever you keep exported reports. The server refuses to start if none of the folders you pass exist and are readable — there is no tool that lets the model widen this list itself; you set the boundary, once, at startup. Node 20 or later must be on PATH for whatever process launches your MCP client — a GUI-launched client does not always inherit your shell’s PATH.
The 15 tools
- sl_list_allowed_roots
- Lists the folders this server may read, with their short aliases. Call this first when no report id is known yet.
- sl_list_reports
- Lists parseable report files inside an allowed folder, paginated. Cheap — does not parse.
- sl_analyze_reports
- Computes StrategyLens metrics for one or more reports, ranked by whichever metric you choose. Use sections to get everything the Overview page shows — EA name, timeframe, tested period, broker, yearly stats, per-strategy rankings, holding times and risk. Select historical trades by symbol or entry/exit comment with the shared trade filter.
- sl_analyze_portfolio
- Combines reports into a hypothetical portfolio with pooled, single-account or weighted capital. Returns profit, return/drawdown (Ret/DD), profit factor, Sharpe, SQN, stagnation and more, alongside correlation and diversification measures.
- sl_compare_portfolios
- Compares exact report allocations, such as 60/40 versus 40/60, against a baseline. Returns full portfolio metrics and the change in each metric for every scenario.
- sl_analyze_portfolio_contributions
- Shows each report’s allocated profit and what happens to portfolio performance when it is removed. Remaining weights are redistributed proportionally for the removal comparison.
- sl_search_portfolios
- Searches report combinations and allocation weights by Ret/DD, with weight locks, caps and strategy-count limits. Checks small feasible grids exhaustively and uses a reproducible, budgeted search for larger spaces; reports the coverage achieved.
- sl_compare_trades
- Matches executions between two reports to investigate trade overlap and timing differences, with explicit matching tolerances.
- sl_discover_trade_groups
- Lists symbols and opening or closing comments, with trade counts and attribution uncertainty. Returns reusable filters so an assistant can investigate candidate strategies within an EA.
- sl_analyze_regimes
- Compares a strategy or hypothetical portfolio across nine trend/volatility groups using supplied local OHLC price history. Uses completed bars available at trade entry, ranks eligible groups by Ret/DD and reports missing or uncertain coverage.
- sl_get_trades
- Returns individual, filtered, paginated trade rows from one report — the escape hatch for trade-level detail.
- sl_get_equity_curve
- Returns a downsampled equity series (single report or pooled) for reasoning about the shape of performance over time.
- sl_what_if
- Tests a trade-filter scenario — skip certain hours, days, one direction, or trades that follow a losing streak — against one report’s real trades and recomputes the statistics, without re-running the backtest. A fast way to see where a strategy is bleeding before changing an EA input.
- sl_simulate_sizing
- Replays the same historical trades under a different position-sizing scheme — for example, risking a fixed percentage of balance per trade — and returns the resized balance curve, return, and drawdown. Explore sizing ideas without running a fresh backtest for every guess.
- sl_monte_carlo
- Runs a Monte Carlo robustness check: reshuffles the trade sequence many times and returns the range of possible outcomes — percentiles, the median result, and the probability of ruin. Reproducible — the same seed always gives the same numbers.
What it can do
- Rank every backtest in a folder by profit factor, Sharpe, or drawdown before opening a single report by hand.
- Combine HTML backtests into a hypothetical portfolio with full metrics, then fine-tune the allocation of each report.
- Compare allocation scenarios, measure the effect of removing a report, or search combinations and weights by return/drawdown.
- Discover an EA’s entry comments, then compare historical performance for a selected comment or symbol using the same analysis tools.
- Use your local OHLC price files to compare performance in rising, falling or ranging markets, each split by low, normal or high volatility.
- Compare executions from two reports to investigate overlapping trades and timing differences.
- Pull the trades or equity curve for one report to answer a specific question — a losing streak, a symbol filter, a date range.
- See the full identity of each report — which EA produced it, on what timeframe, over what tested period, at what broker, and with what data quality.
- Break down performance by year, by month, by direction (long vs short), or by strategy in a multi-strategy portfolio.
- Analyse a live account statement with deposits, withdrawals, and net gain — not just backtests.
- Test a "skip Fridays" or "long-only" scenario, or try a different risk-per-trade size, and see the recomputed results instantly — no new backtest required.
- Explore sensitivity to trade order with a reproducible Monte Carlo robustness check. Simulated outcome ranges are not forecasts.
Portfolio and filtered-trade results are hypothetical replays of historical closes, not new EA backtests. Weights apply per report, and original trade sizing is retained unless you request a sizing simulation. Ambiguous opening comments require explicit opt-in to a labelled FIFO estimate; a comment is not proof of a separate strategy. Regime analysis needs local OHLC files with aligned clocks and a declared bar duration. Missing history or uncertain entries remain unknown. These results cannot reconstruct combined floating-equity drawdown or portfolio margin, and past regime performance is not a forecast.
Security posture
This server takes report identifiers from an AI and returns file contents derived from them to it, so it is worth being precise about what is and is not protected.
Bounded
- Path containment. every report id resolves to a path validated against the folders you allowed, using real path comparison, after resolving symlinks.
- No runtime privilege escalation. allowed folders are fixed at launch from the arguments you pass. No tool lets the model add a folder to the allowlist; that boundary is set by you, once, at startup.
- Free text is length-capped and stripped. comments, EA/strategy names, symbols and similar free text are capped in length, and control characters, ANSI escape sequences, and invisible/bidirectional Unicode characters are stripped before they can reach a tool result.
- Read-only, no network. no tool writes, deletes, or modifies any file. The server makes no outbound network calls.
Not bounded — stated honestly
What is not bounded, and not claimed to be: the semantic content of report text. A report comment can say something like "ignore previous instructions" in plain, unremarkable English — no automated filter can distinguish that from a legitimate note left by a trader or EA vendor. There is no complete technical fix for this class of risk. The server’s instructions tell the connected model to treat everything read out of a report as data, never as a directive — but that is guidance to the model, not an enforced control.
Works alongside Portfolio Manager
If you also use a backtest-running tool, the handoff between the two is just a file path: point that tool’s report output folder at one of the folders you allowed here, and it hands back the report’s location once a run completes. Pass that path straight to any tool on this page. This server never imports, detects, or requires that other tool; the two communicate only through files on disk.
An MCP server for TrendSurfers Portfolio Manager is in development. The same file-path handoff will apply — nothing on this page needs to change when it arrives.