
开源MCP服务器用于MetaTrader 5的回测、优化和分析——纯粹的Rust
概览
89个工具用于编译、回测、分析、优化、调试崩溃和管理MQL5专家顾问——无需Windows。 回测组织、报告和分析——这些是MT5本身不具备的功能。 通常在Windows上运行,使用MetaTrader5的Python包,提供完整的终端操作。MT5-Quant填补了这一空白:MT5及其Python API本身都没有这些漏洞。 把二进制文件移到你的 PATH 上某个地方(例如 /usr/local/bin 或 ~/.local/bin),这样客户端可以以 mt5-quant 启动它。 — ~/库/应用支持/Claude/claude_desktop_config.json — .cursor/mcp.json(与Claude Desktop相同的JSON格式) 然后完成设置(自动检测Wine + MT5路径): 你也可以直接要求你的LLM编码代理完成上述所有操作:“请从https://github.com/masdevid/mt5-quant安装mt5-quant——下载或构建,运行其脚本/setup.sh 自动检测Wine和MT5路径,并注册为MCP服务器。”
概述(AI 翻译)
macOS/Linux上的MT5战略开发MCP服务器。 89 个工具用于编译、回测、分析、优化、调试崩溃和管理MQL5专家顾问——无需Windows。
为什么是MT5量化
重点: 回测组织、报告和分析——MT5本身不具备的功能。
| MT5-量化 | 其他 | |
|---|---|---|
| 平台macOS/Linux 原生 | 仅限 Windows | |
| 回测流水线 | ✅完整(编译→运行→分析) | ✅通过MT5 Python包 |
| 交易层级分析✅ 19维度,DB支持 | ❌ | |
| 报告组织 | ✅ SQLite(报告+优惠)+搜索+历史 | ❌ |
| MQL5 合集 | ✅无头(通过 Wine MetaEditor,无 GUI) | ⚠️通过 GUI 或终端 |
| 优化✅背景 + 结果解析 + .set 生成 | ⚠️仅终端,无解析 | |
| 崩溃调试 | ✅ Wine/MT5 诊断 | ❌ |
其他软件通常在Windows上运行,使用MetaTrader5 Python包,提供完整的终端操作。MT5-Quant填补了这一空白:组织回测报告、提取交易层级洞察和管理优化工作流程——这些MT5及其Python API都不原生支持。
快速启动
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
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
安装
This server does not publish a one-line install command.
Open the repository installation guide 新手?先看 mcpskill.org 教程 →配置
{ "mcpServers": { "mt5-quant": { "command": "mt5-quant", "args": ["--stdio"] } } }