
phuicmt/mcp-mt5
Developer tools이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요. 원문 보기
MCP server for MetaTrader 4/5 build pipeline (compile, deploy, backtest, parse reports)
개요
Compile MQL sources, deploy compiled EAs, run Strategy Tester, parse reports, tail logs — all driven by an LLM agent without touching the MetaTrader UI. an LLM agent edits .mq5 source → compiles → deploys → runs Strategy Tester → reads report → adjusts → repeats. No broker login, no human in the loop, no risk of real-money execution. For runtime trading, pair this with a live-trading MCP — they target different layers and compose well. 27 tools (plus 16 deprecated aliases until 0.6.0) and 2 resource templates. Every tool carries MCP annotations (read-only / destructive hints), a typed output schema and per-parameter descriptions; failures are reported as tool errors, never as a normal result with an error key. The pre-0.5.0 tool names still work in 0.5.x as thin wrappers whose descriptions start with DEPRECATED. Set MCP_MT5_LEGACY_TOOLS=0 to hide them and shrink the tool catalogue to the 27 tools above. Requires Windows + an installed MetaTrader 4 or 5 terminal.
README
원문 README의 일부입니다. 원문 보기.
mcp-mt5
Model Context Protocol server for the MetaTrader 4/5 build pipeline. Compile MQL sources, deploy compiled EAs, run Strategy Tester, parse reports, tail logs — all driven by an LLM agent without touching the MetaTrader UI.
What this is — and what it isn’t
| ✅ This server | ❌ Not this server |
|---|---|
| MetaTrader dev harness — compile, deploy, backtest, parse | Live trading (orders, positions, quotes) |
Wraps MetaEditor64.exe / terminal64.exe CLI directly |
Wraps the MetaTrader5 Python package |
| Runs entirely offline against installed terminal | Connects to a broker server |
| Iterates strategies before they go live | Executes strategies in production |
Use case: an LLM agent edits
.mq5source → compiles → deploys → runs Strategy Tester → reads report → adjusts → repeats. No broker login, no human in the loop, no risk of real-money execution.
For runtime trading, pair this with a live-trading MCP — they target different layers and compose well.
Tools
27 tools (plus 16 deprecated aliases until 0.6.0) and 2 resource templates. Every tool carries MCP annotations (read-only / destructive hints), a typed output schema and per-parameter descriptions; failures are reported as tool errors, never as a normal result with an error key.
🔍 Discovery & terminal selection
| Tool | Description |
|---|---|
env_info |
Resolved paths, terminal hash, edition, and missing-component issues |
list_terminals |
Every MT4/5 terminal data folder under %APPDATA%\MetaQuotes\Terminal with its origin.txt install path |
select_terminal |
Switch the active terminal data folder mid-session by origin path, hash, or install dir |
🔨 Build & deploy
| Tool | Description |
|---|---|
compile |
MetaEditor CLI on a .mq4/.mq5/.mqh. ok requires a Result: line with 0 errors and a freshly written binary (MetaEditor’s exit code is 1 even on success and is ignored). syntax_only=true uses /s for a fast check without a binary |
compile_and_deploy |
Compile, then copy the fresh .ex4/.ex5 into Experts/ |
deploy |
Copy a compiled binary into Experts/ or a .mqh into Include/, chosen by extension |
smoke_test |
Compile + deploy + 1-day headless backtest + journal scan for runtime errors |
list_experts |
Enumerate Experts/ (defaults to *.ex5 on MT5, *.ex4 on MT4) |
🔎 Source analysis & lint
| Tool | Description |
|---|
설치
This server does not publish a one-line install command.
Open the repository installation guide MCP 초보자라면? mcpskill.org 가이드부터 시작하세요 →설정
{
"mcpServers": {
"mt5": {
"command": "mcp-mt5",
"env": {
"MT5_INSTALL": "C:\\Program Files\\MetaTrader 5"
}
}
}
}