AI assistants

Connect Claude and ChatGPT to MetaTrader 5 (MCP)

Connect Claude, ChatGPT and AI agents to MT5 with the fxapis hosted MCP server: OAuth sign-in, a read-only connector, and trading only if you allow it.

Updated 4 min readLeer en español
On this page
  1. Two connectors: read-only and full
  2. How sign-in works
  3. Connect Claude
  4. Connect ChatGPT
  5. Agents with an API key
  6. Keeping an assistant safe around real money
  7. Things to try
  8. Where to go next

fxapis runs a hosted Model Context Protocol (MCP) server for MetaTrader 5. Add it to Claude or ChatGPT, sign in to fxapis, and the assistant can read your MT5 accounts, positions, orders and history — and, only if you allow it, trade. It works with any MT5 broker (Exness, IC Markets, Pepperstone, XM, a prop firm's server such as FTMO's, or another), and there is nothing to install: the MT5 terminals run in fxapis's cloud.

Two connectors: read-only and full

AspectRead-only connectorFull connector
URLhttps://api.fxapis.com/mcp/insightshttps://api.fxapis.com/mcp
Accounts, figures, positions, orders, history
Quotes, symbol details, market hours
Price history (candles)
Bring accounts online or offline, if you allow trading
Open, close and modify tradesNo trading tools at all, if you allow trading, on the accounts you pick
Sign-in grantsRead access onlyRead access, plus trading if you tick it

Start with the read-only connector. Add the full one later, if and when you want the assistant to trade. Each is listed and revoked separately.

How sign-in works

  • OAuth sign-in, no key to copy. The first time the app uses fxapis, it opens fxapis's sign-in page. You choose what it may do: read access is always included; Trading is off unless you tick it, and then applies only to the accounts you pick, with an optional maximum order size and number of orders a day. Trading needs two-factor turned on.
  • Revoke any time. Every connected app is listed in the console under API keys → Connected apps, with when it was last used. Revoke ends its access on its very next request.
  • The same rules as the REST API. A connected app acts through the ordinary API with exactly what you allowed. Plan limits, idempotency and the workspace kill switch apply.
  • Deliberately missing: connecting an MT5 account and managing keys. Connecting takes the broker password, which must never pass through an AI model. Do both in the console.

Connect Claude

On claude.ai or Claude Desktop, on any Claude plan:

  1. Open Customize → Connectors → Add custom connector. On Team and Enterprise, an Owner adds it under Organization settings → Connectors.
  2. Remote MCP server URL: https://api.fxapis.com/mcp/insights for read-only, or https://api.fxapis.com/mcp for the full connector. Leave the OAuth client fields empty.
  3. Click Connect, sign in to fxapis in the window that opens, and allow access.

In Claude Code:

cURL
claude mcp add --transport http fxapis https://api.fxapis.com/mcp

Then run /mcp, choose fxapis and Authenticate. The fxapis plugin adds the server, a safe-trading skill and a hook that confirms every trade.

Connect ChatGPT

Adding a custom MCP server is done in ChatGPT on the web: open Plugins, choose + and Add custom MCP server, enter one of the URLs above, and choose OAuth. Then sign in to fxapis when ChatGPT asks.

What ChatGPT allows depends on your ChatGPT plan. OpenAI's help page (Connecting custom MCP servers in ChatGPT, checked 26 October 2026) lists full MCP, including actions that change things, for Business, Enterprise and Edu, and read/fetch permissions for Pro. On Business, only workspace owners and admins can add one. Set the app to ask before it acts.

Agents with an API key

For scripts, unattended agents, Cursor and VS Code, use an API key with the fewest scopes that do the job:

The agent should…Scopes
Report on accounts, positions and historyaccounts:read, trading:read, history:read
…and bring accounts online or take them offlineadd accounts:write
…and manage risk: close, move stops, cancel — never openadd trading:reduce
…and open new positionsadd trading:execute
cURL
claude mcp add --transport http fxapis https://api.fxapis.com/mcp \
  --header "Authorization: Bearer $FXAPIS_KEY"

fxapis-mcp-examples has tested configs for Claude Code, Cursor, VS Code, the OpenAI Responses API and the Anthropic Messages API. A tool the key does not cover answers MISSING_SCOPE, and the agent is told to ask you rather than work around it. API keys vs broker logins explains why the key, not the MT5 password, is what you hand out.

Keeping an assistant safe around real money

An assistant can misread a request, act on text planted in something it was asked to summarise, or loop. The protections, strongest first:

  1. What you allowed at sign-in (or the key's scopes), enforced by the API on every call: read-only means no trading tools; trading is limited to the accounts you picked and the limits you set.
  2. Two-factor before any app may trade.
  3. Demo accounts while you learn how an assistant behaves — fxapis has no simulated market.
  4. Your plan's limits, which refuse opening orders past the allowance; closing is never refused for billing.
  5. Your app's confirmations. Trading tools are marked destructive, so Claude asks before each trade. Don't choose "always allow" for trading tools on a live account.

If you trade a prop-firm account, the firm decides whether an AI assistant or a hosted service may trade it. Read its current rules and ask it in writing first.

Things to try

  • "Which of my MT5 accounts are online, and what positions are open on each?"
  • "How much margin would 0.5 lots of XAUUSD need on my demo account?"
  • "Is the gold market open right now, and what's the spread?"
  • "Did anything go wrong with today's orders? Show me any that are still unknown."

Where to go next

  • The MCP guide has every tool, the scope each needs, and the safety model; the read-only connector guide lists its tools.
  • The MCP server on the website, and pricing: Personal ($9 a month) includes the connector; Personal, Production and Business each start with a 14-day free trial of that plan on demo accounts (up to 5; Personal 2), with no card, and Enterprise is priced with you.

— Software architect and AI engineer with more than 15 years of building and scaling software systems. Designs and builds production-grade software and AI systems, and writes about how it's done.

elwizard.netGitHubInstagram

FAQ

Questions people also ask

Can ChatGPT connect to the fxapis MCP server?

Yes, with OAuth sign-in. Add a custom MCP server in ChatGPT on the web with the URL api.fxapis.com/mcp/insights (read-only) or api.fxapis.com/mcp (full), and sign in to fxapis. OpenAI lists full MCP, including actions that change things, for Business, Enterprise and Edu, and read/fetch for Pro (checked 26 October 2026).

How do I connect Claude to MetaTrader 5?

In Claude, open Customize, Connectors, Add custom connector, and enter https://api.fxapis.com/mcp/insights for read-only or https://api.fxapis.com/mcp for the full connector. Click Connect and sign in to fxapis. It works with any MT5 broker you connect in the fxapis console.

What is the read-only connector?

An MCP server at api.fxapis.com/mcp/insights that answers questions about your MT5 accounts, positions, orders, history, quotes and market hours, and has no tool that opens, closes or changes anything. Its sign-in grants read access only.

Can an assistant trade without my approval?

Only if you allowed trading at sign-in, for the accounts you picked, and set your app to run trading tools without asking. Trading tools are marked destructive, so Claude asks first. Use the read-only connector to make trading impossible.

Does the MCP server cost extra?

No. Each tool call is one or two ordinary API calls on your plan. Personal ($9 a month) includes the connector; Personal, Production and Business each start with a 14-day free trial of that plan on demo accounts (up to 5; Personal 2), with no card, and Enterprise is priced with you.

All in this topic
> Connect. Execute. Scale.

Trade MT5 from your own code.

Connect accounts by login, password and server, and place orders over HTTPS. We run MetaTrader 5; you install nothing.