Skip to main content
Glama
alikhande70

metatrader5-mcp

by alikhande70

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
MT5_PATHNoOptional explicit path to the MetaTrader 5 terminal executable.
MT5_LOGINNoOptional account login number.
MT5_SERVERNoOptional server name for the MT5 account.
MT5_PASSWORDNoOptional account password.
MT5_MCP_LOG_DIRNoDirectory for log files.logs
MT5_MCP_REPORTS_DIRNoDirectory for strategy reports.reports/
MT5_MCP_APPROVAL_MODENoApproval mode: 'console' for interactive prompt, 'file' for file-based approval.console
MT5_MCP_ENABLE_DEMO_TRADINGNoSet to 'true' to enable order-planning tools on demo accounts.false

Capabilities

Features and capabilities supported by this server

CapabilityDetails
tools
{
  "listChanged": false
}
prompts
{
  "listChanged": false
}
resources
{
  "subscribe": false,
  "listChanged": false
}
experimental
{}

Tools

Functions exposed to the LLM to take actions

NameDescription
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 symbol.

get_tickB

Get the latest bid/ask/last tick for symbol.

get_ratesB

Get OHLCV bars for symbol on timeframe (e.g. M1, M15, H1, H4, D1).

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 date (YYYYMMDD, default today). kind: 'terminal' or 'experts'.

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 positions is omitted.

analyze_drawdownA

Compute basic peak-to-trough drawdown from history deals (fetched live if deals is omitted).

analyze_trade_historyB

Compute win rate / profit factor / averages from history deals (fetched live if deals is omitted).

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

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

Latest Blog Posts

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/alikhande70/metatrader5-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server