HostMT5 MCP server
This MCP server lets an assistant inspect and operate hosted MetaTrader 5 accounts through tool calls.
View plan, accounts, copy links, account balance/equity/margin, open positions, pending orders, and market quotes.
Retrieve OHLC price history and closed trade history.
Search broker symbols and add/remove symbols from Market Watch.
Place market and pending orders; modify positions, close positions, and cancel pending orders.
List, upload, inspect inputs for, attach, reconfigure, and remove Expert Advisors.
Start, pause/resume, or stop copy-trading links between accounts.
Start or stop a hosted MT5 terminal.
Configures account alerts to be delivered via Telegram, including drawdown and margin-level notifications.
Provides TradingView webhook integration for MT5 accounts: manage webhooks, configure webhook settings, and send signals to trigger trading actions.
Click on "Deploy 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., "@HostMT5 MCP server What's open on my demo account, and what's the floating P&L?"
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.
HostMT5 MCP server
An MCP server for MetaTrader 5. It lets Claude, ChatGPT, Cursor, VS Code and other MCP clients work with your MT5 accounts hosted on HostMT5: read accounts, prices and history, trade, write MQL5 Expert Advisors and compile, run and tune them, read their logs, stop and resume trading, and set up copy trading, TradingView webhooks and alerts.
HostMT5 runs a real MT5 terminal for each account in the cloud, so your EAs keep trading 24/7 without your PC. It works with any broker that offers MT5, demo or live. HostMT5 is free during launch (up to 3 MT5 accounts, no card).
⚠️ Orders placed on a live account are real. The trading tools say so in their descriptions. Start on a demo account, or use a read-only key.
Get a key
Create a free account at hostmt5.com and add an MT5 account.
In the dashboard, open AI & API and create an API key (
mc_...).
A read-only key gives the assistant only the read tools: use one when you want analysis without any chance of a trade.
Related MCP server: metatrader5-mcp-server
Connect: remote URL (recommended)
HostMT5 hosts the MCP server itself. Nothing to install.
URL |
|
URL-only apps |
|
Claude Code
claude mcp add --transport http hostmt5 https://hostmt5.com/mcp --header "Authorization: Bearer mc_your_key"Claude.ai and ChatGPT
Claude.ai: Settings → Connectors → Add custom connector
ChatGPT: Settings → Connectors → Advanced → Developer mode → Create
Server URL: https://hostmt5.com/mcp/mc_your_keyCursor (~/.cursor/mcp.json)
{
"mcpServers": {
"hostmt5": {
"url": "https://hostmt5.com/mcp",
"headers": { "Authorization": "Bearer mc_your_key" }
}
}
}VS Code (.vscode/mcp.json)
{
"servers": {
"hostmt5": {
"type": "http",
"url": "https://hostmt5.com/mcp",
"headers": { "Authorization": "Bearer mc_your_key" }
}
}
}Connect: local stdio bridge (for apps that only run local servers)
Some apps, such as Claude Desktop with a JSON config, only start MCP servers as local commands. This repo is a small stdio bridge for them: it forwards every message to https://hostmt5.com/mcp, so you always get the current tools. Python 3.8+, no dependencies.
With uv (Claude Desktop: Settings → Developer → Edit config)
{
"mcpServers": {
"hostmt5": {
"command": "uvx",
"args": ["--from", "git+https://github.com/jayadevrana/hostmt5-mcp", "hostmt5-mcp"],
"env": { "HOSTMT5_KEY": "mc_your_key" }
}
}
}Without uv: download hostmt5_mcp.py (or the same bridge from the HostMT5 docs, mcp_server.py) and run it with Python:
{
"mcpServers": {
"hostmt5": {
"command": "python",
"args": ["C:/Users/you/Downloads/hostmt5_mcp.py"],
"env": { "HOSTMT5_KEY": "mc_your_key" }
}
}
}Variable | Required | Default |
| yes | none (Dashboard → AI & API) |
| no |
|
Without a valid key the bridge still answers initialize and tools/list, so clients and directories can inspect it; every tool call then returns the key error.
Tools (39)
Every tool takes the account_id from get_overview where it acts on one account.
Area | Tools |
Account and plan |
|
Trading control |
|
Market data |
|
Positions, orders, history |
|
Expert Advisors |
|
Copy trading |
|
TradingView webhooks |
|
Alerts |
|
The live list with descriptions: hostmt5.com/docs#mcp.
Things to ask your assistant
"Show my open positions on every account, and the floating P&L."
"Show me the last 200 H1 bars of XAUUSD and summarise the trend."
"Write an EA that buys XAUUSD on an H1 RSI cross under 30, compile it and attach it to my demo with 0.01 lots."
"Stop all trading on my real account and close everything."
"Copy account 1 to account 3 at half size."
How it works
Every tool is one call to the HostMT5 API with your key, so the assistant gets exactly the checks, limits and key scope the dashboard has. If you add an MT5 account through add_account, the assistant sees the password you give it; add accounts in the dashboard instead to keep the password out of the chat.
More: Let an AI assistant work with your MT5 account · Run an MT5 EA 24/7 without your PC · Free MT5 VPS · API docs
Licence
MIT. MetaTrader is a trademark of MetaQuotes, which does not endorse HostMT5. HostMT5 provides no investment advice.
Available Tools
21 toolsaccount_powerC
Start or stop a hosted terminal (stopping pauses its EAs).
Inputs: on (required), account_id (required).
account_stateC
Balance, equity, margin, open positions, pending orders and live Market Watch quotes of one account.
Inputs: account_id (required).
attach_eaB
Attach an EA (name as list_eas shows it, e.g. 'Uploaded\MyEA') to its own chart; it trades 24/7 and starts in ~1-2 s. inputs: values that differ from the defaults, e.g. {"Lots": "0.05"} (names from ea_inputs).
Inputs: name (required), symbol (required), account_id (required), inputs, +1 more.
cancel_orderC
Delete a pending order.
Inputs: ticket (required), account_id (required).
close_positionC
Close a position (volume 0 = all of it, or a partial volume).
Inputs: ticket (required), account_id (required), volume.
ea_inputsB
An EA's inputs and their defaults BEFORE attaching it (like MT5's Inputs tab). name as list_eas shows it.
Inputs: name (required), account_id (required), symbol.
find_symbolsA
Search the broker's symbol list (name or description contains text). Use watch_symbol to get quotes for one.
Inputs: text (required), account_id (required).
list_easC
Compiled EAs available in the terminal, and the ones attached (with id, chart, default and changed inputs).
Inputs: account_id (required).
market_orderB
Open a position at market. side: buy or sell. sl/tp are prices (0 = none). REAL order on a live account.
Inputs: side (required), symbol (required), volume (required), account_id (required), +3 more.
modify_positionB
Set a position's stop loss and take profit (prices; 0 removes it).
Inputs: ticket (required), account_id (required), sl, tp.
overviewC
Plan (slots, paid until), every hosted MT5 account (id, label, login, server, status), copy-trading links and recent copy activity.
Inputs: no named parameters.
pause_copyingC
Pause or resume one copy link (ids are in overview().links).
Inputs: link_id (required), paused.
pending_orderB
Place a pending order. kind: 'buy limit', 'sell limit', 'buy stop' or 'sell stop'. REAL order on a live account.
Inputs: kind (required), price (required), symbol (required), volume (required), +3 more.
price_historyB
OHLC bars. timeframe: M1 M5 M15 M30 H1 H4 D1 W1 MN1. Each bar has time (unix), open, high, low, close, tick_volume, spread.
Inputs: symbol (required), account_id (required), count, timeframe.
remove_eaB
Detach one EA; the account's other EAs keep running.
Inputs: ea_id (required), account_id (required).
set_ea_inputsA
Change an attached EA's inputs, e.g. {"Lots": "0.05"}. Names must be the EA's own (see list_eas). Only that EA restarts (~1 s).
Inputs: ea_id (required), inputs (required), account_id (required).
start_copyingB
Copy every new trade of the master to the follower. mode 'multiplier' (lot x value) or 'fixed' (value lots); max_lot caps it.
Inputs: master_account_id (required), follower_account_id (required), mode, value, +2 more.
stop_copyingB
Remove a copy link. Positions already copied stay open on the follower.
Inputs: link_id (required).
trade_historyC
Closed deals of the last 30 days (deposits, opens, closes with profit).
Inputs: account_id (required).
upload_eaA
Upload an EA from this computer: compiled .ex5, or .mq5 source (compiled on the server; errors come back). Then attach_ea.
Inputs: file_path (required), account_id (required).
watch_symbolB
Add (show=True) or remove a symbol from the account's Market Watch, so its quotes stream.
Inputs: symbol (required), account_id (required), show.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 21 tools
Most tools map to a distinct resource+action pair: account_state vs overview differ by granularity, market_order vs pending_order by execution type, and the EA tools (list/upload/inputs/attach/set/remove) each cover a unique step. The main soft spots are overview vs account_state and pause_copying vs stop_copying, but the descriptions make the boundaries readable. No two tools appear to do the same thing.
Everything is snake_case with no camelCase or casing drift, which is a solid baseline. The deviation is grammatical: some names are verb_noun (find_symbols, close_position, start_copying) while others are noun phrases (overview, price_history, market_order, account_power), so the pattern is predictable but not uniform.
21 tools is on the heavy side of the ideal 3-15 band, but the surface spans four distinct subdomains (trading, EA lifecycle, copy trading, account hosting), and each domain needs its own small set. Each tool appears to earn its place, though a few could plausibly be merged.
Trading lifecycle is well covered (quotes, history, market/pending entry, modify SL/TP, partial close, cancel), and EA plus copy-trading lifecycle is complete end-to-end. The notable gap is that pending orders cannot be modified (only cancelled and re-placed), and there is no tool to adjust an existing copy link's parameters short of stopping it.
Maintenance
Related MCP Connectors
Connect any MCP client to MetaTrader 4/5 to read prices, manage positions, and place trades.
Hosted MT5 MCP server: live MetaTrader 5 balance, positions, history, charts and optional trading.
Hosted MCP server for MT4 and MT5: read accounts, prices and candles, and place or close orders.
Hosted MCP server for MetaTrader 5. Connect any MT5 broker login and Pipwire runs the terminal around the clock, so nothing has to run on your own computer or VPS. 11 reading tools (accounts, positions, pending orders, deal and order history, live prices, candles, symbols) and 5 trading tools (market, limit, stop and stop-limit orders with stop loss and take profit, partial close, moving stops, changing and cancelling pending orders). Trading is off for every key until you turn it on: ask before each trade, or trade freely. The same accounts get a REST and WebSocket API and a trade copier. Not affiliated with MetaQuotes.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceEnables access to MetaTrader5 market data and trading functionality, including real-time quotes, historical OHLCV data, tick data, symbol information, and technical indicators for forex and other trading instruments.23MIT
- FlicenseNot gradedqualityDmaintenanceEnables AI applications to interact with MetaTrader 5 terminals via WebSocket MCP protocol for trading operations and account management.4-
- AlicenseNot gradedqualityDmaintenanceEnables interaction with MetaTrader 5 for market data, technical analysis, Fibonacci calculations, and trading via MCP clients such as Claude.MIT
- FlicenseNot gradedqualityDmaintenanceEnables trading on MetaTrader5 platform via MCP, including account management, order placement, market data, technical indicators, and signal tools.6-