
MT5-Quant
io.github.masdevidPublished by GitHub account masdevidv1.34.3Updated Oct 24, 2026
MT5 strategy development with 87 tools. Backtest, optimize, debug MQL5 EAs on macOS/Linux.
Overview
Local MCP server that lets an assistant compile, backtest, optimize and analyze MQL5 Expert Advisors for MetaTrader 5 on macOS or Linux.
- What you can do
- Compile, list and search MQL5 experts, indicators and scripts, and scaffold new projects
- Run backtests and genetic optimizations, poll job status and compare results against a baseline
- Analyze reports and individual deals: monthly P/L, drawdowns, streaks, hold time, costs, volume and layer performance
- Search, archive, annotate and export backtest reports and history, and prune old report directories
- Read, write, patch, diff and generate .set parameter files
- Diagnose Wine, MT5 logs, processes and system resources, and manage the tester cache
- When to use it
- Useful when you develop or tune MetaTrader 5 Expert Advisors on macOS or Linux and want an assistant to run the compile-backtest-analyze loop and dig into deal-level results without a Windows machine.
- Requirements
- Runs as a local binary on macOS or Linux, installed via Cargo or a pre-built release archive and placed on PATH; a setup script detects Wine and MT5 paths. Needs a Wine-based MetaTrader 5 installation with MetaEditor and terminal data. Optional MT5_MCP_HOME environment variable sets the config directory.
Installation
In SourceWeft
- Open MT5-Quant in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
README
MT5-Quant
[OpenSSF Scorecard] [CII Best Practices] [Rust CI] [crates.io] [License: MIT] [CodeQL]
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.
Why MT5-Quant
Focus: Backtest organization, reporting, and analytics — capabilities MT5 itself doesn't provide.
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)
Option B — Pre-built binaries (no toolchain)
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 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."
First Backtest
The AI runs the full pipeline: compile → clean cache → backtest → extract → analyze.
MCP Tools (89)
Core workflow
Granular Analytics (individual analysis)
Use these for targeted analysis, or analyze_report to run all at once.
Deal-Level Analytics (New)
Monitoring
Reports & logs
History & baseline
Cache management
Pre-flight & Validation
Debugging & Diagnostics (New)
Project Management
History & Comparison
.set file — read / write
.set file — analysis & generation
Search & Discovery
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
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
Source: README.md at commit 62987f0
Tools
0Version history
1- v1.34.3LatestSep 16, 2026
Score
50% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts