Uses .env files for configuration management, allowing secure storage of MetaTrader5 broker credentials through environment variables.
Leverages pandas_ta library to provide technical indicators (SMA, EMA, RSI, MACD, Stochastic, Bollinger Bands) for market data analysis and charting.
Provides access to MetaTrader5 terminal functionality including market data retrieval, historical rates, tick data, symbol information, and real-time market streaming through Python integration.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MetaTrader5 MCP Serverget hourly EURUSD data for the last 24 hours"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
mtdata
mtdata is a research and automation toolkit for MetaTrader 5 (MT5). It provides tools for forecasting, regime detection, signal processing, risk analysis, and reporting—bridging raw market data with data science.
It runs as a Model Context Protocol (MCP) server or a standalone CLI.
Who Is This For?
Newer traders / learners: Follow guided workflows (no quant background required).
Systematic traders: Prototype ideas, backtest quickly, and automate via CLI/MCP.
Data folks: Pull MT5 market data into repeatable analysis pipelines.
Related MCP server: OKX MCP Server
Platform Support (Important)
Windows is required to run MetaTrader 5 (and therefore to run
mtdataagainst MT5).If you're on macOS/Linux, run
mtdataon a Windows VM or Windows machine and connect remotely (MCP/Web API).
Safety First
mtdataincludestrading_*commands that can place/modify/close real orders on the account currently logged into MT5.Use a demo account until you understand the tools and your broker setup.
There is no built-in “paper trading” mode in mtdata; use an MT5 demo account for simulated execution.
If you only want research, stick to
data_*,forecast_*,regime_*,patterns_*, andreport_*commands.
Capabilities
Category | What It Does | Key Tools |
Data | Fetch candles, ticks, market depth from MT5 |
|
Forecasting | Predict price paths with classical or ML models |
|
Volatility | Estimate future price movement magnitude |
|
Regimes | Detect trending, ranging, or crisis market states |
|
Barriers | Calculate TP/SL hit probabilities via simulation |
|
Patterns | Identify candlestick and chart patterns |
|
Indicators | Compute 100+ technical indicators |
|
Denoising | Smooth price data to reveal trends |
|
Trading | Place orders, manage positions |
|
Quick Start
Prerequisites: Windows + MetaTrader 5 installed and running (demo account recommended).
Documentation
New here? Follow this learning path:
docs/SETUP.md → docs/GLOSSARY.md → docs/CLI.md → docs/SAMPLE-TRADE.md (then docs/SAMPLE-TRADE-ADVANCED.md and deep dives).
Getting Started
Setup & Configuration — Installation, MT5 connection, environment variables
CLI Guide — Command conventions, output formats, help system
Glossary — Explanations of all technical terms with real-world examples
Docs Index — One-page map of all docs
Core Topics
Forecasting — Price prediction methods (Theta, ARIMA, Chronos, etc.)
Volatility — Estimating price movement magnitude
Regime Detection — Identifying market states (trending vs. ranging)
Barrier Analysis — TP/SL hit probability calculation
Technical Indicators — Available indicators and usage
Denoising — Smoothing filters to reveal trends
Pattern Detection — Candlestick and chart patterns
Tutorials
Sample Trade Workflow — Step-by-step analysis for a trade decision
Advanced Playbook — Regime filters, conformal intervals, barrier optimization
End-to-End Example — Complete research loop with all tools
Reference
Troubleshooting — Common issues and fixes
Configuration
Create a .env file in the project root:
Architecture
License
MIT