MT5-Quant MCP server
2026년 11월 11일 커밋macOS 및 Linux 환경에서 MQL5 Expert Advisor의 컴파일, 백테스트, 최적화 및 상세 딜 레벨 분석을 AI 클라이언트를 통해 수행할 수 있습니다.
다른 이름 masdevid/mt5-quant
- 스타
- 52
- Tools
- 89
- 다운로드, 30일
- —
- 최신 버전
- 1.34.3
- 마지막 커밋
- 2026년 11월 11일
- 라이선스
- MIT
MT5-Quant MCP란?
MT5-Quant은(는) MCP server입니다. macOS 및 Linux 환경에서 MQL5 Expert Advisor의 컴파일, 백테스트, 최적화 및 상세 딜 레벨 분석을 AI 클라이언트를 통해 수행할 수 있습니다. 89개 도구를 제공합니다. 예: run_backtest, run_backtest_quick, run_backtest_only.
프로젝트 README에서 생성된 요약
MT5-Quant MCP server 정보
MT5-Quant는 macOS 및 Linux 시스템에서 MQL5 Expert Advisor를 개발하기 위한 특화된 환경을 제공합니다. 개발자는 Wine을 통해 headless MetaEditor를 사용함으로써 기존의 Windows 필수 요구 사항을 우회하여 트레이딩 전략을 컴파일, 백테스트 및 최적화할 수 있습니다. 이 서버는 AI 클라이언트를 위한 브릿지 역할을 하며, 89개의 개별 도구를 통해 퀀트 개발 라이프사이클 전체를 관리할 수 있도록 지원합니다.
사용자는 코드 컴파일, 캐시 정리, 백테스트 실행 및 심층 분석을 포함하는 전체 파이프라인을 실행할 수 있습니다. 표준 Python 패키지와 달리, 이 서버는 SQLite 백엔드를 사용하여 고급 딜 레벨 인사이트와 체계적인 보고서 관리를 제공합니다. 또한 백그라운드에서 유전 최적화를 지원하며, 크래시를 디버깅하거나 Wine 또는 MT5 터미널 로그를 조사하기 위한 전용 진단 도구를 제공합니다. 이를 통해 Windows가 아닌 하드웨어에서 구조화된 백테스트 히스토리, 파라미터 파일 관리 및 세밀한 성능 지표가 필요한 트레이더에게 전용 솔루션을 제공합니다.
활용 사례
- 1자동 백테스트 파이프라인특정 날짜 범위를 대상으로 코드 컴파일부터 최종 성능 분석까지의 전체 워크플로우를 실행합니다.
프로젝트의 README를 바탕으로 작성되었습니다. 모든 활용 사례는 해당 내용의 인용문과 대조하여 확인합니다.
MT5-Quant MCP 도구 89
README에서 감지됨run_backtestrun_backtest_quickrun_backtest_onlylaunch_backtestget_backtest_statusrun_optimizationget_optimization_resultslist_jobsanalyze_reportcompare_baselinecompile_ealist_experts
| run_backtest | — | |
| run_backtest_quick | — | |
| run_backtest_only | — | |
| launch_backtest | — | |
| get_backtest_status | — | |
| run_optimization | — | |
| get_optimization_results | — | |
| list_jobs | — | |
| analyze_report | — | |
| compare_baseline | — | |
| compile_ea | — | |
| list_experts | — |
도구 89개 모두 보기도구 수 줄이기
list_indicatorslist_scriptshealthchecklist_symbolsanalyze_monthly_pnlanalyze_drawdown_eventsanalyze_top_lossesanalyze_loss_sequencesanalyze_position_pairsanalyze_direction_biasanalyze_streaksanalyze_concurrent_peaklist_dealssearch_deals_by_commentsearch_deals_by_magicanalyze_profit_distributionanalyze_time_performanceanalyze_hold_time_distributionanalyze_layer_performanceanalyze_volume_vs_profitanalyze_costsanalyze_efficiencyverify_setupget_optimization_statuslist_reportsget_latest_reportsearch_reportsget_report_by_idget_reports_summaryget_best_reportssearch_reports_by_tagssearch_reports_by_date_rangesearch_reports_by_notesget_reports_by_set_fileget_comparable_reportstail_logprune_reportspromote_to_baselinearchive_reportarchive_all_reportsget_historyannotate_historycache_statusclean_cacheget_active_accountcheck_symbol_data_statuscheck_mt5_statusvalidate_ea_syntaxdiagnose_wineget_mt5_logssearch_mt5_errorscheck_mt5_processkill_mt5_processcheck_system_resourcesvalidate_mt5_configget_wine_prefix_infoget_backtest_crash_infocheck_updateupdateinit_projectcreate_set_templateexport_reportget_backtest_historycompare_backtestslist_set_filesread_set_filewrite_set_filepatch_set_fileclone_set_filedescribe_sweepdiff_set_filesset_from_optimizationsearch_expertssearch_indicatorssearch_scriptscopy_indicator_to_projectcopy_script_to_project
| list_indicators | — | |
| list_scripts | — | |
| healthcheck | — | |
| list_symbols | — | |
| analyze_monthly_pnl | — | |
| analyze_drawdown_events | — | |
| analyze_top_losses | — | |
| analyze_loss_sequences | — | |
| analyze_position_pairs | — | |
| analyze_direction_bias | — | |
| analyze_streaks | — | |
| analyze_concurrent_peak | — | |
| list_deals | — | |
| search_deals_by_comment | — | |
| search_deals_by_magic | — | |
| analyze_profit_distribution | — | |
| analyze_time_performance | — | |
| analyze_hold_time_distribution | — | |
| analyze_layer_performance | — | |
| analyze_volume_vs_profit | — | |
| analyze_costs | — | |
| analyze_efficiency | — | |
| verify_setup | — | |
| get_optimization_status | — | |
| list_reports | — | |
| get_latest_report | — | |
| search_reports | — | |
| get_report_by_id | — | |
| get_reports_summary | — | |
| get_best_reports | — | |
| search_reports_by_tags | — | |
| search_reports_by_date_range | — | |
| search_reports_by_notes | — | |
| get_reports_by_set_file | — | |
| get_comparable_reports | — | |
| tail_log | — | |
| prune_reports | — | |
| promote_to_baseline | — | |
| archive_report | — | |
| archive_all_reports | — | |
| get_history | — | |
| annotate_history | — | |
| cache_status | — | |
| clean_cache | — | |
| get_active_account | — | |
| check_symbol_data_status | — | |
| check_mt5_status | — | |
| validate_ea_syntax | — | |
| diagnose_wine | — | |
| get_mt5_logs | — | |
| search_mt5_errors | — | |
| check_mt5_process | — | |
| kill_mt5_process | — | |
| check_system_resources | — | |
| validate_mt5_config | — | |
| get_wine_prefix_info | — | |
| get_backtest_crash_info | — | |
| check_update | — | |
| update | — | |
| init_project | — | |
| create_set_template | — | |
| export_report | — | |
| get_backtest_history | — | |
| compare_backtests | — | |
| list_set_files | — | |
| read_set_file | — | |
| write_set_file | — | |
| patch_set_file | — | |
| clone_set_file | — | |
| describe_sweep | — | |
| diff_set_files | — | |
| set_from_optimization | — | |
| search_experts | — | |
| search_indicators | — | |
| search_scripts | — | |
| copy_indicator_to_project | — | |
| copy_script_to_project | — |
구성
MT5_MCP_HOMEPath to MT5-Quant config directory (default: ~/.config/mt5-quant)
| 이름 | 설명 | 유형 |
|---|---|---|
| MT5_MCP_HOME | Path to MT5-Quant config directory (default: ~/.config/mt5-quant) |
자동 검사
2026년 11월 12일에 실행됨전체 보고서 →아직 인증되지 않았습니다. 서버는 80점 이상의 점수, 심각한 결함 없음, 그리고 검사에 충분한 데이터를 갖추어야 합니다. 검사 방식 · 점수를 높이기 위해 수정할 항목
- 소스 저장소 연결 및 접근 가능통과
- 오픈 소스 라이선스 (OSI)통과
- 최근 1년 내 커밋 또는 릴리스통과
- 패키지 이름이 인기 패키지와 유사하지 않음검사되지 않음
- 원격 엔드포인트가 HTTPS 사용검사되지 않음
- 파괴적인 도구에 라벨 표시됨검사되지 않음
- 모델에 대한 숨겨진 지침 없음통과
- 패키지 및 해당 종속성에 중요한 보안 권고 없음검사되지 않음
README
GitHub에서 보기MT5-Quant
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.
You: "Backtest MyEA Jan-Mar, what caused the February drawdown?"
Claude: [compile → clean → backtest → analyze 1,847 deals]
→ Feb 14: BUY grid at L6, locking lot 1.75× base
→ Cutloss fired 17 points later
→ Recommendation: cap locking multiplier to ≤1.2×
Why MT5-Quant
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.
Quick Start
Install MT5-Quant
Option A — Cargo (recommended, needs Rust toolchain)
cargo install mt5-quant --locked
Option B — Pre-built binaries (no toolchain)
# macOS Apple Silicon
curl -LO https://github.com/masdevid/mt5-quant/releases/latest/download/mcp-mt5-quant-macos-arm64.tar.gz
tar xzf mcp-mt5-quant-macos-arm64.tar.gz # → mcp-mt5-quant-macos/mt5-quant
# Linux x64
curl -LO https://github.com/masdevid/mt5-quant/releases/latest/download/mcp-mt5-quant-linux-x64.tar.gz
tar xzf mcp-mt5-quant-linux-x64.tar.gz # → mcp-mt5-quant-linux/mt5-quant
Move the binary somewhere on your PATH (e.g. /usr/local/bin or ~/.local/bin) so clients can launch it as mt5-quant.
Option C — Register with your LLM client (copy-paste)
Claude Code
claude mcp add mt5-quant -- mt5-quant --stdio
Claude Desktop — ~/Library/Application Support/Claude/claude_desktop_config.json
{ "mcpServers": { "mt5-quant": { "command": "mt5-quant", "args": ["--stdio"] } } }
Cursor — .cursor/mcp.json (same JSON shape as Claude Desktop)
{ "mcpServers": { "mt5-quant": { "command": "mt5-quant", "args": ["--stdio"] } } }
opencode — .opencode/opencode.jsonc
{ "mcp": { "mt5-quant": { "type": "local", "command": ["mt5-quant", "--stdio"], "enabled": true } } }
Codex CLI — ~/.codex/config.toml
[mcp_servers.mt5-quant]
command = "mt5-quant"
args = ["--stdio"]
Then finish setup (auto-detects Wine + MT5 paths):
bash scripts/setup.sh
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."
First Backtest
Run a backtest on MyEA from 2025.01.01 to 2025.03.31
The AI runs the full pipeline: compile → clean cache → backtest → extract → analyze.
MCP Tools (89)
Core workflow
| 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 |
Granular Analytics (individual analysis)
| 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.
Deal-Level Analytics (New)
| 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 |
Monitoring
| 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 |
Reports & logs
| 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 |
History & 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 |
Cache management
| 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 |
Pre-flight & Validation
| 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 |
Debugging & Diagnostics (New)
| Tool | Description |
|---|---|
diagnose_wine |
Check Wine installation, version, and prefix health |
get_mt5_logs |
Get MT5 terminal, tester, or MetaEditor logs with filtering |
search_mt5_errors |
Search logs for error patterns (crash, exception, access violation) |
check_mt5_process |
Check if MT5 processes are running, get PID, CPU, memory usage |
kill_mt5_process |
Kill stuck MT5 processes (force=true for wineserver) |
check_system_resources |
Check disk space, memory, CPU availability |
validate_mt5_config |
Validate terminal.ini and tester configuration files |
get_wine_prefix_info |
Get Wine prefix details: Windows version, installed programs, registry |
get_backtest_crash_info |
Investigate backtest failures: incomplete markers, missing deals.csv, errors |
check_update |
Check if a newer version of MT5-Quant is available |
update |
Update MT5-Quant to latest release |
Project Management
| Tool | Description |
|---|---|
init_project |
Scaffold new MQL5 project with templates (scalper/swing/grid/basic) |
create_set_template |
Generate .set parameter file from EA input variables |
export_report |
Export backtest report to CSV, JSON, or Markdown |
History & Comparison
| Tool | Description |
|---|---|
get_backtest_history |
List all backtests for EA/symbol with summary metrics |
compare_backtests |
Compare 2+ backtest results side-by-side with analysis |
.set file — read / write
| Tool | Description |
|---|---|
list_set_files |
All .set files in tester profiles dir with sweep stats and combination counts |
read_set_file |
Parse UTF-16LE .set file → structured JSON params |
write_set_file |
Write full params dict → UTF-16LE .set with chmod 444 |
patch_set_file |
Update specific params in-place, return diff — replaces read→edit→write |
clone_set_file |
Copy .set to new path with optional overrides in one call |
.set file — analysis & generation
| Tool | Description |
|---|---|
describe_sweep |
Swept params, value counts, and total optimization combinations |
diff_set_files |
Side-by-side diff of two .set files — only changed params returned |
set_from_optimization |
Generate a clean backtest .set from get_optimization_results params; optionally narrow sweep |
Search & Discovery
| Tool | Description |
|---|---|
search_experts |
Search EAs by name pattern across all directories |
search_indicators |
Search indicators by name pattern |
search_scripts |
Search scripts by name pattern |
copy_indicator_to_project |
Copy indicator to project directory |
copy_script_to_project |
Copy script to project directory |
Full schema: docs/MCP_TOOLS.md
Troubleshooting
Run verify_setup from your LLM first — it checks all paths and returns actionable hints.
For crashes or unexplained failures during backtest/compile/optimization:
diagnose_wine— Check Wine installation and prefix healthsearch_mt5_errors— Find crash causes in logscheck_mt5_process+kill_mt5_process— Detect and kill stuck processesget_backtest_crash_info— Investigate failed backtest reports
Documentation
| Doc | Description |
|---|---|
| QUICKSTART | Step-by-step install, setup, and first backtest |
| MCP_TOOLS | Full input/output schemas for all 90 tools |
| CONFIG | Configuration reference (config/mt5-quant.yaml) |
| ARCHITECTURE | Design principles and internal module layout |
| REMOTE_AGENTS | Distribute optimization across Linux agents via Wine |
| TROUBLESHOOTING | Platform-specific fixes for Wine, MT5, and backtests |
Full index with reading order: docs/INDEX.md
Acknowledgements
MT5-Quant stands on the shoulders of exceptional open-source projects:
- Rust — The language that makes zero-cost abstractions, memory safety, and fearless concurrency practical
- Tokio — The async runtime powering all concurrent operations
- Wine — Making MT5 execution possible on macOS and Linux without Windows licensing
- MetaTrader 5 — MetaQuotes' trading platform (trademark of MetaQuotes Software Corp.)
- rusqlite — Ergonomic SQLite bindings for Rust
- serde — The serialization framework making config and report handling painless
- scraper — HTML parsing for MT5 report extraction
- tempfile — Secure temporary file handling
Special thanks to the Model Context Protocol (MCP) team at Anthropic for defining the standard that makes AI-powered development workflows possible.
Disclaimer
Not Financial Advice. MT5-Quant is a development and analysis tool for algorithmic trading strategies. It does not provide investment advice, trading recommendations, or guarantee profitability. All backtest results are historical simulations and do not guarantee future performance.
Use at Your Own Risk. Trading financial instruments carries substantial risk of loss. The authors and contributors of MT5-Quant accept no liability for:
- Trading losses incurred using strategies developed or tested with this tool
- Data loss or corruption from backtest operations
- Bugs, errors, or incorrect analysis results
- System crashes, Wine compatibility issues, or MT5 failures
Software Warranty. This software is provided "as-is" without warranty of any kind, express or implied, including but not limited to warranties of merchantability, fitness for a particular purpose, or non-infringement. See LICENSE for full terms.
Third-Party Software. MT5-Quant interacts with MetaTrader 5, Wine, and other third-party software. Users are responsible for complying with all applicable licenses and terms of service for these dependencies. MetaTrader is a trademark of MetaQuotes Software Corp. MT5-Quant is not affiliated with, endorsed by, or sponsored by MetaQuotes.
Regulatory Compliance. Users are responsible for ensuring their trading activities comply with applicable financial regulations in their jurisdiction. Automated trading may be restricted or require licensing in some regions.
License
MIT
MT5-Quant MCP 질문
MT5-Quant MCP는 어떤 도구를 제공하나요?
89개 도구를 제공합니다. 예: run_backtest, run_backtest_quick, run_backtest_only, launch_backtest, get_backtest_status.
macOS나 Linux에서 MT5-Quant를 사용할 수 있나요?
네, MT5-Quant는 macOS 및 Linux 네이티브 환경을 위해 설계되었으므로 Windows 없이도 MQL5 Expert Advisor를 관리할 수 있습니다.
표준 MetaTrader 5 Python 패키지와 MT5-Quant의 차이점은 무엇인가요?
MT5-Quant는 표준 Python 패키지나 MT5 자체에는 없는 체계적인 백테스트 보고서, 딜 레벨 분석, headless MQL5 컴파일과 같은 고급 기능을 제공합니다.
최적화 기능을 지원하나요?
네, 백그라운드에서 유전 알고리즘 최적화를 지원하며, 결과를 파싱하고 .set 파일을 생성하는 도구를 포함하고 있습니다.