mt4-mcp
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mt4-mcpshow my current account balance"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
mt4-mcp
mt4-mcp is an MCP server so AI agents can inspect and trade against a MetaTrader 4 terminal — account, symbols, quotes, orders/positions, history — with a full offline mock for CI and demos.
Modes
Mode | When | Behavior |
mock (default) | Windows / CI / no terminal | Seeded demo account, FX/CFD symbols, orders, history |
live | Host has a bridge configured | Optional file/HTTP bridge (see env vars); fails closed if unavailable |
Related MCP server: ctrader-mcp-server
Highlights
Capability | Description |
Offline demo |
|
MCP stdio serve | Plug into Cursor / Claude / Grok as an MCP server |
One-shot call |
|
Safety | Mock never talks to a real broker; live needs explicit env |
Quick start
cd mt4-mcp
python -m venv .venv
.\.venv\Scripts\activate
pip install -e ".[dev]"
mt4-mcp version
mt4-mcp demo
mt4-mcp tools list
pytest -qMock mode needs no MetaTrader install.
CLI reference
Command | Purpose |
| Version + mode |
| Offline smoke of core backend APIs |
| Backend health |
| MCP server over stdio |
| One-shot tool call |
| List MCP tools |
mt4-mcp serveMCP tools
Tool | Purpose |
| Get/set mock|live |
| Connectivity / account health |
| Reset mock account |
| Balance, equity, margin |
| Symbol list |
| Bid/ask for a symbol |
| Open orders |
| Market/pending OrderSend-style |
| SL/TP/price modify |
| Close by ticket |
| Closed order history |
MCP host config
{
"mcpServers": {
"mt4-mcp": {
"command": "python",
"args": ["-m", "mt4_mcp"],
"env": {
"MT4_MCP_MODE": "mock"
}
}
}
}Also see examples/cursor_mcp.json.
Live bridge (optional)
Set env (never commit secrets):
Variable | Meaning |
|
|
| Optional HTTP bridge base URL |
| Optional request/response JSON file path |
Without a working bridge, live mode returns structured errors; demos stay on mock.
Development
pip install -e ".[dev]"
ruff check src tests
pytest -q
mt4-mcp demoLicense
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/mergeos-bounties/mt4-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server