Home › Guides

Let an AI assistant work with your MT5 account

Updated 2026-11-26 · HostMT5 guides

AI assistants can call tools through the Model Context Protocol (MCP). HostMT5 runs a remote MCP server that turns your whole HostMT5 account into tools, so Claude, ChatGPT, Cursor, VS Code or any MCP client can read prices and history, trade, write and run Expert Advisors, stop and resume trading, and set up copy trading, webhooks and alerts.

Safety first: orders placed by an assistant are real on live accounts. Start on a demo account, keep a human in the loop for anything that trades, and use a Read-only key when the assistant only needs to look.

What the assistant can do

AreaTools
Accountsget_overview, get_account, add_account, relogin_account, power_account, remove_account, get_stats
Stop / resumestop_trading (Algo Trading off, webhook and incoming copy trading paused, optionally close everything), resume_trading
Market datafind_symbols, symbol_info, get_quotes, get_bars, get_ticks
Tradingget_positions, get_orders, get_history, place_order, modify_position, close_position, close_positions, cancel_order
Expert Advisorslist_eas, upload_ea (MQL5 source compiled on the server, errors with line numbers), get_ea_source, ea_inputs, attach_ea, set_ea_inputs, remove_ea, get_logs
Copy tradingstart_copying, update_copying, stop_copying
Webhooks and alertsget_webhooks, create_webhook, webhook_settings, send_signal, get_alerts, set_alerts

Every tool goes through the same checks as the website. Removing an account needs an explicit confirmation, and a read-only key only shows the read tools.

Setup

  1. Sign up (currently free) and add your MT5 account.
  2. In the dashboard, open the AI & API tab and create a key: Trading or Read-only. It is shown once; store it safely.
  3. Connect your assistant to https://hostmt5.com/mcp with the header Authorization: Bearer mc_your_key.

Claude Code:

claude mcp add --transport http hostmt5 https://hostmt5.com/mcp --header "Authorization: Bearer mc_your_key"

Cursor (~/.cursor/mcp.json):

{
  "mcpServers": {
    "hostmt5": {
      "url": "https://hostmt5.com/mcp",
      "headers": { "Authorization": "Bearer mc_your_key" }
    }
  }
}

Claude.ai and ChatGPT connectors take only a URL: use https://hostmt5.com/mcp/mc_your_key (that URL is then the password, so keep it private). Claude Desktop can run the small mcp_server.py bridge (Python 3.8+, no packages). VS Code and the other clients are in the docs.

Example prompts

Developer API

The same keys work for your own code in any language: REST at https://hostmt5.com/api/v1 for history, ticks, symbols and orders, and a live WebSocket stream for prices, candles and account changes. Python and JavaScript clients, examples and the OpenAPI description are in the API docs. Keys can be revoked from the dashboard at any time, and a key cannot create new keys.

Related

FAQ

What is MCP?

The Model Context Protocol is an open standard that lets AI assistants call tools. HostMT5 ships an MCP server that exposes your hosted MT5 accounts as tools.

Can the AI place real trades?

Yes on live accounts, through the same checks as the website. The trading tools say so; start on a demo account.

Where do I get the API key?

In the HostMT5 dashboard, AI & API tab: create a Trading or a Read-only key. A read-only key cannot place or change anything.

Do I need to install anything?

No for Claude.ai, ChatGPT, Claude Code, Cursor and VS Code: they connect to https://hostmt5.com/mcp directly. Claude Desktop can use the small mcp_server.py bridge (Python, no packages).

Can the AI write and run an Expert Advisor?

Yes. It can send MQL5 source, which HostMT5 compiles on the server (errors come back with line numbers), attach the EA to a chart with its inputs, read its logs, change inputs and remove it.

Host your MT5 in the cloud, free

Real MetaTrader 5 in any browser. EAs 24/7, copy trading, TradingView webhooks. No card needed.

Start free →
More guides

All guides · HostMT5 facts