MetaTrader 5 MCP Bridge — Claude Code MCP server for MT5 trading
Lets an agent read a MetaTrader 5 account and place trades through it. Every order can wait for your approval first.
claude mcp add --env MT5_LOGIN=<MT5_LOGIN> --env MT5_PASSWORD=<MT5_PASSWORD> --env MT5_SERVER=<MT5_SERVER> --transport stdio metatrader-5-mcp-bridge -- uvx mt5-trading-mcpWhat MetaTrader 5 MCP Bridge does
The server runs locally, beside your agent. No cloud, no telemetry. Twelve read-only tools cover the account, quotes, positions, orders, history, OHLC bars, broker margin estimates and native chart screenshots. None of them ask for consent.
Four tools change state: place_order, modify_order, cancel_order, close_position. Each one goes through preflight checks, an opt-in consent gate, idempotency and an append-only audit log. That gives you a replayable record of what the agent did. Three subscribable resources — account://, positions:// and quotes://{symbol} — push change notifications.
This places real orders with irreversible fills. Test on a demo account first. Windows needs Python 3.10+ and AlgoTrading switched on in the terminal. On Linux everything runs in Docker, and chart screenshots are unavailable there because they rely on the AgentScreenshot MQL5 Expert Advisor inside a GUI terminal. Two Claude skills ship with it: mt5-market-data and mt5-trading.
What it helps with
- check balance and open positions without opening the terminal
- place an order described in plain words and approve it by hand
- capture an annotated chart for the agent to read
- get a broker margin estimate before entering a trade
- reconstruct from the audit log what the agent did to the account
Example prompts for the agent
- Show my open positions and account balance.
- Place a 0.01-lot limit order on EURUSD and show me the parameters before I approve.
- Take a screenshot of the EURUSD H1 chart and mark the support level.
How to install MetaTrader 5 MCP Bridge
Platform CLI
claude mcp add --env MT5_LOGIN=<MT5_LOGIN> --env MT5_PASSWORD=<MT5_PASSWORD> --env MT5_SERVER=<MT5_SERVER> --transport stdio metatrader-5-mcp-bridge -- uvx mt5-trading-mcpReplace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from mt5-trading-mcp <command>
Platform CLI
codex mcp add metatrader-5-mcp-bridge --env MT5_LOGIN=<MT5_LOGIN> --env MT5_PASSWORD=<MT5_PASSWORD> --env MT5_SERVER=<MT5_SERVER> -- uvx mt5-trading-mcpReplace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from mt5-trading-mcp <command>
Config file
{
"mcpServers": {
"metatrader-5-mcp-bridge": {
"command": "uvx",
"args": [
"mt5-trading-mcp"
],
"env": {
"MT5_LOGIN": "<MT5_LOGIN>",
"MT5_PASSWORD": "<MT5_PASSWORD>",
"MT5_SERVER": "<MT5_SERVER>"
}
}
}
}Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from mt5-trading-mcp <command>
Config file
{
"servers": {
"metatrader-5-mcp-bridge": {
"type": "stdio",
"command": "uvx",
"args": [
"mt5-trading-mcp"
],
"env": {
"MT5_LOGIN": "<MT5_LOGIN>",
"MT5_PASSWORD": "<MT5_PASSWORD>",
"MT5_SERVER": "<MT5_SERVER>"
}
}
}
}Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from mt5-trading-mcp <command>
Platform CLI
gemini mcp add -e MT5_LOGIN=<MT5_LOGIN> -e MT5_PASSWORD=<MT5_PASSWORD> -e MT5_SERVER=<MT5_SERVER> metatrader-5-mcp-bridge uvx mt5-trading-mcpReplace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from mt5-trading-mcp <command>
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about MetaTrader 5 MCP Bridge
How do I install MetaTrader 5 MCP Bridge in Claude Code?
Run claude mcp add mt5-trading-mcp -e MT5_PASSWORD=<MT5_PASSWORD> -- uvx mt5-trading-mcp. A second form adds MT5_LOGIN, MT5_PASSWORD and MT5_SERVER over stdio transport.
What does MetaTrader 5 MCP Bridge do?
It connects an agent to your MetaTrader 5 terminal over Model Context Protocol. The agent reads the account and quotes, while trading calls pass through preflight checks, human consent and an audit log.
Does it work on Linux?
Yes, through Docker: the terminal and the server run headless and the agent talks MCP over HTTP. Chart screenshots do not work in that setup — they need a GUI terminal on Windows.