LABSCO 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 published 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
Follow the published steps
USE CASES
01
Placing and managing trades from a sentence
Open a position with a stop and a target, then modify or partially close it later without touching the terminal.
02
Pulling market data into analysis
Read OHLC candles, tick data and full symbol properties for a instrument and work with them in the conversation.
03
Backtesting an expert advisor end to end
Compile the MQL5 source, run the tester with your tick model and criteria, and read back the report, the deals and the equity curve.
04
Annotating a chart from analysis
Draw trend lines, rectangles, arrows and labels on a live chart and set their colours and styles, then force a redraw.
05
Reviewing what an EA is doing
Retrieve the expert advisor's logs and the terminal and account information while it runs.
BEFORE YOU INSTALL
What to know first
Requires
- MetaTrader 5 with the Mt5Mcp and Runner expert advisors attached
- The McpServer .exe and tools.json from the project's releases
Where it runs
The documented client runs the server on your machine.
INSTALLATION
Connect your client
Server setup
Buy McpServerByLeo at https://www.thebotplace.com/bot/mcpserverbyleo and note your TBP ID from https://thebotplace.com/profile — the server will not work without an active licence
Download the server .exe (CMcpServer.exe in current releases), Runner.ex5 and Mt5Mcp.ex5 from https://forge.mql5.io/nique_372/FullMt5McpByLeo/releases; put the .ex5 files in the MT5 terminal's Experts\ folder and the .exe somewhere easy to reach, such as the terminal's Common\Files\ folder
Download tools.json from https://forge.mql5.io/nique_372/FullMt5McpByLeo/src/branch/main/mt5_mcp_by_leo/tools.json into the terminal's Common\Files\ folder
In Common\Files, create a config JSON from the template at https://forge.mql5.io/nique_372/FullMt5McpByLeo/src/branch/main/Templates/config.json, with json_tools_fpath set to the path of tools.json
In MT5: Tools → Options → Allowed URLs for WebRequest, add 127.0.0.1 (or the host you configured), click Accept, and enable AutoTrading and DLL imports
Add the Claude Desktop entry below, then open Claude Desktop
In MT5, run Runner.ex5 on any chart, then drag Mt5Mcp.ex5 onto a chart and set its host and port to match your config
MCP Clients
Claude Desktop
CLAUDE DESKTOP · JSON
{
"mcpServers": {
"mt5_mcp_by_leo": {
"command": "<YOUR_PATH_TO_EXE>",
"args": [
"<YOUR_PATH_TO_FILE>",
"<YOUR_TBP_ID>",
"<YOUR_MT5_ACCOUNT_LOGIN_ID>"
]
}
}
}<YOUR_PATH_TO_EXE>: the server .exe you downloaded; <YOUR_PATH_TO_FILE>: your config JSON; <YOUR_TBP_ID>: your TheBotPlace user ID; <YOUR_MT5_ACCOUNT_LOGIN_ID>: the login of the MT5 account where the Mt5Mcp EA runs.