Skip to main content
Glama
HostMT5 MCP server

HostMT5 MCP server

HostMT5 MCP server

HostMT5 MCP server MCP server – quality and maintenance score on Glama

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

  1. Create a free account at hostmt5.com and add an MT5 account.

  2. 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

HostMT5 hosts the MCP server itself. Nothing to install.

URL

https://hostmt5.com/mcp with header Authorization: Bearer mc_your_key (Streamable HTTP)

URL-only apps

https://hostmt5.com/mcp/mc_your_key. The URL then is the password, so keep it private.

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_key

Cursor (~/.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

HOSTMT5_KEY

yes

none (Dashboard → AI & API)

HOSTMT5_URL

no

https://hostmt5.com

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

get_overview (start here: plan, accounts, copy links), get_account, add_account, relogin_account, power_account (start or stop a hosted terminal), remove_account, get_stats (profit, win rate, profit factor, drawdown)

Trading control

stop_trading (kill switch: Algo Trading off, webhook and copy paused, optionally close everything), resume_trading

Market data

find_symbols, symbol_info, get_quotes, get_bars (M1 to MN1), get_ticks

Positions, orders, history

get_positions, get_orders, get_history, place_order (market, limit, stop; real on live accounts), modify_position, close_position (full or partial), close_positions, cancel_order

Expert Advisors

list_eas, upload_ea (MQL5 source compiled on the server, errors with line numbers; or a .ex5), get_ea_source, ea_inputs, attach_ea, set_ea_inputs, remove_ea, get_logs (Experts and Journal)

Copy trading

start_copying (multiplier, fixed, balance, equity, risk and more; max lot, reverse), update_copying (change, pause, resume), stop_copying

TradingView webhooks

get_webhooks, create_webhook, webhook_settings, send_signal

Alerts

get_alerts, set_alerts (email, Telegram, auto-restart, drawdown and margin level)

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 tools
account_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

    B3.2/5.0

    Scored across 21 tools

    Disambiguation4/5

    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.

    Naming Consistency4/5

    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.

    Tool Count4/5

    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.

    Completeness4/5

    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

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables 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.
      23
      MIT
    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables AI applications to interact with MetaTrader 5 terminals via WebSocket MCP protocol for trading operations and account management.
      4
      -
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables interaction with MetaTrader 5 for market data, technical analysis, Fibonacci calculations, and trading via MCP clients such as Claude.
      MIT
    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables trading on MetaTrader5 platform via MCP, including account management, order placement, market data, technical indicators, and signal tools.
      6
      -