MT5 MCP Server
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| MT5_PATH | No | Path to terminal64.exe if the terminal is not running or not in the default location. | |
| MT5_LOGIN | No | Account number. Without it, the server uses the terminal's logged-in account. | |
| MT5_MAGIC | No | Magic number attached to orders placed by the AI. | 0 |
| MT5_SERVER | No | Broker server name, e.g. MetaQuotes-Demo. | |
| MT5_DRY_RUN | No | Order tools only preview, never send. Set to false for real trading. | true |
| MT5_PASSWORD | No | Account password (only with MT5_LOGIN). | |
| MT5_DEVIATION | No | Max slippage in points for market orders. | 20 |
| MT5_MAX_VOLUME | No | Hard cap on order volume in lots (safety net). | 10 |
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_infoB | Account balance, equity, margin, free margin, margin level and leverage. |
| get_terminal_infoA | Terminal state: connected to broker, algo trading allowed, MT5 build. |
| search_symbolsC | Search broker symbols by part of the name, e.g. 'EUR', 'XAU' or 'USD'. |
| get_symbol_infoC | Symbol details: digits, spread, min/max/step lot, stops level, current bid/ask. |
| get_tickC | Latest bid and ask price for a symbol. |
| get_candlesC | Recent OHLCV candles (oldest first). Use for chart analysis. |
| get_indicatorC | Compute SMA, EMA, RSI or ATR on recent candles and return the latest value. |
| get_positionsB | Open positions with live profit and swap. Optionally filter by symbol. |
| get_pending_ordersB | Pending orders waiting to be filled. Optionally filter by symbol. |
| get_historyB | Closed-trade summary for the last N days: net profit, wins/losses per symbol. |
| place_market_orderB | Open a position at market price. DRY-RUN by default: validates and previews without sending. |
| place_pending_orderC | Place a pending limit/stop order that fills later when price reaches |
| close_positionB | Close an open position by ticket (fully, or partially with |
| modify_positionA | Change stop loss / take profit of an open position. Pass 0 to remove one. |
| modify_pending_orderC | Change price, SL or TP of a pending order. |
| cancel_pending_orderB | Delete a pending order before it fills. |
| calculate_lot_sizeB | Position size in lots so hitting the stop loses |
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 17 tools
Most tools have clearly distinct roles (market data, order management, account info), but get_tick duplicates the bid/ask already present in get_symbol_info, creating a minor overlap. Other pairs like get_positions/get_pending_orders and modify_position/modify_pending_order are well separated by their descriptions.
All tools use consistent snake_case with a clear verb_noun pattern (get_, search_, place_, close_, modify_, cancel_, calculate_). No mixing of conventions or vague verbs.
With 17 tools, the set is slightly above the ideal 3–15 range, but each tool covers a distinct MT5 operation (terminal/account info, symbol data, candles, indicators, positions, pending orders, trade execution, risk sizing). The count is borderline but justified for a trading server.
The surface covers account/terminal info, symbol lookup, market data, indicators, full position/order lifecycle (place, modify, close, cancel), history, and lot sizing. Minor gaps like trailing stops or margin requirement checks exist, but the core trading workflow is complete.