
How to add MetaTrader MCP Server to Cursor
Let AI assistants trade on MetaTrader 5 using natural language. Paste the config into ~/.cursor/mcp.json and restart Cursor.
Last updated June 14, 2026 · 533★ · stdio · no auth
Cursor config for MetaTrader MCP Server
pip install metatrader-mcp-server{
"mcpServers": {
"metatrader-mcp-server": {
"command": "metatrader-mcp-server",
"args": [
"--login",
"YOUR_MT5_LOGIN",
"--password",
"YOUR_MT5_PASSWORD",
"--server",
"YOUR_MT5_SERVER",
"--transport",
"stdio"
]
}
}
}Setup steps
- 1Open Cursor → Settings → MCP → Add new MCP server (or edit ~/.cursor/mcp.json directly).
- 2Paste the MetaTrader MCP Server config below into the "mcpServers" object.
- 3Fill in placeholder secrets, then save.
- 4Cursor reloads MCP servers automatically — check Settings → MCP for a green status dot.
- 5Ask Cursor to use one of MetaTrader MCP Server's tools to confirm it's connected.
Before you start
- Python 3.10 or higher
- MetaTrader 5 terminal installed
- An MT5 trading account (demo or live): login number, password, and server name
- Algorithmic trading enabled in MT5 (Tools → Options → Expert Advisors → Allow algorithmic trading)
What MetaTrader MCP Server can do in Cursor
get_account_infoGet balance, equity, profit, margin level, leverage, and currency.
get_symbolsList all available trading symbols.
get_symbol_priceGet the current bid/ask price for a symbol.
get_candles_latestGet recent price candles (OHLCV data).
get_candles_by_dateGet historical candles for a date range.
get_symbol_infoGet detailed symbol information.
place_market_orderExecute an instant BUY/SELL order.
place_pending_orderPlace a limit/stop order for future execution.
Security
Trading involves significant risk of loss; the software is provided as-is with no liability for trading outcomes. Requires MT5 account credentials (login, password, server) passed as CLI args or via a .env file — keep these private. The MCP protocol includes no authentication: when exposing the SSE server over a network, restrict access by IP with a firewall, place it behind an authenticated reverse proxy, or use an SSH tunnel. Algorithmic trading must be explicitly enabled in the MT5 terminal.
MetaTrader MCP Server + Cursor FAQ
Where is the Cursor config file?
Cursor reads MCP servers from ~/.cursor/mcp.json. Paste the MetaTrader MCP Server config there under the "mcpServers" key and restart the client.
Is MetaTrader MCP Server safe to use with Cursor?
Trading involves significant risk of loss; the software is provided as-is with no liability for trading outcomes. Requires MT5 account credentials (login, password, server) passed as CLI args or via a .env file — keep these private. The MCP protocol includes no authentication: when exposing the SSE server over a network, restrict access by IP with a firewall, place it behind an authenticated reverse proxy, or use an SSH tunnel. Algorithmic trading must be explicitly enabled in the MT5 terminal.
Which AI clients does it support?
Claude Desktop and Claude Code via local stdio or remote SSE; ChatGPT and other LLMs via Open WebUI using the REST/HTTP API server. It can also be used directly as a Python library (MT5Client).
What transports are available?
The MCP server supports stdio, sse, and streamable-http (via --transport / MCP_TRANSPORT). SSE/HTTP bind to 0.0.0.0:8080 by default. There is also a separate FastAPI REST server and a WebSocket quote server (default ws://0.0.0.0:8765).
Is it safe to run the remote SSE server?
The MCP protocol has no built-in authentication. When exposing the SSE server over a network, restrict access by IP with a firewall, put it behind an authenticated reverse proxy, or use an SSH tunnel.