CCXT

io.github.ccxt由 GitHub 帳號 ccxt 發布v0.1.3更新於 Oct 24, 2026

Official CCXT MCP server - Market data and trading across 100+ exchanges and prediction markets

已驗證STDIO僅桌面金融資料與分析

概覽

AI 產生的概覽

CCXT 官方 MCP 伺服器,讓助理取得 100 多家加密貨幣交易所與預測市場的公開行情,並可選擇讀取帳戶與交易。

可以做什麼
瀏覽交易所與方法、搜尋市場和預測事件,讀取行情、訂單簿、K 線與成交,並呼叫唯讀原始 GET 端點和查看安全狀態。透過 WebSocket 訂閱即時資料:行情、訂單簿、餘額、持倉以及成交或訂單事件,再讀取最新更新或等待下一次變化。設定帳戶後可讀取餘額、未完成訂單、自有成交和持倉。在設定檔中按帳戶啟用後,可下單、改單、取消單、設定槓桿與保證金模式,並呼叫白名單內的寫入方法。另行啟用後可提幣、轉帳、取得入金地址,或呼叫原始寫入類端點。
適用情境
適合讓助理在對話中研究加密市場、比較交易所,或監控即時價格與訂單簿。也適合查看餘額與持倉,或在沙盒中交易,以及在你主動啟用後進行實盤訂單管理。
執行需求
以 stdio 執行的本機程序,需要 Node.js 18 或更新版本,透過 npx 啟動。公開行情無需任何設定。私有讀取需要在設定檔中加入帳戶(各系統有預設路徑,也可用 CCXT_MCP_CONFIG 指定),或設定以交易所命名的環境變數,例如 BINANCE_APIKEY 和 BINANCE_SECRET。需要能連線交易所的網路,部分交易所有地區限制。
安裝前請注意
實盤交易、提幣和原始寫入端點預設關閉,必須在設定檔中按帳戶啟用;實盤交易還需明確寫入 live 值並設定單筆上限。設定檔保存 API 金鑰,預測市場帳戶還含錢包私鑰,應限制檔案權限並優先使用宿主提供的密鑰儲存。任何有檔案系統存取權限的本機代理都可能讀取該檔案。金鑰只會傳送給交易所,工具結果會經過去識別化過濾。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 CCXT,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

ccxt-mcp — official CCXT MCP server

Connect AI agents (Claude Desktop, Claude Code, Cursor, VS Code, Windsurf, and any MCP host) to 100+ cryptocurrency exchanges and prediction markets through the unified ccxt API: market data, account balances, order management, and — when you explicitly enable it — trading.

claude mcp add ccxt -- npx -y ccxt-mcp

Security model (read this first)

Your API keys stay on your machine, and the AI model never sees them:

  • The server runs locally over stdio. Nothing is hosted; keys never transit any third-party service.
  • Credentials are never tool parameters: no tool schema accepts a key, so neither the model nor a prompt-injected page can supply, request, or change them. Tools reference accounts by name ("binance-main").
  • Keys leave the process only inside signed HTTPS requests to the exchange itself — the same as any trading bot.
  • Every tool result, error, and log line passes a redaction filter holding your loaded secret values (some exchanges echo signed URLs in error bodies — that path is closed). Raw request URLs/headers/bodies are never emitted. verbose is force-disabled.
  • Capability tiers are opt-in and file-owned. Out of the box the server does public market data only. Configuring an account enables private reads. trading, funds (withdraw/transfer), and implicitWrites (raw endpoints) must each be enabled per account in the config file — there is no tool that edits config, so a conversation can never grant itself permissions. Unregistered tiers do not even appear in the tool list.
  • Writes are previewed and confirmed (native confirmation form where the host supports elicitation, otherwise an explicit preview + confirm-token round-trip), validated against market limits and your notional caps, and journaled to an append-only audit log.

Recommended exchange-side backstops (they hold even if your machine is compromised): create API keys with withdrawal permission disabled and an IP allowlist.

