FxSocket

com.fxsocket由 fxsocket.com 發布官方發布者v1.0.1更新於 Nov 1, 2026

Read-only MetaTrader 4 and 5 accounts: balances, positions, trade history, quotes and candles.

已驗證Streamable HTTP可網頁執行金融資料與分析

概覽

AI 產生的概覽

以唯讀方式存取 FxSocket 上的 MetaTrader 4/5 交易帳戶:餘額、持倉、交易歷史、報價與K線。

可以做什麼
  • 列出並檢視帳戶,含餘額、淨值、券商資訊與終端狀態
  • 檢視持倉與掛單,含浮動損益與庫存費
  • 依期間查詢已平倉交易,含勝負、勝率與淨損益
  • 查詢券商符號名稱、合約規格與即時買賣報價
  • 取得指定符號與週期的 OHLC 價格歷史
適用情境
適合讓助理回答關於自己 MT4/MT5 帳戶的問題,例如某策略表現如何、目前持有哪些部位、某符號的合約條款與近期價格,同時不賦予交易權限。
執行需求
需要 FxSocket 帳戶與 API 金鑰,透過環境變數 FXSOCKET_API_KEY(Docker 或 Python 中繼)或遠端端點的 X-API-Key 標頭提供。Docker 映像需安裝 Docker;單一中繼檔案方案需 Python 3.10 以上版本。需能連線至 FxSocket 的 MCP 端點,且每次工具呼叫都要求金鑰有效。
安裝前請注意
金鑰屬於機密:唯讀金鑰(fxs_ro_...)已足夠,限定帳戶範圍的具名金鑰可進一步限制助理可見的帳戶;完整的 live 金鑰雖可使用,但對助理而言權限過大。此伺服器為唯讀,無法下單、修改或平倉。請求會轉送至 FxSocket 遠端端點,帳戶資料會離開本機,且每分鐘最多 60 次請求。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 FxSocket,將其新增到工作區。
  2. 連接 X-API-Key 憑證。它們會被私密儲存,絕不會在公開頁面上展示。
  3. 為需要使用其工具的對話啟用該服務。

Web executable,透過 Streamable HTTP。 遠端服務在工作區中設定後即可從網頁執行環境執行。

交給代理程式安裝

把這段提示詞貼上到 Claude Code、Codex、Cursor 等代理程式,或 SourceWeft 對話中。代理程式會讀取該伺服器的安裝指南,先向你展示發布者、端點和登入方式,經你同意後再把它新增到你的客戶端。金鑰不會寫進任何命令。

閱讀 https://sourceweft.com/mcp/com.fxsocket%2Fmcp/install.md,並按其中說明把這個 MCP 伺服器接入我的客戶端。修改任何設定之前,先告訴我它的發布者、端點和登入方式,等我確認。不要把 API 金鑰寫進命令或我會提交的檔案;問我金鑰應從哪裡取得。

檢視代理程式所依據的安裝指南

其他 MCP 客戶端

把它新增到你客戶端的 mcpServers 設定中。

{
  "mcpServers": {
    "fxsocket": {
      "type": "http",
      "url": "https://mcp.fxsocket.com/mcp",
      "headers": {
        "X-API-Key": "<YOUR_API_KEY>"
      }
    }
  }
}

README

FxSocket MCP

[Docker Hub] [CI] [License: MIT]

Lets Claude, Cursor, VS Code and other MCP clients read your MetaTrader 4 and 5 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.

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.

2. Add it to your client

Claude Desktop (Settings, Developer, Edit Config, then restart):

json
{  "mcpServers": {    "fxsocket": {      "command": "docker",      "args": ["run", "-i", "--rm", "-e", "FXSOCKET_API_KEY", "fxsocket/mcp"],      "env": { "FXSOCKET_API_KEY": "fxs_ro_..." }    }  }}

Claude Code:

bash
claude mcp add fxsocket -e FXSOCKET_API_KEY=fxs_ro_... -- docker run -i --rm -e FXSOCKET_API_KEY fxsocket/mcp

Cursor (~/.cursor/mcp.json):

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):

json
{  "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

ToolWhat it answers
list_accountsEvery account the key can see, optionally with balance, equity and totals per currency. Call first.
get_accountOne account in full: summary, broker info and terminal status.
get_open_positionsOpen positions and pending orders across accounts, with floating P/L and swap.
get_trade_historyClosed trades for a period, with wins, losses, win rate, net P/L and a per-symbol breakdown.
search_symbolsFind the broker's exact symbol name (EURUSD, EURUSD.sd, EURUSDm...).
get_quotesLive bid/ask and spread for up to 20 symbols.
get_symbol_infoContract specification: digits, contract size, volume limits, swaps, sessions.
get_price_historyOHLC candles for a symbol and timeframe.

Amounts are in each account's deposit currency and are never summed across currencies. Times are broker server time.

Configuration

VariableDefault
FXSOCKET_API_KEY(required)Your FxSocket API key.
FXSOCKET_MCP_URLhttps://mcp.fxsocket.com/mcpThe server to relay to. Plain http is only allowed to localhost.
FXSOCKET_MCP_TIMEOUT120Seconds to wait for one reply.
FXSOCKET_MCP_LOGinfoerror, warning, info or debug. Logs go to stderr.

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 the MCP-Protocol-Version, Mcp-Method and Mcp-Name headers (plus any x-mcp-header tool parameters).
  • 2025-03-26 to 2025-11-25: the client opens with initialize, and the relay sends the negotiated version as MCP-Protocol-Version from 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

bash
python3 -m unittest discover -s testsdocker 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, 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

MIT

來源:README.md,提交 de84ab9

工具

0
該伺服器需要 API 金鑰等憑證,因此 SourceWeft 無法在沒有憑證的情況下讀取其工具,也未收錄。

版本歷史

1
  1. v1.0.1最新Oct 18, 2026

評分

已滿足適用檢查項的 85%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通必需25 分
  • 已宣告認證方式必需10 分
  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分