fxapis
OfficialClick on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@fxapisshow my open positions"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Read and trade your MetaTrader 5 accounts from Claude Code, with every trade confirmed.
Website · Docs · MCP guide · Status · Support
This is the plugin marketplace for fxapis, the hosted MetaTrader 5 API. Its one plugin, fxapis, connects Claude Code to the fxapis MCP server, teaches Claude how to trade MT5 carefully, and adds a hook that makes you confirm every trade and refuses live accounts until you allow them.
/plugin marketplace add FXapis/fxapis-claude-plugins
/plugin install fxapis@fxapisOrders placed through fxapis are real orders at your broker. On a live account they are real money. Start with a broker demo account, sign in read-only first, and read the safety model before you let Claude trade.
Table of contents
Related MCP server: MT5 MCP Server
Quick start
You need Claude Code and an fxapis account with at least one MT5 account connected in the console. Connecting an MT5 account takes its broker password, so it is done in the console and never through Claude.
1. Add the marketplace and install the plugin. Inside Claude Code:
/plugin marketplace add FXapis/fxapis-claude-plugins
/plugin install fxapis@fxapisOr from your shell:
claude plugin marketplace add FXapis/fxapis-claude-plugins
claude plugin install fxapis@fxapis2. Sign in. Ask for something that needs fxapis, such as /fxapis:status. The first tool call opens fxapis's sign-in page in your browser. Approve read access, and turn on trading only for the accounts you want.
3. Check your accounts.
/fxapis:status
/fxapis:positionsTo update later, run /plugin marketplace update fxapis.
What's inside
Component | Name | What it does |
MCP server |
| Accounts, positions, orders, deals, quotes, market hours, margin and profit calculations, and trading tools. Streamable HTTP, with OAuth sign-in or an optional API key. Tool reference. |
Skill | Demo before live; one explicit yes per trade; a fresh idempotency key per action; never resending an unresolved order; checking the market is open; sizing against free margin; reducing risk first in a drawdown. References cover the order lifecycle, multi-account orders and every error code. | |
Command | Your accounts in one table (label, login, server, environment, state), and what to fix for any account that needs you. Calls no tool that trades. | |
Command | Open positions across every ready account, with balance, equity and P/L per account and in total per currency. Calls no tool that trades. | |
Command | Signing in, live trading, API keys and revoking access, explained without calling any tool. | |
Hook | Asks you before every fxapis trade, even in auto-accept mode, and refuses trades on live accounts while |
.
├── .claude-plugin/marketplace.json # the "fxapis" marketplace
└── plugins/fxapis/
├── .claude-plugin/plugin.json # manifest and userConfig
├── .mcp.json # the fxapis MCP server
├── commands/ # status, positions, connect-help
├── hooks/hooks.json # PreToolUse matcher for the seven trade tools
├── scripts/confirm-trade.mjs # the confirmation hook
└── skills/trading-mt5-safely/ # SKILL.md and its referencesHow sign-in works
OAuth on first use. With no API key set, the first fxapis tool call opens fxapis's sign-in page in your browser. Sign-in is OAuth 2.1 with PKCE, as the MCP authorization spec describes.
You choose what Claude may do. Read access (accounts, positions, orders, deals, figures, quotes) is always included. Trading is off by default; turn it on per account. It needs two-factor on your fxapis account, and you can also set a maximum order size and a number of orders a day.
Revocable at any time. Every connected app is listed on the API keys page under Connected apps. Revoke ends its access on its next request.
An API key is optional. For an agent that runs unattended, create a key with only the scopes it needs and set it as the plugin's
api_keyoption. The plugin sends it as theX-API-Keyheader and stores it as a sensitive value.
Safety model
Several layers stand between a prompt and an order. The first two are enforced by fxapis on every call, whatever the model decides.
What you allowed. A read-only connection cannot trade. A trading connection can change only the accounts you picked, within the limits you set. An API key can do only what its scopes allow.
Two-factor for trading. Letting an app trade requires two-factor on your fxapis account.
The confirmation hook. It runs before each of the seven trade tools:
place_market_order,place_pending_order,close_position,modify_position,cancel_order,place_multi_account_orderandcancel_multi_account_order.It always answers ask, so Claude Code shows a confirmation dialog even in auto-accept mode, with one line saying what will happen, for example
fxapis: buy 0.10 lots EURUSD at market on account … — demo.If fxapis has reported the account as live in this session, and
allowLiveTradingis off, the trade is denied.An account not yet listed in the session is marked "demo or live not known yet" and asked about, never assumed safe.
It learns each account's environment only from fxapis's own
list_accounts,get_accountandget_account_overviewresults in the session transcript, never from user text or other tools' output. Once an account is seen as live, it stays live for the session.If anything goes wrong while checking, it still asks.
The skill. It tells Claude to suggest a demo run first, name the environment ("LIVE account 5012345") in every proposal, wait for an explicit yes per trade, and never resend an order whose outcome is unknown. This shapes behaviour; layers 1 to 3 enforce.
fxapis has no simulated market: broker demo accounts are how you test.
Configuration
The plugin declares two options in plugin.json. Set them with /plugin → fxapis → configure.
Option | Type | Default | What it does |
| string, sensitive | empty | fxapis API key (optional). Leave empty to sign in to fxapis in your browser on first use. Set an |
| boolean |
| Allow trades on live accounts. Off: trades on accounts fxapis reports as live are refused. Demo accounts trade, each after you confirm it. |
Turning on allowLiveTrading does not skip confirmation: every trade, demo or live, is still asked about.
Example prompts
"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 EURUSD market open on my demo account right now?"
"Bring all my accounts online, then tell me when they are ready."
"Buy 0.01 lots of EURUSD on the demo account with a 20-pip stop."
"Move the stop loss on my gold position to break-even."
"Did anything go wrong with today's orders? Show me any that are still
unknown."
Prompts that trade need a connection with trading turned on for that account, and each one stops at the confirmation dialog.
Use it outside Claude Code
There is no one-click link that adds a plugin marketplace to Claude Code or a custom connector to claude.ai; use the commands and steps below.
claude.ai and Claude Desktop
Open Customize → Connectors → Add custom connector. On Team and Enterprise plans, an Owner adds it under Organization settings → Connectors.
Remote MCP server URL:
https://api.fxapis.com/mcp. Leave the OAuth client fields empty.Click Connect and sign in to fxapis in the window that opens.
For the skill, download trading-mt5-safely.zip and upload it under Settings → Capabilities → Skills. The hook and commands are Claude Code features and are not part of the connector. Full steps: docs.fxapis.com/guides/claude-plugin.
Claude Code without the plugin
claude mcp add --transport http fxapis https://api.fxapis.com/mcpThen run /mcp, choose fxapis and Authenticate. The hook also matches a server added this way under the name fxapis, but only when the plugin is installed.
VS Code and Cursor
These clients sign in through a vscode:// or cursor:// return address, which fxapis does not accept yet, so they connect with an API key instead. They get the MCP server only, without the skill or the hook.
VS Code asks for the key once and keeps it in its secret storage.
Cursor reads it from the
FXAPIS_KEYenvironment variable, so set that before starting Cursor.
The configs behind these buttons, and ones for other clients, are in fxapis-mcp-examples and the MCP guide.
Troubleshooting
Symptom | What to do |
fxapis tools don't appear | Run |
The browser sign-in never opened | Run |
A trade was refused: "a LIVE account, and live trading is off" | Working as intended. Turn on |
The dialog says "demo or live not known yet" | Run |
| This connection was not allowed to trade that account. Sign in again with Trading on for it, or use a key with the right scopes. |
An account shows | It needs you, in the console. |
| The order may be live at the broker. Do not resend it; ask Claude to check it with |
No confirmation dialog appears before a trade | The hook runs with |
More: docs.fxapis.com/guides/mcp and status.fxapis.com.
Development
Requires Node.js 20 or later.
npm test # hook, manifest and skill tests (node --test)
claude plugin validate . --strict # the marketplace
claude plugin validate ./plugins/fxapis --strict # the plugin
claude --plugin-dir ./plugins/fxapis # try it locallyCI runs the same tests and both validations on every push and pull request.
Related fxapis repositories
Repository | What it is |
MCP client configurations for Claude, Cursor, VS Code, the OpenAI and Anthropic APIs | |
The official TypeScript/Node.js SDK | |
The official Python SDK | |
REST API examples in Python, Node/TypeScript and curl | |
Postman collection, TradingView payloads, automation templates | |
A Next.js starter on the fxapis API |
Contributing
Issues and pull requests are welcome. This repository is published from the fxapis monorepo, so accepted changes are applied there and then copied here. Please run the tests and both claude plugin validate commands before opening a pull request, and test anything that trades on a broker demo account.
Support
Status: status.fxapis.com
Bugs: open an issue
Everything else: support@fxapis.com
License
This server cannot be deployed
Maintenance
Related MCP Connectors
Connect any MCP client to MetaTrader 4/5 to read prices, manage positions, and place trades.
Trade 16 crypto exchanges + MetaTrader 5 from your AI assistant via one MCP connection.
Let Claude or ChatGPT search, read and send your WhatsApp messages over MCP. OAuth sign-in.
Remote MCP for KOYN FX: account, markets, and TradeLocker tools over OAuth.
Related MCP Servers
- AlicenseNot gradedqualityAmaintenanceEnables AI assistants to connect to MetaTrader 5 for trading, market data access, and account management through the Model Context Protocol.70 PyPI231MIT
- AlicenseNot gradedqualityDmaintenanceEnables interaction with MetaTrader 5 for market data, technical analysis, Fibonacci calculations, and trading via MCP clients such as Claude.MIT
- FlicenseAqualityDmaintenanceEnables Claude AI to perform forex trading operations and market data analysis through MetaTrader 5, including order placement, position management, and multi-timeframe candle data retrieval.16-
- AlicenseAqualityBmaintenanceConnects Claude to a MetaTrader 5 terminal for read-only market data, account info, performance analysis, and order planning (no live trading).18MIT