TradeLab-MCP
TradeLab-MCP
Servidor MCP de investigación cuantitativa. La IA define la estrategia. El Strategy Tester de MetaTrader 5 ejecuta el backtest.
IA (Codex / GPT / Grok / Gemini / Claude)
│ MCP
▼
Trading Research MCP
│
▼
terminal64.exe → Strategy Tester oficial → runs/<run_id>/Fork de PHUICMT/mcp-mt5 (MIT). No reimplementa el tester en Python.
Principio
MT5 es la autoridad para órdenes, fills, ticks, spread, SL/TP, margen, comisiones y P&L.
Python solo organiza experimentos (run_id, manifest, hashes, parser, estadísticas derivadas).
Cada backtest genera un identificador único. Nada se recupera por el “archivo más reciente”.
runs/20260817_073412_a8f231/
tester.ini
strategy.mq5
strategy.ex5
report.htm
tester.log
trades.csv
metrics.json
manifest.jsonRelated MCP server: OpenFinClaw CLI
Herramientas MCP (V1)
Herramienta | Función |
| MT5, MetaEditor, terminal, directorio de datos, Experts, Tester, build |
| Compila |
| Tester oficial → |
| Misma estrategia, varios activos, secuencial |
| Recupera un experimento por el |
| Trades normalizados de ese |
| Diff de métricas entre runs |
| Ventanas IS/OOS, cada una un backtest oficial |
| Compile + tester corto (símbolo/período/modelo/fecha configurables) |
Instalación
Windows + MetaTrader 5 + Python 3.10+.
cd C:\Users\caioa\TradeLab-MCP
python -m pip install -e ".[dev]"Cliente MCP:
{
"mcpServers": {
"tradelab": {
"command": "tradelab-mcp",
"env": {
"MT5_INSTALL": "C:\\Program Files\\MetaTrader 5",
"TRADE_LAB_ROOT": "C:\\Users\\caioa\\TradeLab-MCP\\research"
}
}
}
}Variables: MT5_INSTALL, MT5_DATA, MT5_TERMINAL_HASH, TRADE_LAB_ROOT.
Ejemplo
Compile este EA e faça um backtest de PETR4 D1,
entre 2015 e 2025, usando real ticks.El agente llama a run_backtest(strategy="experts/RSI2.mq5", symbol="PETR4", timeframe="D1", from_date="2015.01.01", to_date="2025.08.01", model=4) y recibe:
{
"run_id": "20260817_073412_a8f231",
"status": "completed",
"symbol": "PETR4",
"period": "D1",
"model": "real_ticks",
"metrics": {
"total_trades": 134,
"net_profit": 18342.21,
"profit_factor": 1.48
}
}get_run("20260817_073412_a8f231") devuelve exactamente ese experimento.
Dónde viven los EAs en MT5
Todo EA de prueba automática se publica en:
<MQL5>\Experts\TradeLab MCP\En este PC se resuelve a:
C:\Users\caioa\AppData\Roaming\MetaQuotes\Terminal\D0E8209F77C8CF37AD8BF550E51FF075\MQL5\Experts\TradeLab MCP
En el Strategy Tester el expert aparece como TradeLab MCP\RSI2. La carpeta siempre es relativa al terminal activo (layout.experts_dir), no a un hash fijo.
El código fuente en git continúa en experts/. El MCP copia el código fuente + .ex5 + includes locales a la carpeta del terminal.
El EA base del laboratorio (CTrade, ArraySetAsSeries, una posición) aún no se ha estandarizado — llegará más adelante, con calma.
EA de aceptación
experts/RSI2.mq5
RSI(2)
compra si RSI < 10
sale si RSI > 70
una posición
sin optimización
La prueba de aceptación nº 1 es: el mismo EA / activo / fechas / inputs / capital / model en el Strategy Tester manual y vía MCP deben producir las mismas métricas y los mismos trades.
Pruebas
pytestPruebas de integración (Windows + MT5 real):
$env:TRADE_LAB_INTEGRATION = "1"
$env:TRADE_LAB_SYMBOL = "EURUSD"
pytest tests/test_integration_mt5.py -vPrioridad
reproducibilidad > fiabilidad > simplicidad > velocidad > funcionalidades
V1 es secuencial (lock mt5.lock en el directorio de datos). Sin backtester Python paralelo. Sin parser .opt como fuente oficial.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Alicense-qualityDmaintenanceMCP server that provides AI agents with financial tools including real-time quotes, backtesting, technical analysis, and multi-exchange data via a simple CLI interface.1MIT
- Flicense-qualityDmaintenanceEnables quant research, strategy generation, backtesting, and paper trading from natural language prompts, integrating with AI agents via an MCP server.61
- AlicenseAqualityAmaintenanceAn MCP server exposing a registry of paper-backed quantitative trading methods plus a deterministic, no-LLM decision helper for reproducible trading research.13MIT

backtest360-mcpofficial
AlicenseAqualityDmaintenanceMCP server that exposes the Backtest360 backtesting engine API as tools, enabling AI agents to conversationally discover indicators, build and validate strategies, run backtests, and read results.14MIT
Related MCP Connectors
MCP server exposing the Backtest360 engine API as tools for AI agents.
MCP server for Gainium — manage trading bots, deals, and balances via AI assistants
Build, backtest, and deploy quantitative trading strategies from your AI agent.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/CaioAllgayer/TradeLab-MCP'
If you have feedback or need assistance with the MCP directory API, please join our Discord server