MCP server for MT5 strategy development. Compile, backtest, analyze MQL5 EAs on macOS/Linux.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
π‘ Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
MCP server for MT5 strategy development on macOS/Linux. 89 tools to compile, backtest, analyze, optimize, debug crashes, and manage MQL5 Expert Advisors β no Windows required.
Focus: Backtest organization, reporting, and analytics β capabilities MT5 itself doesn't provide.
| MT5-Quant | Others | |
|---|---|---|
| Platform | macOS/Linux native | Windows only |
| Backtest pipeline | β Full (compile β run β analyze) | β Via MT5 Python package |
| Deal-level analytics | β 19 dimensions, DB-backed | β |
| Report organization | β SQLite (reports + deals) + search + history | β |
| MQL5 compilation | β Headless (MetaEditor via Wine, no GUI) | β οΈ Via GUI or terminal |
| Optimization | β Background + results parsing + .set generation | β οΈ Terminal only, no parsing |
| Crash debugging | β Wine/MT5 diagnostics | β |
Others typically run on Windows using the MetaTrader5 Python package, providing full terminal operations. MT5-Quant fills the gap: organizing backtest reports, extracting deal-level insights, and managing optimization workflows β none of which MT5 or its Python API expose natively.
Move the binary somewhere on your PATH (e.g. /usr/local/bin or ~/.local/bin) so clients can launch it as mt5-quant.
Claude Code
Claude Desktop β ~/Library/Application Support/Claude/claude_desktop_config.json
Cursor β .cursor/mcp.json (same JSON shape as Claude Desktop)
opencode β .opencode/opencode.jsonc
Codex CLI β ~/.codex/config.toml
Then finish setup (auto-detects Wine + MT5 paths):
Tip: you can also just ask your LLM coding agent to do all of the above: "Please install mt5-quant from https://github.com/masdevid/mt5-quant β download or build it, run its
scripts/setup.shto auto-detect Wine and MT5 paths, and register it as an MCP server."
The AI runs the full pipeline: compile β clean cache β backtest β extract β analyze.
| Tool | Description |
|---|---|
run_backtest | Full pipeline: compile β clean β backtest β extract β analyze |
run_backtest_quick | Quick backtest using pre-compiled EA (skip compile) |
run_backtest_only | Backtest only - just extract raw trades, no analysis |
launch_backtest | Fire-and-forget: launch MT5 backtest, poll for completion |
get_backtest_status | Poll running backtest status (MT5 running, report found, elapsed time) |
run_optimization | Genetic optimization (background, returns immediately) |
get_optimization_results | Parse optimization results after MT5 finishes |
list_jobs | List all optimization jobs with status |
analyze_report | Read analysis.json from any report directory |
compare_baseline | Compare report vs baseline, return winner/loser verdict |
compile_ea | Compile MQL5 EA via MetaEditor |
list_experts | List all EAs in MQL5/Experts directory |
list_indicators | List all indicators in MQL5/Indicators directory |
list_scripts | List all scripts in MQL5/Scripts directory |
healthcheck | Quick server health check |
list_symbols | List all available symbols in MT5 terminal |
| Tool | Description |
|---|---|
analyze_monthly_pnl | Monthly P/L breakdown only |
analyze_drawdown_events | Drawdown events and causes only |
analyze_top_losses | Worst losing deals only |
analyze_loss_sequences | Consecutive loss patterns only |
analyze_position_pairs | Position hold time and P/L pairs |
analyze_direction_bias | Buy vs Sell performance |
analyze_streaks | Win/loss streak analysis |
analyze_concurrent_peak | Peak simultaneous positions |
Use these for targeted analysis, or analyze_report to run all at once.
| Tool | Description |
|---|---|
list_deals | List individual deals with filters (type, profit range, volume, dates) |
search_deals_by_comment | Full-text search in deal comments (e.g., "Layer #3") |
search_deals_by_magic | Filter deals by EA magic number |
analyze_profit_distribution | Profit histogram: small/medium/large wins and losses |
analyze_time_performance | Performance by hour of day and day of week |
analyze_hold_time_distribution | Hold time buckets + correlation with profit |
analyze_layer_performance | Grid/martingale layer analysis from comments |
analyze_volume_vs_profit | Volume correlation + performance by lot size |
analyze_costs | Commission and swap impact on profitability |
analyze_efficiency | Profit per hour/day, annualized return, trade frequency |
| Tool | Description |
|---|---|
verify_setup | Check Wine/MT5 paths, Wine version, and EA/set file counts |
get_optimization_status | Check live state of a background optimization job |
list_jobs | All optimization jobs with compact status in one call |
| Tool | Description |
|---|---|
list_reports | Compact table of all runs with key metrics β no full analysis needed |
get_latest_report | Get most recent report with optional equity chart |
search_reports | Find reports by EA, symbol, date range, or profit criteria |
get_report_by_id | Get specific report by ID with equity chart |
get_reports_summary | Aggregate stats: counts, averages, pass rates |
get_best_reports | Top N reports sorted by any metric (profit factor, drawdown, etc.) |
search_reports_by_tags | Find reports by tags |
search_reports_by_date_range | Query by backtest date range |
search_reports_by_notes | Full-text search in report notes |
get_reports_by_set_file | Find all reports using a specific .set file |
get_comparable_reports | Find comparable reports (same EA/symbol/timeframe) |
tail_log | Read last N lines of any log; filter=errors to see only failures |
prune_reports | Delete old report directories, keep last N (skips _opt dirs) |
promote_to_baseline | Write a history entry or report to baseline.json for compare_baseline |
| Tool | Description |
|---|---|
archive_report | Convert one report dir β compact JSON entry in backtest_history.json, optionally delete source |
archive_all_reports | Bulk-archive all report dirs then optionally delete them; keeps N newest safe |
get_history | Query history with filters (EA, symbol, verdict, profit, DD) and sort options |
annotate_history | Attach verdict / notes / tags to any history entry |
| Tool | Description |
|---|---|
cache_status | MT5 tester cache size breakdown by symbol β check before cleaning |
clean_cache | Delete tester cache files; supports per-symbol and dry_run |
| Tool | Description |
|---|---|
get_active_account | Get current MT5 account session (login, server, available symbols) |
check_symbol_data_status | Validate symbol has sufficient history data for date range |
check_mt5_status | Check if MT5 terminal is installed and ready |
validate_ea_syntax | Pre-compile syntax check without running full compilation |
No reviews yet β be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/mt5-quant)<a href="https://allmcps.com/mcp/mt5-quant"><img src="https://allmcps.com/api/badge/mt5-quant?style=directory" alt="MT5 Quant on AllMCPs" /></a>