Labsco
MCP SERVER

Mt5 MCP by Leo

by TradeSystemsNique

Drive MetaTrader 5 from an agent — orders, positions, OHLC and tick data, indicators, chart objects, EA compilation and strategy-tester runs — through a C++ server paired with an MQL5 expert advisor.

Trading Execution & Brokerage
Summary
Full MQL5 reach, at the price of a licence and a Windows terminal.

Most MT5 servers wrap the Python package and stop where it stops — no chart objects, no indicator buffers, no tester control. This one puts an expert advisor inside the terminal and talks to it, so backtests run from the same EA without .ini files and the whole chart API is in range. Setup is correspondingly heavy: two EX5 files, an executable, a tools file, a config file, terminal permissions and a purchased ID before anything answers. And it places real orders on the account the EA is attached to.

What it is

An MCP server for MetaTrader 5 built in two halves: a C++ executable that speaks MCP, and an MQL5 expert advisor running inside the terminal. Splitting it that way reaches the full MQL5 API rather than the subset the Python package exposes, which is what makes chart objects, indicator buffers and tester control reachable at all.

What you get
  • Trading: market buy and sell, pending limit and stop orders, modifying stops and take-profits, closing positions fully or partially, and completed-deal history with profit and loss
  • Market data: OHLC candles with volume and spread, tick data with last, ask, bid and flags, the full `SYMBOL_INFO_*` property surface, and Market Watch symbol selection
  • Indicators: add a built-in or custom indicator to a chart, read its parameters and buffers, remove it, and count what is attached to a chart or subwindow
  • Chart objects: trend lines, rectangles, text labels and arrows, with the full `ENUM_OBJECT_PROPERTY_*` surface for colours, styles, prices and text
  • Charts: open, close and list chart windows, read dimensions, colours and price ranges, navigate, and force a redraw
  • Terminal and code: compile MQL5 to EX5, run an expert advisor, retrieve its logs, run backtests and optimizations with tick model, leverage, criteria, forward and visual mode, and read back the report, deals and equity curve
Requirements

Windows with MetaTrader 5, and a paid licence: the server will not run without a TBP ID from TheBotPlace, passed in the client entry's args array alongside the config path and your MT5 account login. From releases you need `McpServer.exe` plus the `Runner.ex5` and `Mt5Mcp.ex5` expert advisors — the EX5 files go in the terminal's Experts folder and `tools.json` in the Common Files folder. In MT5, add the host to Allowed URLs for WebRequest and enable AutoTrading and DLL imports; the EA's port and host must match the config JSON. The registry manifest lists PyPI `mt5-mcp-by-leo` 1.0.7, but the README marks the Python package deprecated in favour of the C++ executable. HTTP is supported as an alternative to stdio.

Setup effort

One command — tsndep install "https://forge.mql5.io/nique_372/FullMt5McpByLeo.git"