Metatrader 4 MCP Server

MCP server for MetaTrader 4 integration

Local serverstdioTypeScript

What is the Metatrader 4 MCP MCP server?

Most developer tooling work still happens through a UI a human drives. Metatrader 4 MCP MCP server moves it into the conversation instead. MCP server for MetaTrader 4 integration.

The short version

A Model Context Protocol (MCP) server that provides cross-platform integration with MetaTrader 4 trading platform over network.

  • Account Information — Get real-time account details (balance, equity, margin, etc.)
  • Market Data — Retrieve current market prices for trading symbols
  • Order Management — Place market and pending orders
  • Position Management — View and close open positions
  • Trading History — Access historical trading data
  • Backtesting — Run backtests on Expert Advisors with detailed configuration

Getting it running

The server ships on npm as npm, so your MCP client can launch it on demand — there is no separate build step. Add the server block to your client's configuration, restart it, and the tools register themselves.

What it needs from you

Configuration is passed through the environment: MT4_HOST, MT4_PORT, MT4_REPORTS_PATH. Treat anything key-shaped as a real credential — scope it to the minimum the server needs, and rotate it if it ever lands in a shared config.

How it compares

This sits in the developer tooling group, where several servers overlap in what they claim to do but differ sharply once you actually set them up. It is maintained by 8nite; worth a glance at recent repository activity before you build anything load-bearing on it.

We check each listing at SyncDev against the project's documentation before it goes live — if something here drifts out of date, it is a bug worth reporting.

Things to watch

  • It runs with your machine's permissions. That is convenient and also the reason to think about what you point it at before you approve a tool call.
  • Keep per-call confirmation enabled while you learn its behaviour; it is the cheapest safeguard you have.

How to install the Metatrader 4 MCP MCP server

{
  "mcpServers": {
    "mt4-server": {
      "command": "node",
      "args": ["dist/index.js"],
      "env": {
        "MT4_HOST": "192.168.50.161",
        "MT4_PORT": "8080"
      }
    }
  }
}

Configuration as documented by the project. Restart the client after saving.

Configuration

VariableDescriptionRequired
MT4_HOSTEndpoint or connection string the server talks to.Optional
MT4_PORTConfiguration value read at startup.Optional
MT4_REPORTS_PATHFilesystem location the server is allowed to use.Optional

Frequently asked questions

It connects Metatrader 4 MCP to MCP-compatible AI assistants such as Claude and Cursor. Instead of copying data back and forth by hand, the assistant works with Metatrader 4 MCP directly.