One honest caveat: any local agent with filesystem access could read the config file with its own tools — that is governed by your MCP host's permission model, not by this server. Prefer your host's secret storage where available (see below), keep the file chmod 600, and consider a deny rule for the path in your host's settings.

Install

Requires Node.js ≥ 18. The npm package is ccxt-mcp; the server binary is npx -y ccxt-mcp.

Claude Code

bash
claude mcp add ccxt -- npx -y ccxt-mcp

Or per-project via .mcp.json (safe to commit — no secrets):

json
{ "mcpServers": { "ccxt": { "command": "npx", "args": ["-y", "ccxt-mcp"] } } }

Claude Desktop

Add to claude_desktop_config.json (Settings → Developer → Edit Config):

json
{ "mcpServers": { "ccxt": { "command": "npx", "args": ["-y", "ccxt-mcp"] } } }

Cursor

~/.cursor/mcp.json (or .cursor/mcp.json per project):

json
{ "mcpServers": { "ccxt": { "command": "npx", "args": ["-y", "ccxt-mcp"] } } }

VS Code

.vscode/mcp.json — VS Code's inputs mechanism stores values in encrypted secret storage, the best option for keys among the JSON-config hosts:

json
{  "inputs": [    { "id": "binance-key", "type": "promptString", "password": true, "description": "Binance API key" },    { "id": "binance-secret", "type": "promptString", "password": true, "description": "Binance API secret" }  ],  "servers": {    "ccxt": {      "command": "npx", "args": ["-y", "ccxt-mcp"],      "env": { "BINANCE_APIKEY": "${input:binance-key}", "BINANCE_SECRET": "${input:binance-secret}" }    }  }}

Windsurf

~/.codeium/windsurf/mcp_config.json — same mcpServers shape as Claude Desktop; ${env:VAR} interpolation is supported.

Configuration

With no configuration the server serves public market data on all exchanges — that alone is a useful install.

To add accounts, create the config file (path shown by the get_safety_status tool):

  • macOS: ~/Library/Application Support/ccxt-mcp/config.json
  • Linux: ~/.config/ccxt-mcp/config.json
  • Windows: %APPDATA%\ccxt-mcp\config.json
  • Or point CCXT_MCP_CONFIG at any path (a legacy per-exchange keys.local.json shape also loads).
