metatrader5-mcp
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| MT5_PATH | No | Optional explicit path to the MetaTrader 5 terminal executable. | |
| MT5_LOGIN | No | Optional account login number. | |
| MT5_SERVER | No | Optional server name for the MT5 account. | |
| MT5_PASSWORD | No | Optional account password. | |
| MT5_MCP_LOG_DIR | No | Directory for log files. | logs |
| MT5_MCP_REPORTS_DIR | No | Directory for strategy reports. | reports/ |
| MT5_MCP_APPROVAL_MODE | No | Approval mode: 'console' for interactive prompt, 'file' for file-based approval. | console |
| MT5_MCP_ENABLE_DEMO_TRADING | No | Set to 'true' to enable order-planning tools on demo accounts. | false |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": false
} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
| experimental | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| get_account_infoA | Get the connected MT5 account's balance, equity, margin, leverage, and trade mode. |
| get_terminal_infoA | Get MT5 terminal status: connection state, data path, build, trade-allowed flags. |
| get_symbol_infoA | Get full symbol specification (point, digits, contract size, spread, limits) for |
| get_tickB | Get the latest bid/ask/last tick for |
| get_ratesB | Get OHLCV bars for |
| get_positionsC | List open positions, optionally filtered by symbol or ticket. |
| get_ordersB | List active pending orders, optionally filtered by symbol or ticket. |
| get_history_dealsB | List historical deals between date_from/date_to (ISO dates), or by ticket/position. |
| read_logA | Read the tail of an MT5 log file for |
| read_strategy_reportA | Parse an MT5 Strategy Tester HTML report into a summary dict and raw table rows. |
| summarize_positionsB | Summarize open positions by total, symbol, and side. Fetches live positions if |
| analyze_drawdownA | Compute basic peak-to-trough drawdown from history deals (fetched live if |
| analyze_trade_historyB | Compute win rate / profit factor / averages from history deals (fetched live if |
| calculate_profit_risk_basicA | Pure price-math risk/reward ratio calculation. No MT5 connection or symbol lookup needed. |
| calculate_marginA | Calculate required margin for a hypothetical order. Requires approval; demo accounts only; never sent. |
| calculate_profitB | Calculate hypothetical profit/loss between two prices. Requires approval; demo accounts only; never sent. |
| check_orderB | Run MT5's server-side order_check validation for a hypothetical order. Requires approval; demo only; never sent. |
| prepare_order_planB | Build a full order plan (request + margin + estimated P/L + order_check). Requires approval; demo only; NEVER sent. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 18 tools
Each tool has a distinct purpose. Analysis tools are differentiated (drawdown vs. trade history vs. profit calculation variants). Data retrieval tools are separate (rates, ticks, symbols, account, terminal). No overlapping functionality.
All tools follow a consistent verb_noun snake_case pattern: get_*, analyze_*, calculate_*, check_*, prepare_*, read_*, summarize_*. No mixing of conventions.
18 tools are well-scoped for a MetaTrader 5 assistant covering account info, market data, position/order status, trade analysis, risk calculation, and logging. Not overwhelming or insufficient.
The tool surface covers core functionalities (data retrieval, analysis, planning) but lacks order execution (place, modify, close). Since several tools explicitly state 'never sent' (demo only), this appears intentional, leaving a minor gap for an analytical MCP.