FxSocket MCP
OfficialRead-only access to your MetaTrader 4, MetaTrader 5 and cTrader accounts via 9 tools — it can inspect, but never place, modify or close orders.
List accounts — every account the API key sees, with connection status; optionally live balance, equity and floating P/L per account plus totals per currency.
Account details — one account in full: balance, equity, margin, leverage, currency, margin mode, stop-out level and terminal/broker health, including the broker's login-error reason.
Open positions — open positions and pending orders across accounts, with floating P/L and swap, filterable by symbol and kind.
Trade history — closed trades for a window (default 7 days, up to 366), with wins, losses, win rate, net P/L, best/worst trade and a per-symbol breakdown.
Search symbols — find the broker's exact symbol names (EURUSD, EURUSD.sd, EURUSDm…) by case-insensitive substring.
Live quotes — bid, ask and spread for up to 20 symbols straight from the broker's terminal.
Symbol specification — digits, contract size, tick size/value, volume limits, stops level, swaps, commissions and trading sessions.
Price history — OHLC candles from M1 to MN1, up to 500 bars per call.
Journal — cTrader accounts only: connection events and every trade request with its outcome, caller and timing.
Click 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., "@FxSocket MCP show my open positions and floating P/L across all my accounts"
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.
FxSocket MCP
Lets Claude, Gemini CLI, Cursor, VS Code and other MCP clients read your MetaTrader 4, MetaTrader 5 and cTrader accounts on FxSocket: balances, open positions, closed trades with win rate and P/L, quotes, symbol specifications and price history. It is read-only. It cannot place, modify or close orders.
This image runs FxSocket's MCP server as a local stdio server, for
clients that start their servers themselves (Claude Desktop, Docker's MCP
Toolkit, or anything configured with a command). It relays each message
to https://mcp.fxsocket.com/mcp with your API key. The tools run on
FxSocket, next to the terminals your accounts are connected to, so the
image stays tiny and never needs updating when tools change.
If your client takes a remote server URL plus a header, you can skip the
image: point it at https://mcp.fxsocket.com/mcp with your key in an
X-API-Key header. The Claude Code plugin and the Gemini CLI extension
below do exactly that.
1. Get an API key
Create a read-only key (fxs_ro_...) at
app.fxsocket.com/dashboard/api-key.
A named key scoped to some of your accounts limits the agent to exactly
those. A full fxs_live_... key works too, but an agent has no use for one.
Related MCP server: questrade-mcp
2. Add it to your client
Claude Code plugin (asks for the key once and keeps it in your system keychain, no Docker needed):
/plugin install fxsocket --marketplace fxsocket-com/FxSocket-MCPOn Claude Code before 2.1.275, add the marketplace first:
/plugin marketplace add fxsocket-com/FxSocket-MCP, then
/plugin install fxsocket@fxsocket.
Gemini CLI extension (asks for the key once and keeps it in your system keychain, no Docker needed):
gemini extensions install https://github.com/fxsocket-com/FxSocket-MCPClaude Desktop (Settings, Developer, Edit Config, then restart):
{
"mcpServers": {
"fxsocket": {
"command": "docker",
"args": ["run", "-i", "--rm", "-e", "FXSOCKET_API_KEY", "fxsocket/mcp"],
"env": { "FXSOCKET_API_KEY": "fxs_ro_..." }
}
}
}Claude Code without the plugin:
claude mcp add fxsocket -e FXSOCKET_API_KEY=fxs_ro_... -- docker run -i --rm -e FXSOCKET_API_KEY fxsocket/mcpCursor (~/.cursor/mcp.json):
{
"mcpServers": {
"fxsocket": {
"command": "docker",
"args": ["run", "-i", "--rm", "-e", "FXSOCKET_API_KEY", "fxsocket/mcp"],
"env": { "FXSOCKET_API_KEY": "fxs_ro_..." }
}
}
}VS Code (.vscode/mcp.json, prompts for the key once):
{
"inputs": [
{ "type": "promptString", "id": "fxsocket-key", "description": "FxSocket API key", "password": true }
],
"servers": {
"fxsocket": {
"type": "stdio",
"command": "docker",
"args": ["run", "-i", "--rm", "-e", "FXSOCKET_API_KEY", "fxsocket/mcp"],
"env": { "FXSOCKET_API_KEY": "${input:fxsocket-key}" }
}
}
}-e FXSOCKET_API_KEY without a value passes the variable through from the
client's env, so the key never appears in the process list.
Without Docker: the relay is one file with no dependencies. Download
fxsocket_mcp.py and use python3 (3.10 or newer) as
the command with the file's path as the argument, keeping the same env.
Tools
Tool | What it answers |
| Every account the key can see, optionally with balance, equity and totals per currency. Call first. |
| One account in full: summary, broker info and terminal status. |
| Open positions and pending orders across accounts, with floating P/L and swap. |
| Closed trades for a period, with wins, losses, win rate, net P/L and a per-symbol breakdown. |
| Find the broker's exact symbol name ( |
| Live bid/ask and spread for up to 20 symbols. |
| Contract specification: digits, contract size, volume limits, swaps, sessions. |
| OHLC candles for a symbol and timeframe. |
| cTrader accounts: connection events and every trade request with its outcome, newest first. |
Amounts are in each account's deposit currency and are never summed across currencies. Times are broker server time.
Configuration
Variable | Default | |
| (required) | Your FxSocket API key. |
|
| The server to relay to. Plain |
|
| Seconds to wait for one reply. |
|
|
|
FxSocket allows 60 MCP requests a minute per user.
How it works
The client writes newline-delimited JSON-RPC to the container's stdin. The relay POSTs each message to the MCP endpoint over a kept-alive HTTPS connection, adds the API key and the headers the protocol requires, and writes the replies to stdout. It handles both protocol eras:
2026-07-28: the protocol version travels in each request's
_meta, and the relay mirrors it into theMCP-Protocol-Version,Mcp-MethodandMcp-Nameheaders (plus anyx-mcp-headertool parameters).2025-03-26 to 2025-11-25: the client opens with
initialize, and the relay sends the negotiated version asMCP-Protocol-Versionfrom then on.
If FxSocket rejects the key, the relay still answers initialize and
tools/list from the server's public card
(https://mcp.fxsocket.com/.well-known/mcp/server-card.json), so
directories and inspectors that start it with a placeholder key can see
the tools. Every tool call still needs a valid key and otherwise returns
the rejection.
Requests run concurrently. A notifications/cancelled from the client
closes that request's connection, which is how Streamable HTTP cancels.
HTTP failures (bad key, rate limit, network) come back as JSON-RPC errors
with a sentence saying what to fix, rather than a hung client.
Development
python3 -m unittest discover -s tests
docker build -t fxsocket/mcp:dev .The tests start the relay as a subprocess against a local stub server, so they cover the real stdio and HTTP paths.
To release, bump __version__ in fxsocket_mcp.py and the version in
server.json, .claude-plugin/plugin.json and gemini-extension.json,
then push a matching tag (git tag v1.0.1 && git push --tags). The publish workflow builds
linux/amd64 and linux/arm64 and pushes fxsocket/mcp:<version>,
:<major>.<minor> and :latest, and the dockerhub-overview workflow
copies this README to the Docker Hub page.
License
Available Tools
9 toolsget_accountGet account detailsARead-onlyIdempotentInspect
One account in full, read live from its terminal: financials (balance, equity, margin, free margin, margin level, leverage, currency), account settings (margin mode, stop-out level, whether trading is allowed) and terminal health (broker connection, login state, and in health.account.authError the broker's reason when it refused the login, e.g. Invalid account for a wrong password). Takes one account_id from list_accounts; if part of the read fails, the rest is still returned and the failure is listed under errors. For balance and equity across several accounts at once, use list_accounts with include_balances; for positions, use get_open_positions.
Inputs: account_id (required).
get_journalGet account journalARead-onlyIdempotentInspect
The journal of one cTrader account, newest first: when it signed in at cTrader, became ready to trade, lost and regained its connection, and when its access was refreshed or refused; and every order, change and close the bridge carried out, with the request, the outcome (retcode, order, deal, position, or the error), the time it took, the caller's clientOrderId and User-Agent. Use it to answer why an account stopped trading or who sent a trade. The bridge keeps it in memory, at most 7 days and 1000 entries, and a bridge restart starts it afresh, so for the full record of closed trades use get_trade_history. cTrader accounts only.
Inputs: account_id (required), kind, limit, since.
get_open_positionsGet open positionsARead-onlyIdempotentInspect
Open positions and pending orders on one or more accounts, newest first, with per-account counts, floating profit and swap, and totals per currency. Lists at most 300 orders across all accounts; counts and totals always cover everything. Narrow it with symbol (EURUSD also matches EURUSD.sd) and kind (position or pending); omit account_ids to read every account. Only what is open now: for closed trades, win rate or realised profit, use get_trade_history.
Inputs: kind, symbol, account_ids.
get_price_historyGet price historyARead-onlyIdempotentInspect
OHLC candles for one symbol from this account's broker. Returns the most recent limit bars (default 100, max 500) in the window; omit from/to for the latest bars. A window spanning more than 20000 bars is refused (narrow it or pick a larger timeframe). For the current price only, use get_quotes.
Inputs: symbol (required), timeframe (required), account_id (required), to, +2 more.
get_quotesGet live quotesARead-onlyIdempotentInspect
Latest bid, ask and spread for up to 20 symbols, read live from this account's terminal, so prices are the broker's own. A symbol the broker does not know is listed under errors while the others still return; if none resolve, the call fails. The current price only: for past prices use get_price_history, for contract size, swaps or sessions use get_symbol_info.
Inputs: symbols (required), account_id (required).
get_symbol_infoGet symbol specificationARead-onlyIdempotentInspect
Contract specification for one symbol at this account's broker, read live from its terminal: digits, contract size, tick size and value, minimum/maximum/step volume, stops level, current spread, swap rates, commissions and trading sessions. symbol must be the broker's exact name, so look it up with search_symbols first; an unknown symbol fails the call with the terminal's reason. For just the live bid and ask of several symbols, get_quotes is lighter.
Inputs: symbol (required), account_id (required).
get_trade_historyGet closed tradesARead-onlyIdempotentInspect
Closed positions (one row per round trip) on one or more accounts, with per-account stats: trade count, wins, losses, win rate, net profit after commission and swap, best and worst trade, and a per-symbol breakdown. Defaults to the last 7 days; the window can be up to 366 days. Lists at most 300 trades across all accounts, newest first; the stats always cover the whole window. Each trade has its open and close price and time and the stop-loss and take-profit it closed with (sl, tp; 0 = not set, and always 0 on cTrader). For positions that are still open, use get_open_positions.
Inputs: to, from, symbol, account_ids.
list_accountsList trading accountsARead-onlyIdempotentInspect
Every MT4, MT5 and cTrader account linked to this API key: id, nickname, platform, broker server, login and connection status (connected / connecting / disconnected / error). Call this first: the other tools take its account_id values. Set include_balances to also read each account's live balance, equity and floating profit from its terminal, plus totals per currency; that reads at most 50 accounts, and one that cannot be read gets a balance_error instead of failing the call. For one account's margin, leverage and settings, use get_account instead.
Inputs: include_balances.
search_symbolsSearch symbolsARead-onlyIdempotentInspect
Find the exact symbol names an account's broker uses, by case-insensitive substring. Brokers spell instruments differently (EURUSD, EURUSD.sd, EURUSDm, XAUUSD.r), so look a name up here before calling get_quotes, get_symbol_info or get_price_history. Returns up to limit names (default 100) with how many matched and whether the list was cut; names only, one symbol's contract details come from get_symbol_info.
Inputs: account_id (required), limit, query.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 9 tools
Each tool targets a distinct resource and verb, and the descriptions explicitly hand off between siblings (get_quotes for current price vs get_price_history for past bars; get_open_positions vs get_trade_history for closed trades). The search_symbols vs get_symbol_info and list_accounts vs get_account pairs are cleanly separated by name-only versus full-record semantics.
Uniform snake_case verb_noun pattern throughout (search_*, get_*, list_*), with the verb choice matching intent: search for lookup, list for collections, get for single-record reads. No deviations or mixed conventions.
Nine tools is well within the sweet spot, and each maps to a distinct step in the workflow: discover symbols, inspect contracts, fetch prices, enumerate accounts, drill into one account, and review open/closed/journal history. No filler tools and no bloated surface.
The read-only monitoring surface is thorough, covering symbol discovery, contract specs, quotes, candles, account financials, open orders, closed-trade stats and a cTrader journal, with sensible overrides like include_balances. Gaps exist on the action side (no order placement, modification or close) and journal retention is in-memory only, but those read as intentional scope limits rather than dead ends.
Related MCP Connectors
Connect any MCP client to MetaTrader 4/5 to read prices, manage positions, and place trades.
Read-only MetaTrader 5 for AI agents: balances, positions, history and prices. Sign in with OAuth.
Hosted MCP server for MT4 and MT5: read accounts, prices and candles, and place or close orders.
Read-only market charts, OHLC, backtests and a view of your connected broker accounts
Related MCP Servers
- FlicenseNot gradedqualityBmaintenanceEnables MCP clients to securely access read-only Psagot Trade account and market information through authenticated HTTP endpoints. It exposes only read-only tools, with no trade-submission capabilities.-
- AlicenseBqualityCmaintenanceEnables read-only access to Questrade accounts, portfolios, market data, transactions, technical analysis, and order history through MCP.1138 npmMIT
- AlicenseCqualityBmaintenanceEnables MCP clients to query Sinopac market data, account balances, trading limits, positions, settlements, and profit/loss through the Shioaji API. Provides read-only access with no ability to place, modify, or cancel orders.22MIT
- AlicenseNot gradedqualityCmaintenanceEnables MCP clients such as Claude to read stock-token and crypto quotes, market status, correlations and lags, correlation matrices, weekend shield exposure, and testnet wallet positions and limits. It provides read-only access to a cross-asset market engine without signing or trading.51 npmMIT