jsonc
{  "accounts": {    "binance-testnet": {      "exchange": "binance",      "apiKey": "…",      "secret": "…",      "sandbox": true,          // testnet — recommended first stop      "trading": true           // true enables SANDBOX/DEMO trading only    },    "binance-main": {      "exchange": "binance",      "apiKey": "…",      "secret": "…",      "trading": "live",        // live trading requires the explicit string "live"…      "maxOrderValue": 250,     // …and a per-order USD cap you author (null = opt out)      "maxDailyValue": 1000,    // optional rolling-24h cap      "allowedSymbols": ["BTC/USDT", "ETH/*"],  // optional strict allowlist      "confirm": "live"         // always | live (default) | never    },    "polymarket-main": {      "exchange": "polymarket",      "walletAddress": "0x…",      "privateKey": "0x…"    }  }}

Account fields: any credential from the exchange's requiredCredentials (apiKey, secret, password, uid, walletAddress, privateKey, …), sandbox/demo, defaultType, options (ccxt constructor options), prediction: true (for exchanges that exist in both the crypto and prediction namespaces, e.g. hyperliquid), and the safety switches below. chmod 600 the file; the server warns otherwise (or refuses with "settings": {"strictPermissions": true}).

Environment variables work too: <EXCHANGEID>_<CREDENTIAL> (e.g. BINANCE_APIKEY, OKX_PASSWORD) fill missing credentials, and the CCXT_MCP_EXCHANGE/CCXT_MCP_APIKEY/CCXT_MCP_SECRET/CCXT_MCP_SANDBOX/CCXT_MCP_TRADING set defines a single account named default.

Claude Desktop (.mcpb bundle): the install form configures one exchange. To use several exchanges (or enable live trading/withdrawals), set the Config file field to a config.json with an accounts map like the one above — or just create it at the default path and leave the form fields blank.

Capability tiers

TierEnablesSwitchDefault
markettickers, order books, OHLCV, trades, markets, prediction events, read-only raw GET endpoints—on
readbalances, orders, own trades, positionsan account with credentials existson when configured
tradingcreate/edit/cancel orders, leverage, margin, position opsper-account "trading": true (sandbox/demo) or "live"off
fundswithdraw, internal transfer, deposit addressesper-account "funds": true or "live"off
implicitWritesraw POST/PUT/DELETE endpoints (anything exchange-specific, incl. key mgmt)per-account "implicitWrites": trueoff

"trading": true deliberately works only on sandbox/demo accounts; live trading requires typing "trading": "live" and deciding a maxOrderValue (a number, or explicitly null to opt out). The same pattern applies to funds with maxTransferValue. Activating a tier is your responsibility — the server's job is honest gates, confirmation, and the audit journal (<cache-dir>/ccxt-mcp/journal/).

Tools

market — list_exchanges, describe_exchange, describe_method (search/signatures/per-exchange params + docs links), search_markets, get_tickers, get_orderbook, get_ohlcv, get_trades, search_events (prediction markets), call_read_method (any unified fetch*/load* — structurally read-only), call_implicit_get (raw GET endpoints), get_safety_status, fetch_route (best execution route for converting an asset at a given size across ~50 exchanges, via the CCXT order router — a quote, no keys needed).

live (WebSocket) — watch_subscribe opens a background ccxt.pro stream; watch_read returns fresh data. State streams are snapshots of "what is X right now" — watchTicker(s), watchOrderBook(ForSymbols), watchOHLCV, watchBalance, watchPositions, watchBidsAsks, watchMarkPrice(s): the server merges live updates into the full current set, so watch_read always returns every subscribed symbol in latest (a multi-symbol stream never shows just the one that last ticked). Event streams are logs — watchTrades and the private watchOrders/watchMyTrades/watch(My)Liquidations (private need an account): watch_read returns new items oldest-first in events with a cursor. Pass waitForChange: true to watch_read to block until the next update (or timeout) instead of polling — the efficient way to wait for a fill or position change. watch_unsubscribe stops it; watch_list shows active streams. The long-lived server holds the socket so the agent always has fresh data; idle streams auto-stop after 10 minutes.

read — list_accounts, get_balance, get_orders, get_my_trades, get_positions.

trading — create_order, edit_order, cancel_order, cancel_all_orders, set_leverage, set_margin_mode, call_write_method (allowlisted long tail: margin/position/batch-cancel ops), execute_route (executes a fetch_route result with ccxt's OrderRouter across your accounts — every order still bound by that account's caps, symbol lists and confirmation).

funds — withdraw, transfer, get_deposit_address. implicitWrites — call_implicit_write.

Every list result is capped and paginated to fit host context limits (with in-band truncation notices); the raw info payload is stripped by default. Prediction exchanges use the same tools with outcome handles (from search_events) in the symbol position.

Troubleshooting

  • "Trading is not enabled for account …" — edit the config file (see tiers above); this is not something the conversation can change.
  • AUTH_FAILED on a sandbox account — testnet keys come from the exchange's testnet portal, not your live account (and vice versa).
  • HTTP 451 / geo-blocks — some exchanges block cloud/VPN/US IPs; set a proxy via account options if needed.
  • Slow first call on a big exchange — the initial loadMarkets() can take seconds; it is cached on disk for 24h afterwards.
  • npx @modelcontextprotocol/inspector npx -y ccxt-mcp opens an interactive tool console.

Development (inside the ccxt monorepo)

bash
npm run mcp.ts          # run the server from live TypeScript sources (tsx)cd mcp && npm test      # unit + schema + integration testscd mcp && npm run build # tsc + regenerate js/data/method-docs.json

See DESIGN.md for the architecture, the prior-art analysis this server is built on, and the decision log.

來源:mcp/README.md,提交 fb16540

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v0.1.3最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

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

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

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

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