MT5 MCP Server
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., "@MT5 MCP ServerWhat's my account equity and current open positions?"
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.
MT5 MCP Server
A local MCP server that connects a MetaTrader 5 terminal to Claude. It reads market data, account state and history, captures chart screenshots, and can send live orders.
Requirements
The MetaTrader 5 terminal must be running
Tools → Options → Expert Advisors → "Allow algorithmic trading" must be enabled
An account must be logged in
If the terminal is closed, every tool returns MT5 initialize failed — open it and retry.
Related MCP server: metatrader-mcp
Install
uv venv --python 3.12 .venv
uv pip install --python .venv/Scripts/python.exe -r requirements.txtThen adjust the paths in .mcp.json and restart Claude Code.
Tools (20)
Market data
Tool | What it does |
| Terminal build, connection, account, balance, equity, margin, DEMO/REAL |
| Search symbols — wildcards supported ( |
| Digits, point, spread, contract size, lot limits, margin and swap rates |
| Live bid/ask and spread for one or more symbols |
| OHLCV from M1 to MN1, by count or by date range |
| Raw bid/ask tick stream, useful for backtesting |
Account
Tool | What it does |
| Open positions and total floating P/L |
| Active limit and stop orders |
| Closed trades with profit, commission and swap totals |
| Orders that were placed, cancelled or rejected |
| Margin and expected profit before sending anything (no order is placed) |
Screen capture
Tool | What it does |
| Open charts with symbol, timeframe and size |
| PNG of the terminal window or of a single chart |
screenshot does not come from the MetaTrader5 Python API — that API has no
screenshot function at all. It is built on the Windows PrintWindow call
(mt5_capture.py). It works on a background window, but
not on a minimised one.
Pass target='window' for the whole terminal, or target='XAUUSD,M30' for one
chart. Passing just 'XAUUSD' picks the largest chart for that symbol.
Trading — live
Tool | What it does |
| Market buy/sell, SL/TP as absolute price or in points |
| Buy/sell limit or stop, with optional expiry |
| Change SL/TP on an open position |
| Change price, SL or TP on a pending order |
| Full or partial close |
| Remove a pending order |
| Close everything, or only one symbol |
⚠️ There is no demo/real guard on the trading tools. Orders go to whichever account the terminal is logged into. The broker's filling mode is detected automatically and the symbol is added to Market Watch as needed.
CLI (trade.py)
The same tools without Claude, straight from the command line:
.venv/Scripts/python.exe trade.py buy XAUUSD 0.01 --sl-points 500 --tp-points 1000
.venv/Scripts/python.exe trade.py modify 10090941191 --sl 4345.56 --tp 4360.56
.venv/Scripts/python.exe trade.py close 10090941191
.venv/Scripts/python.exe trade.py close-all --symbol XAUUSD
.venv/Scripts/python.exe trade.py positions
.venv/Scripts/python.exe trade.py calc buy XAUUSD 0.01 --close-price 4360Run trade.py --help for every subcommand.
Time format
All time inputs are UTC: YYYY-MM-DD, YYYY-MM-DD HH:MM, or
YYYY-MM-DD HH:MM:SS. Output timestamps are UTC as well.
Configuration
These environment variables are optional in .mcp.json:
Variable | Purpose |
| Path to |
| Log into a different account (default: whatever the terminal already uses) |
Smoke test
.venv/Scripts/python.exe -c "import mt5_mcp_server as s; print(s.mt5_status()['account'])"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.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceEnables comprehensive access to the MetaTrader 5 trading platform for retrieving market data, managing accounts, and executing trading operations. It provides 32 specialized tools for interacting with MT5 functionalities, including historical OHLCV data access, real-time position monitoring, and automated order management.1MIT
- AlicenseNot gradedqualityCmaintenanceEnables users to capture real MetaTrader 5 chart snapshots with custom indicators and fetch market data through natural language in Claude Desktop.2MIT
- AlicenseNot gradedqualityCmaintenanceEnables interaction with MetaTrader 5 for market data, technical analysis, Fibonacci calculations, and trading via MCP clients such as Claude.MIT
- FlicenseAqualityDmaintenanceEnables Claude AI to perform forex trading operations and market data analysis through MetaTrader 5, including order placement, position management, and multi-timeframe candle data retrieval.16
Related MCP Connectors
Connect any MCP client to MetaTrader 4/5 to read prices, manage positions, and place trades.
Global stock research, ML forecasts, valuation signals, screeners & portfolio tracking in Claude
Trade Robinhood through natural language in Claude Code.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- 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/tradingmavenfx-cmd/mt5-tradingview-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server