← Back to directory
M

MetaTrader MCP Server

Community
Connect AI assistants to MetaTrader 5 for market data and natural-language trading.
Category
Other #174 of 230
Stars
★ 832 Popular
Transport
stdio (local process) · SSE · Streamable HTTP
Runtime
Python 3.10+ · Prebuilt binary MetaTrader 5 termina
Credentials
API key / credential required
License
MIT
Last commit
⚠
Tools
25
46FMRS · D

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.

Strongest · Documentation 14/20 Weakest · Security and permissions 3/20

Reliability
7/20
Security and permissions
3/20
Maintenance
10/20
Documentation
14/20
Setup experience
12/20
Why each score
Reliability 7/20
Only the README is available; there is no verifiable source, manifest, CI, or test-execution evidence. The README describes MCP, HTTP, and WebSocket paths and mentions retries, error messages, and 32 tools, but the initialization handshake, tool listing, and implementation consistency cannot be checked statically. The score reflects a plausible happy path with deductions for missing implementation evidence and key-path tests.
Security and permissions 3/20
There are substantial permission and side-effect risks: the server can place, modify, and bulk-close trades, and the included skill explicitly says no extra confirmation is needed. SSE defaults to 0.0.0.0 and the protocol has no authentication; HTTP and WebSocket interfaces can also be exposed over a network. Credentials may be supplied on the command line and could appear in process metadata. The README recommends firewalls, authenticated reverse proxies, or SSH tunnels and claims credentials remain local, but does not establish least privilege, authentication, or trade-confirmation controls. Because dangerous financial actions are executable without confirmation and the remote interface is unauthenticated, this receives a red-line-level score of 3.
Maintenance 10/20
The repository is not archived, identifies version 0.5.1, uses the MIT license, and provides Issues, Discussions, contribution guidance, and a project structure. The README describes active development, but there is no evidence of commit history, release cadence, CI, security-response process, or dependency update practice. This supports signs of maintenance but not strong ongoing governance.
Documentation 14/20
The README covers installation, prerequisites, multiple client configurations, credential methods, interface choices, operation lists, parameters, examples, troubleshooting, risk disclosure, and licensing. Deductions reflect the lack of reviewable source-level parameter and behavior evidence, concrete limits, implemented authentication details, risk controls, and test results. It also documents execution without confirmation and does not provide a safer default.
Setup experience 12/20
It provides pip installation, a Python requirement, MT5 preparation steps, and clear examples for Claude Desktop, Open WebUI, SSE, and WebSocket connections. Deductions reflect reliance on a local MT5 terminal and account configuration, incomplete platform-compatibility details, additional network-security work for remote deployment, and the absence of verifiable CI or end-to-end connection evidence.

Static review · not runListed 2026-08-14

Read the FMRS scoring method →

Fit and risk

What it can accessUses the networkChanges third-party account data

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.

Setup

Before you start

Runtime:Python 3.10+ · Prebuilt binary MetaTrader 5 termina

LOGIN required Your MT5 trading account login number, from your broker account.
PASSWORD requiredsecret Your MT5 account password, from your broker account; sensitive credential.
SERVER required Your MT5 server name, e.g. MetaQuotes-Demo.
Other optional settings (8)
MT5_PATH optional Full path to the MT5 terminal terminal64.exe; auto-detected if unset.
MCP_TRANSPORT optional MCP transport type: sse, stdio, or streamable-http; defaults to sse.
MCP_HOST optional Host to bind in SSE/HTTP mode; defaults to 0.0.0.0.
MCP_PORT optional Port to bind in SSE/HTTP mode; defaults to 8080.
QUOTE_HOST optional Host for the WebSocket quote server; defaults to 0.0.0.0.
QUOTE_PORT optional Port for the WebSocket quote server; defaults to 8765.
QUOTE_SYMBOLS optional Comma-separated list of symbols to stream tick data for.
QUOTE_POLL_INTERVAL_MS optional Tick polling interval in milliseconds; defaults to 100.

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"]}}}

Shown for Claude Desktop. Other clients may use a different file or key (VS Code uses "servers") — the configurator below converts it.

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

Goes in your project's .vscode/mcp.json (VS Code uses a "servers" key).

Terminal
claude mcp add metatrader -- metatrader-mcp-server --login YOUR_MT5_LOGIN --password YOUR_MT5_PASSWORD --server YOUR_MT5_SERVER --transport stdio

Run it in a terminal; replace any <…> placeholders with your own values first.

Check that it works

After installing metatrader-mcp-server and configuring Claude Desktop, restart the client and confirm tools like get_account_info and place_market_order appear in the tool list; asking "What's my account balance?" and getting real MT5 account data proves the connection works.

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.

Things to try

Once connected, you can ask your AI assistant things like:

  • Show me my account balance and margin information
  • What's the current bid and ask price of EURUSD?
  • Buy 0.01 lots of GBPUSD with stop loss at 1.2500 and take profit at 1.2700
  • Close all my profitable positions

Tools 25

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

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 Desktop
Claude Code
Open WebUIPartial support
ChatGPT via Open WebUIPartial support

Listed from the project's documentation, not tested by this site.

Overview

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.

Similar servers

BioMCP 75 · B

One binary. One grammar. Evidence from the biomedical sources you already trust.

★ 659 · Tools 11 Compare with this →

Source revision bd2ff591e32c Data synced 2026-10-19 Read the FMRS scoring method