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 分