ClawKit Logo
ClawKitReliability Toolkit
Back to Registry
Official Verified

mt5-httpapi

MetaTrader 5 trading via REST API — get market data, place/modify/close orders, manage positions, pull history. Use when you need to interact with forex/crypto/stock markets through MT5.

skill-install — Terminal

Install via CLI (Recommended)

clawhub install openclaw/skills/skills/psyb0t/mt5-httpapi
Or

mt5-httpapi

A REST API sitting on top of MetaTrader 5 running inside a Windows VM. You talk to it with plain HTTP/JSON — no MT5 libraries, no Windows, no bullshit. Just curl and go.

When To Use This Skill

  • You need market data (candles, ticks, symbol info)
  • You need to place, modify, or close trades
  • You need account info (balance, equity, margin)
  • You need to check open positions or pending orders
  • You need trade/deal history

When NOT To Use This Skill

  • Technical analysis calculations — do that yourself with the raw candle/tick data
  • Charting or visualization — this gives you data, not pictures
  • Backtesting — this is live/demo trading only

Setup

The API should already be running. Set the base URL:

export MT5_API_URL=http://localhost:6542

Or via OpenClaw config (~/.openclaw/openclaw.json):

{
  "skills": {
    "entries": {
      "mt5-httpapi": {
        "env": {
          "MT5_API_URL": "http://localhost:6542"
        }
      }
    }
  }
}

Verify: curl $MT5_API_URL/ping — if it responds, you're good. If it doesn't, the API isn't running. Tell the user to set it up: https://github.com/psyb0t/docker-metatrader5-httpapi

How It Works

Standard REST API. GET for reading, POST for creating, PUT for modifying, DELETE for closing/canceling. All request/response bodies are JSON.

Every error response looks like:

{"error": "description of what went wrong"}

API Reference

Health

# Is the API alive?
curl $MT5_API_URL/ping

Response:

{"status": "ok"}
# Last MT5 error (useful for debugging failed trades)
curl $MT5_API_URL/error

Response:

{"code": 1, "message": "Success"}

Terminal

# Get terminal info
curl $MT5_API_URL/terminal

Response:

{
    "build": 5602,
    "codepage": 0,
    "commondata_path": "C:\\Users\\Docker\\AppData\\Roaming\\MetaQuotes\\Terminal\\Common",
    "community_account": false,
    "community_balance": 0.0,
    "community_connection": false,
    "company": "Your Broker Inc.",
    "connected": true,
    "data_path": "C:\\Users\\Docker\\Desktop\\Shared\\mybroker",
    "dlls_allowed": true,
    "email_enabled": false,
    "ftp_enabled": false,
    "language": "English",
    "maxbars": 100000,
    "mqid": false,
    "name": "MyBroker MetaTrader 5",
    "notifications_enabled": false,
    "path": "C:\\Users\\Docker\\Desktop\\Shared\\mybroker",
    "ping_last": 0,
    "retransmission": 0.003,
    "trade_allowed": true,
    "tradeapi_disabled": false
}

The most useful fields here: connected (is it connected to the broker), trade_allowed (can we trade), company (which broker).

# Initialize MT5 connection (usually auto-done, but use this if you get "MT5 not initialized" errors)
curl -X POST $MT5_API_URL/terminal/init

Response:

{"success": true}
# Shut down MT5
curl -X POST $MT5_API_URL/terminal/shutdown

Response:

Metadata

Author@psyb0t
Stars1171
Views0
Updated2026-02-19
View Author Profile
AI Skill Finder

Not sure this is the right skill?

Describe what you want to build — we'll match you to the best skill from 16,000+ options.

Find the right skill
Add to Configuration

Paste this into your clawhub.json to enable this plugin.

{
  "plugins": {
    "official-psyb0t-mt5-httpapi": {
      "enabled": true,
      "auto_update": true
    }
  }
}
Safety NoteClawKit audits metadata but not runtime behavior. Use with caution.