MetaTrader 5 MCP Bridge

v1.4.2
io.github.vincentwongso/mt5-trading-mcp Checked 2 days ago Published 5 months ago

Let an AI agent read and trade a MetaTrader 5 account over MCP, behind a human-approval gate.

Starts only with mcp<2 (written for an older SDK); the install commands pin it.

Values you need

VariableWhat it is
MT5_LOGINoptional MetaTrader 5 account number. Optional: overrides the config file and an already-logged-in terminal.
MT5_PASSWORDoptional secret MetaTrader 5 account password. Env-only so it never lands in a config file. Optional when the terminal is already logged in.
MT5_SERVERoptional MetaTrader 5 broker/trade server name. Optional: overrides the config file and an already-logged-in terminal.

PyPI (uvx) discovery passed

Requires uv (https://docs.astral.sh/uv/)

Run in a terminal
claude mcp add mt5-trading-mcp -- uvx --with 'mcp<2' --from mt5-trading-mcp==1.4.2 mt5-mcp
Add to claude_desktop_config.json
{
  "mcpServers": {
    "mt5-trading-mcp": {
      "args": [
        "--with",
        "mcp<2",
        "--from",
        "mt5-trading-mcp==1.4.2",
        "mt5-mcp"
      ],
      "command": "uvx"
    }
  }
}
Add to ~/.cursor/mcp.json
{
  "mcpServers": {
    "mt5-trading-mcp": {
      "args": [
        "--with",
        "mcp<2",
        "--from",
        "mt5-trading-mcp==1.4.2",
        "mt5-mcp"
      ],
      "command": "uvx"
    }
  }
}
Add to .vscode/mcp.json
{
  "servers": {
    "mt5-trading-mcp": {
      "args": [
        "--with",
        "mcp<2",
        "--from",
        "mt5-trading-mcp==1.4.2",
        "mt5-mcp"
      ],
      "command": "uvx",
      "type": "stdio"
    }
  }
}
Add to ~/.codex/config.toml
[mcp_servers.mt5-trading-mcp]
command = "uvx"
args = ["--with", "mcp<2", "--from", "mt5-trading-mcp==1.4.2", "mt5-mcp"]

For AI agents

  1. Pick the user's MCP client and apply the matching config from the first install method (it is the one verified by the smoke test when available).
  2. Restart or reload the client so it starts the server.
  3. Verify: the server should expose these tools: ping, get_terminal_info, get_account_info, get_quote, get_symbols, get_market_hours, get_rates, calc_margin, ….
  4. If it fails, check that the required runtime is installed (uv (https://docs.astral.sh/uv/)) and that the values above are set.

Machine-readable: install.md · manifest.json