← Back to directory
M

MetaTrader MCP Server

Community
Connect AI assistants to MetaTrader 5 for market data and natural-language trading.
GitHub source repository ↗
★ 774 Stars Category · Other Popular Source revision bd2ff591e32c
46FMRS · D
Reliability
7/20
Security and permissions
3/20
Maintenance
10/20
Documentation
14/20
Setup experience
12/20

This independently maintained MetaTrader 5 MCP bridge covers accounts, market data, orders, positions, and trading history. The README identifies version 0.5.1, MIT licensing, and Active Development. It also provides REST API and WebSocket quote interfaces, but live trading carries substantial risk and remote SSE has no built-in authentication.

Read the FMRS scoring method →

MetaTrader MCP Server connects AI assistants to MetaTrader 5 for account queries, real-time and historical market data, order execution, position management, and trading-history access. It can run as an MCP server, REST API, or WebSocket quote stream, with stdio, SSE, and streamable-http transports.

Tools

get_account_info
Get account balance, equity, profit, margin level, leverage, and currency information.
get_symbols
List available trading symbols.
get_symbol_price
Get the current bid and ask price for a symbol.
get_candles_latest
Get recent OHLCV price candles.
get_candles_by_date
Get historical candles for a date range.
get_symbol_info
Get detailed information about a trading symbol.
place_market_order
Execute an instant BUY or SELL order.
place_pending_order
Place a limit or stop pending order.
modify_position
Update a position's stop loss or take profit.
modify_pending_order
Modify pending-order parameters.
get_all_positions
View all open positions.
get_positions_by_symbol
Filter positions by trading symbol.
get_positions_by_id
Get details for a specific position.
close_position
Close a specific position.
close_all_positions
Close all open positions.
close_all_positions_by_symbol
Close all positions for a symbol.
close_all_profitable_positions
Close only profitable positions.
close_all_losing_positions
Close only losing positions.
get_all_pending_orders
List all pending orders.
get_pending_orders_by_symbol
Filter pending orders by symbol.
cancel_pending_order
Cancel a specific pending order.
cancel_all_pending_orders
Cancel all pending orders.
cancel_pending_orders_by_symbol
Cancel pending orders for a symbol.
get_deals
Get historical completed trades.
get_orders
Get historical order records.

Setup

Install Python 3.10 or higher, MetaTrader 5, and a demo or live trading account. Run pip install metatrader-mcp-server, then enable Allow algorithmic trading under Tools → Options → Expert Advisors in MetaTrader 5. Replace the login, password, and server placeholders in install_config with your account details, add the configuration to Claude Desktop, and restart Claude Desktop. Add --path if the MT5 terminal is installed outside the standard location.

claude_desktop_config.json
{"mcpServers":{"metatrader":{"command":"metatrader-mcp-server","args":["--login","YOUR_MT5_LOGIN","--password","YOUR_MT5_PASSWORD","--server","YOUR_MT5_SERVER","--transport","stdio"]}}}

Fit and risk

Best for

  • Traders who want AI-assisted MetaTrader 5 operations.
  • Developers building trading bots or analysis tools.
  • Analysts who need quick access to MetaTrader 5 market data.

Not for

  • Users who do not understand financial-trading risks.
  • Users seeking risk-free advice or guaranteed profits.
  • Users without a MetaTrader 5 terminal, account credentials, or algorithmic-trading permission.

Required permissions

  • Requires a MetaTrader 5 terminal and trading-account login, password, and server name.
  • Requires algorithmic trading to be enabled in MetaTrader 5.
  • An account with trading permissions can be used to place orders, modify orders, and close positions.
  • Remote SSE deployments require network access; the protocol itself does not include authentication.

Risks and side effects

  • Financial trading can result in significant losses, and the developers accept no liability for outcomes.
  • AI requests can trigger live orders, order modifications, or position closures.
  • Exposing SSE over a network without access restrictions may permit unauthorized calls.
  • Operations may fail because of live-account conditions, insufficient margin, closed markets, or unavailable symbols.

Troubleshooting

  1. For connection failures, confirm that the MT5 terminal is running, algorithmic trading is enabled, and credentials are correct.
  2. For module errors, confirm that metatrader-mcp-server is installed and Python is version 3.10 or higher.
  3. For order-execution failures, confirm that the symbol exists, the market is open, and sufficient margin is available.
  4. Use --path to specify terminal64.exe when the terminal is installed in a non-standard location.
  5. For remote SSE, restrict access with a firewall, an authenticated reverse proxy, or an SSH tunnel.

Use cases

Query account and market data using natural language.
Execute, modify, and close trades through an AI assistant.
Build trading bots or market-analysis tools.
Stream live tick data to dashboards, bots, or monitoring clients over WebSocket.

Supported clients

Claude DesktopFull support
Claude CodeFull support
Open WebUIPartial support
ChatGPT via Open WebUIPartial support