mt5-mcp
mt5-mcp is an MCP server so AI agents can inspect and trade against a MetaTrader 5 terminal — account, symbols, quotes, orders/positions, history — with a full offline mock for CI and demos.
Install (one command)
Grok — recommended
pip install "git+https://github.com/mergeos-bounties/mt5-mcp.git" && grok plugin install mergeos-bounties/mt5-mcp --trust
This installs the Python CLI (mt5-mcp) and the Grok plugin (skill + MCP server from .mcp.json).
Check:
mt5-mcp version
mt5-mcp doctor
mt5-mcp demo
grok plugin list
grok mcp list
Local clone:
git clone https://github.com/mergeos-bounties/mt5-mcp.git
cd mt5-mcp
pip install -e ".[dev]"
grok plugin install . --trust
Other agents (stdio MCP)
After pip install "git+https://github.com/mergeos-bounties/mt5-mcp.git", point any MCP host at:
Claude Desktop — merge examples/claude_desktop_config.json into Claude MCP config.
Cursor — merge examples/cursor_mcp.json.
Grok config.toml (manual, without plugin):
[mcp_servers.mt5_mcp]
command = "mt5-mcp"
args = ["serve"]
env = { MT5_MCP_MODE = "mock" }
enabled = true
One-liner via Grok CLI:
pip install "git+https://github.com/mergeos-bounties/mt5-mcp.git"
grok mcp add mt5-mcp -- mt5-mcp serve
Supported AI agents / hosts
All packages speak MCP over stdio (mt5-mcp serve). Default mode is mock (offline, no simulator/terminal/GIMP required).
Modes
Highlights
Quick start
cd mt5-mcp
python -m venv .venv
.\.venv\Scripts\activate
pip install -e ".[dev]"
mt5-mcp version
mt5-mcp demo
mt5-mcp tools list
pytest -q
Mock mode needs no MetaTrader install.
CLI reference
mt5-mcp serve
MCP tools
MCP host config
{
"mcpServers": {
"mt5-mcp": {
"command": "python",
"args": ["-m", "mt5_mcp"],
"env": {
"MT5_MCP_MODE": "mock"
}
}
}
}
Also see examples/cursor_mcp.json.
Live bridge (optional)
Set env (never commit secrets):
Without a working bridge, live mode returns structured errors; demos stay on mock.
Safety
Deal history
Deal history fields
Development
pip install -e ".[dev]"
ruff check src tests
pytest -q
mt5-mcp demo