fxapis — MetaTrader 5
Measured conclusion: Deep-tested. L2 outcome: tools_ok.
Let AI agents trade and read MetaTrader 5 accounts. Hosted — no terminal for you to run.
| Author | com.fxapis |
|---|---|
| Access | remote |
| Publisher key required | No |
| Measured state | Deep-tested |
| L1 liveness | alive |
| L1 latency | 210 ms |
| Last measured | 2026-10-24 |
Add to your agent
Copy this into your MCP client config:
{
"mcpServers": {
"fxapis — MetaTrader 5": {
"url": "https://api.fxapis.com/mcp",
"transport": "streamable-http"
}
}
}
Measured tools (29)
get_workspaceread-onlyThis connection's workspace: its plan, the plan's limits and features, and whether trading is switched off. Call it first when unsure what the user can do. Example: {}
Parameters:
response_format— string — concise (default): what a next step needs. detailed: every field the API returns.
Hints: read-only yes · destructive no · idempotent yes · open-world no
get_usageread-onlyThis month's usage against the plan, and its cost so far in minor units (9900 is $99.00). Over quota opening is refused, closing never is. Example: {}
Parameters:
response_format— string — concise (default): what a next step needs. detailed: every field the API returns.
Hints: read-only yes · destructive no · idempotent yes · open-world no
list_accountsread-onlyThe workspace's MT5 accounts with id, login, server, state and environment (demo or live); use the id, not the login, everywhere else. Only `ready` accounts trade, so bring the others online first. Example: {"limit": 25}
Parameters:
limit— integer — Items per page, 1–100. Default 25.cursor— string — next_cursor from the previous page.response_format— string — concise (default): what a next step needs. detailed: every field the API returns.
Hints: read-only yes · destructive no · idempotent yes · open-world no
get_accountread-onlyOne account: login, broker, state, environment, and its last-read balance, equity and free margin. Example: {"account_id": "<id from list_accounts>"}
Parameters:
account_id(required) — string — The fxapis account id (a UUID) from list_accounts — not the MT5 login number.response_format— string — concise (default): what a next step needs. detailed: every field the API returns.
Hints: read-only yes · destructive no · idempotent yes · open-world no
get_account_statusread-onlyJust an account's state, cheap enough to poll every few seconds after bring_accounts_online until `ready`. States invalid_credentials, needs_2fa, needs_certificate and trading_disabled need the user, so stop polling. Example: {"account_id": "<id>"}
Parameters:
account_id(required) — string — The fxapis account id (a UUID) from list_accounts — not the MT5 login number.response_format— string — concise (default): what a next step needs. detailed: every field the API returns.
Hints: read-only yes · destructive no · idempotent yes · open-world no
get_account_figuresread-onlyBalance, equity, margin, free margin and margin level as decimal strings in the account currency, read every 15 s while online. Set fresh to ask the terminal now (the account must be `ready`). Example: {"account_id": "<id>", "fresh": true}
Parameters:
account_id(required) — string — The fxapis account id (a UUID) from list_accounts — not the MT5 login number.fresh— boolean — True to ask the terminal now instead of using the last read.response_format— string — concise (default): what a next step needs. detailed: every field the API returns.
Hints: read-only yes · destructive no · idempotent yes · open-world yes
bring_accounts_onlineStarts each account's MT5 terminal in the cloud and logs it in; poll get_account_status until `ready`. Places no trades and is safe to repeat. Example: {"account_ids": ["<id>"]}
Parameters:
account_ids(required) — array — One or more account ids.
Hints: read-only no · destructive no · idempotent yes · open-world yes
take_account_offlineStops an account's terminal; open positions and their stops stay at the broker. Refused while an order is in flight. Example: {"account_id": "<id>"}
Parameters:
account_id(required) — string — The fxapis account id (a UUID) from list_accounts — not the MT5 login number.
Hints: read-only no · destructive no · idempotent yes · open-world yes
list_positionsread-onlyOpen positions on one account as last observed; brokerPositionId is what close_position and modify_position take. Pages with limit and cursor. Example: {"account_id": "<id>"}
Parameters:
account_id(required) — string — The fxapis account id (a UUID) from list_accounts — not the MT5 login number.limit— integer — Items per page, 1–100. Default 25.cursor— string — next_cursor from the previous page.include_closed— boolean — Also return positions that have closed. Default false.response_format— string — concise (default): what a next step needs. detailed: every field the API returns.
Hints: read-only yes · destructive no · idempotent yes · open-world no
list_instrumentsread-onlyMarkets named once (XAUUSD, US30, BTCUSD) whatever each broker calls them. list_account_instruments gives one account's own symbol for each. Example: {"category": "metals"}
Parameters:
category— string — Only this category.response_format— string — concise (default): what a next step needs. detailed: every field the API returns.
Hints: read-only yes · destructive no · idempotent yes · open-world no
search_broker_serversread-onlyMT5 broker servers matching a broker or server name, servers seen working on fxapis first. A server not listed can still be used. Example: {"query": "icmarkets"}
Parameters:
query(required) — string — A broker's name or the start of a server name, e.g. 'justmarkets' or 'VantageInternational-Live'.response_format— string — concise (default): what a next step needs. detailed: every field the API returns.
Hints: read-only yes · destructive no · idempotent yes · open-world no
list_account_instrumentsread-onlyEach instrument's symbol on this account's broker: mapped, ambiguous (with candidates) or missing. Trade the mapped symbol. Example: {"account_id": "<id>", "query": "XAU"}
Parameters:
account_id(required) — string — The fxapis account id (a UUID) from list_accounts — not the MT5 login number.limit— integer — Items per page, 1–100. Default 25.query— string — Only instruments or symbols containing this, e.g. XAU.cursor— string — next_cursor from the previous page.response_format— string — concise (default): what a next step needs. detailed: every field the API returns.
Hints: read-only yes · destructive no · idempotent yes · open-world no
get_market_hoursread-onlyWhether a market is open now on this account's broker, and when it next opens or closes, in UTC. A broker holiday missing from its schedule still refuses orders. Example: {"account_id": "<id>", "instrument": "XAUUSD"}
Parameters:
account_id(required) — string — The fxapis account id (a UUID) from list_accounts — not the MT5 login number.symbol— string — Or the broker's own symbol.instrument— string — An instrument from list_instruments, e.g. XAUUSD.response_format— string — concise (default): what a next step needs. detailed: every field the API returns.
Hints: read-only yes · destructive no · idempotent yes · open-world no
get_quotesread-onlyLive bid and ask for up to 20 symbols or instruments from this account's broker; a closed market answers its last price with marketOpen false. The account must be online. Example: {"account_id": "<id>", "instruments": ["EURUSD"]}
Parameters:
account_id(required) — string — The fxapis account id (a UUID) from list_accounts — not the MT5 login number.symbols— array — Broker symbols, exactly as this broker names them.instruments— array — Instruments; each is quoted as this account's own symbol for it.response_format— string — concise (default): what a next step needs. detailed: every field the API returns.
Hints: read-only yes · destructive no · idempotent yes · open-world yes
list_ordersread-onlyOrders placed through fxapis, newest first, for one account or all; state `unknown` means still being confirmed, so never resend those. Pages with cursor. Example: {"state": "unknown"}
Parameters:
limit— integer — Rows per page, 1–200. Default 25.since— string — ISO 8601 date-time; only rows at or after it.state— string — Only orders in this state.until— string — ISO 8601 date-time; only rows at or before it.cursor— string — `nextCursor` from the previous page.symbol— string — The symbol exactly as this broker names it, e.g. "EURUSD" — some brokers add a suffix such as "EURUSD.r".account_id— string — The fxapis account id (a UUID) from list_accounts — not the MT5 login number.response_format— string — concise (default): what a next step needs. detailed: every field the API returns.
Hints: read-only yes · destructive no · idempotent yes · open-world no
get_orderread-onlyThe authoritative record of one order: what was asked, the broker's answer, fill volume and price. Poll it after ORDER_UNRESOLVED until it leaves `unknown`. Example: {"order_id": "<id>", "include_deals": true}
Parameters:
order_id(required) — string — The fxapis order id.include_deals— boolean — Also return the deals this order produced. Needs history:read.response_format— string — concise (default): what a next step needs. detailed: every field the API returns.
Hints: read-only yes · destructive no · idempotent yes · open-world no
list_dealsread-onlyAn account's deal history as the broker recorded it, newest first, including stops that fired, swaps and manual trades. Realised profit is here. Example: {"account_id": "<id>", "since": "2026-10-01T00:00:00Z"}
Parameters:
account_id(required) — string — The fxapis account id (a UUID) from list_accounts — not the MT5 login number.limit— integer — Rows per page, 1–200. Default 25.since— string — ISO 8601 date-time; only rows at or after it.until— string — ISO 8601 date-time; only rows at or before it.cursor— string — `nextCursor` from the previous page.symbol— string — The symbol exactly as this broker names it, e.g. "EURUSD" — some brokers add a suffix such as "EURUSD.r".response_format— string — concise (default): what a next step needs. detailed: every field the API returns.
Hints: read-only yes · destructive no · idempotent yes · open-world no
calculateread-onlyThe margin an order would need, or its profit between two prices, as the broker computes it; opens nothing. The account must be online. Example: {"account_id": "<id>", "kind": "margin", "symbol": "EURUSD", "side": "buy", "volume": "0.10", "price": "1.08450"}
Parameters:
account_id(required) — string — The fxapis account id (a UUID) from list_accounts — not the MT5 login number.kind(required) — string — margin: required to open. profit: result between price and close_price.symbol(required) — string — The symbol exactly as this broker names it, e.g. "EURUSD" — some brokers add a suffix such as "EURUSD.r".side(required) — string — buy or sell.volume(required) — Order size. In lots, preferably as a string: "0.01" is a micro lot, "1.00" a standard lot.price(required) — Entry price. An absolute price (e.g. "1.08450"), not a distance in pips or points.close_price— Exit price. Required when kind is profit. An absolute price (e.g. "1.08450"), not a distance in pips or points.response_format— string — concise (default): what a next step needs. detailed: every field the API returns.
Hints: read-only yes · destructive no · idempotent yes · open-world yes
place_market_orderdestructiveOpens a position at market on the user's real broker account (or demo) and waits for the broker; confirm account, symbol, side and volume with the user first. On ORDER_UNRESOLVED never resend, poll get_order. Example: {"account_id": "<id>", "symbol": "EURUSD", "side": "buy", "volume": "0.10", "idempotency_key": "<new uuid>"}
Parameters:
account_id(required) — string — The fxapis account id (a UUID) from list_accounts — not the MT5 login number.symbol(required) — string — The symbol exactly as this broker names it, e.g. "EURUSD" — some brokers add a suffix such as "EURUSD.r".side(required) — string — buy or sell.volume(required) — Order size. In lots, preferably as a string: "0.01" is a micro lot, "1.00" a standard lot.idempotency_key(required) — string — A unique string you generate for THIS action, e.g. a fresh UUID. If a call fails or times out and you retry the same action, send the SAME key: fxapis then returns the first result instead of acting twice. Use a new key only for a genuinely new action.comment— string — Optional note stored on the order. MT5 keeps the first 17 characters after our reference.stop_loss— Optional stop loss. Below entry for a buy, above for a sell. An absolute price (e.g. "1.08450"), not a distance in pips or points.take_profit— Optional take profit. Above entry for a buy, below for a sell. An absolute price (e.g. "1.08450"), not a distance in pips or points.client_order_id— string — Optional reference of your own, echoed back on the order.deviation_points— integer — Maximum slippage in points. Too small invites requotes.
Hints: read-only no · destructive yes · idempotent yes · open-world yes
place_pending_orderdestructivePlaces a limit or stop order on the user's real broker account (or demo) that waits at the broker; success means working, not filled. Confirm it with the user first. Example: {"account_id": "<id>", "symbol": "EURUSD", "side": "buy", "kind": "limit", "volume": "0.10", "price": "1.08000", "idempotency_key": "<new uuid>"}
Parameters:
account_id(required) — string — The fxapis account id (a UUID) from list_accounts — not the MT5 login number.symbol(required) — string — The symbol exactly as this broker names it, e.g. "EURUSD" — some brokers add a suffix such as "EURUSD.r".side(required) — string — buy or sell.kind(required) — string — limit, stop or stop_limit.volume(required) — Order size. In lots, preferably as a string: "0.01" is a micro lot, "1.00" a standard lot.price(required) — The price the order waits at. An absolute price (e.g. "1.08450"), not a distance in pips or points.idempotency_key(required) — string — A unique string you generate for THIS action, e.g. a fresh UUID. If a call fails or times out and you retry the same action, send the SAME key: fxapis then returns the first result instead of acting twice. Use a new key only for a genuinely new action.comment— string — Optional note stored on the order. MT5 keeps the first 17 characters after our reference.stop_loss— Optional stop loss. An absolute price (e.g. "1.08450"), not a distance in pips or points.expires_at— string — When the broker should drop it. Omit for good-till-cancelled.take_profit— Optional take profit. An absolute price (e.g. "1.08450"), not a distance in pips or points.client_order_id— string — Optional reference of your own, echoed back on the order.stop_limit_price— Required for stop_limit: the limit placed once the stop triggers. An absolute price (e.g. "1.08450"), not a distance in pips or points.
Hints: read-only no · destructive yes · idempotent yes · open-world yes
close_positiondestructiveCloses a position on the user's real broker account (or demo), whole or by volume. Sent twice it opens the opposite position, so reuse an idempotency_key only to retry the same close. Example: {"account_id": "<id>", "position_id": "<brokerPositionId>", "idempotency_key": "<new uuid>"}
Parameters:
account_id(required) — string — The fxapis account id (a UUID) from list_accounts — not the MT5 login number.position_id(required) — string — The position ticket: `brokerPositionId` from list_positions.idempotency_key(required) — string — A unique string you generate for THIS action, e.g. a fresh UUID. If a call fails or times out and you retry the same action, send the SAME key: fxapis then returns the first result instead of acting twice. Use a new key only for a genuinely new action.volume— Optional: how much to close. Omit to close the whole position. In lots, preferably as a string: "0.01" is a micro lot, "1.00" a standard lot.comment— string — Optional note stored on the order. MT5 keeps the first 17 characters after our reference.client_order_id— string — Optional reference of your own, echoed back on the order.deviation_points— integer — Maximum slippage in points.
Hints: read-only no · destructive yes · idempotent yes · open-world yes
modify_positiondestructiveMoves a position's stop loss or take profit on the user's real broker account (or demo); null removes a level. Remove a stop loss only when the user asks. Example: {"account_id": "<id>", "position_id": "<brokerPositionId>", "stop_loss": "1.08000", "idempotency_key": "<new uuid>"}
Parameters:
account_id(required) — string — The fxapis account id (a UUID) from list_accounts — not the MT5 login number.position_id(required) — string — The position ticket: `brokerPositionId` from list_positions.idempotency_key(required) — string — A unique string you generate for THIS action, e.g. a fresh UUID. If a call fails or times out and you retry the same action, send the SAME key: fxapis then returns the first result instead of acting twice. Use a new key only for a genuinely new action.stop_losstake_profit
Hints: read-only no · destructive yes · idempotent yes · open-world yes
cancel_orderdestructiveCancels a pending order on the user's real broker account (or demo) that has not triggered. If it triggered there is a position to close instead. Example: {"order_id": "<id>", "idempotency_key": "<new uuid>"}
Parameters:
order_id(required) — string — The fxapis id of the pending order.idempotency_key(required) — string — A unique string you generate for THIS action, e.g. a fresh UUID. If a call fails or times out and you retry the same action, send the SAME key: fxapis then returns the first result instead of acting twice. Use a new key only for a genuinely new action.
Hints: read-only no · destructive yes · idempotent yes · open-world yes
list_multi_account_ordersread-onlyRecent multi-account orders (one trade on many accounts), each with its per-account result. Pages with limit and cursor. Example: {}
Parameters:
limit— integer — Items per page, 1–100. Default 25.cursor— string — next_cursor from the previous page.response_format— string — concise (default): what a next step needs. detailed: every field the API returns.
Hints: read-only yes · destructive no · idempotent yes · open-world no
get_multi_account_orderread-onlyOne multi-account order and each account's result; poll it after placing one. An account left `unresolved` must not be resent, so poll its order instead. Example: {"multi_account_order_id": "<id>"}
Parameters:
multi_account_order_id(required) — string — The id returned by place_multi_account_order.response_format— string — concise (default): what a next step needs. detailed: every field the API returns.
Hints: read-only yes · destructive no · idempotent yes · open-world no
place_multi_account_orderdestructivePlaces the same market order on many of the user's real broker accounts (or demo) at once and returns at once; follow it with get_multi_account_order. Confirm the accounts, symbol, side and volume with the user first. Example: {"account_ids": ["<id>", "<id>"], "instrument": "XAUUSD", "side": "buy", "volume": "0.01", "idempotency_key": "<new uuid>"}
Parameters:
account_ids(required) — array — The accounts to trade on, one order each.side(required) — string — buy or sell.volume(required) — Size per account, unless weights overrides it for an account. In lots, preferably as a string: "0.01" is a micro lot, "1.00" a standard lot.idempotency_key(required) — string — A unique string you generate for THIS action, e.g. a fresh UUID. If a call fails or times out and you retry the same action, send the SAME key: fxapis then returns the first result instead of acting twice. Use a new key only for a genuinely new action.label— string — A name for this multi-account order.symbol— string — The symbol exactly as this broker names it, e.g. "EURUSD" — some brokers add a suffix such as "EURUSD.r".comment— string — Optional note stored on the order. MT5 keeps the first 17 characters after our reference.weights— object — Optional per-account size, keyed by account id, e.g. {"<account id>": "0.05"}.stop_loss— Optional stop loss for every account. An absolute price (e.g. "1.08450"), not a distance in pips or points.execute_at— string — When to send. Omit to send as soon as every account is online.expires_at— string — Stop waiting for accounts after this.instrument— string — Instead of symbol: an instrument from list_instruments, e.g. XAUUSD. Each account trades its own broker's symbol for it; the whole order is refused if any account's broker does not offer it.take_profit— Optional take profit for every account. An absolute price (e.g. "1.08450"), not a distance in pips or points.barrier_policy— string — When some accounts are not online in time: release-ready (default) trades on those that are; all-or-nothing trades on none unless all are; wait keeps waiting until expires_at.
Hints: read-only no · destructive yes · idempotent yes · open-world yes
cancel_multi_account_orderdestructiveCalls off a multi-account order on the user's real broker accounts (or demo) before anything is sent. Once orders went out, close the positions instead. Example: {"multi_account_order_id": "<id>", "idempotency_key": "<new uuid>"}
Parameters:
multi_account_order_id(required) — string — The multi-account order id.idempotency_key(required) — string — A unique string you generate for THIS action, e.g. a fresh UUID. If a call fails or times out and you retry the same action, send the SAME key: fxapis then returns the first result instead of acting twice. Use a new key only for a genuinely new action.
Hints: read-only no · destructive yes · idempotent yes · open-world yes
get_account_overviewread-onlyOne account in one call: state, environment, balance and equity, and its largest open positions with their total P/L. Start here when asked how an account is doing. Example: {"account_id": "<id>"}
Parameters:
account_id(required) — string — The fxapis account id (a UUID) from list_accounts — not the MT5 login number.top— integer — How many of the largest positions to list. Default 5.response_format— string — concise (default): what a next step needs. detailed: every field the API returns.
Hints: read-only yes · destructive no · idempotent yes · open-world no
get_symbol_snapshotread-onlyOne symbol on one account in one call: its specification, live quote, whether the market is open, and the margin for a volume. Use it before proposing a trade. Example: {"account_id": "<id>", "instrument": "XAUUSD", "volume": "0.10", "side": "buy"}
Parameters:
account_id(required) — string — The fxapis account id (a UUID) from list_accounts — not the MT5 login number.side— string — buy (default) or sell, for the margin.symbol— string — The symbol exactly as this broker names it, e.g. "EURUSD" — some brokers add a suffix such as "EURUSD.r".volume— Optional: the size to price the margin for. In lots, preferably as a string: "0.01" is a micro lot, "1.00" a standard lot.instrument— string — Instead of symbol: an instrument from list_instruments, e.g. XAUUSD.response_format— string — concise (default): what a next step needs. detailed: every field the API returns.
Hints: read-only yes · destructive no · idempotent yes · open-world yes
Measured by MCPYP probing. Untested fields are omitted, never estimated. Listing is always free; MCPYP never proxies calls or stores user tokens.