
Codex CCXT MCP
io.github.lucyfox199818-collab由 GitHub 帳號 lucyfox199818-collab 發布v0.1.0更新於 Oct 24, 2026
Dry-run-first CCXT MCP with market, account, derivatives, and guarded trading tools.
概覽
一個以 CCXT 為基礎的本機 MCP 伺服器,讓助理讀取加密貨幣交易所的行情與帳戶資料,並提供受開關保護、預設 dry-run 的交易工具。
- 可以做什麼
- 讀取行情:市場、報價、訂單簿、成交、OHLCV、交易所狀態與時間、幣種與手續費,並提供通用呼叫以存取所設定交易所實例上的任意 CCXT 方法。讀取帳戶:餘額、持倉、槓桿級距、帳本、自己的成交、充值提領紀錄與充值地址。讀取衍生品資料:資金費率與歷史、未平倉量、標記價與指數價,以及 Binance USDT-M 公開的多空帳戶與吃單情緒端點。查詢訂單:未成交、已成交、已取消及條件單。下單、改單與取消,包括限價、市價、觸發、停損、停利、追蹤、post-only、reduce-only 及帶保護的合約進場。變更帳戶與合約設定:槓桿、保證金模式、持倉模式、保證金增減、劃轉與提領。
- 適用情境
- 適合讓助理查看加密貨幣交易所的行情、餘額、持倉和訂單歷史,或在 CCXT 支援的交易所(尤其是 Binance)上準備並送出訂單。也適合希望交易操作必須明確開啟、且預設走 dry-run 的使用者。
- 執行需求
- 以 stdio 在本機執行,可用 Docker 執行已發布的 OCI 映像,或以 Node.js 從原始碼安裝建置後執行進入點檔案。可選的 Binance API key 與 secret 透過環境變數提供;交易所、市場類型、sandbox、代理和 IP 白名單也透過環境變數設定。需要連線交易所網路以及一個 IP 查詢端點。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Codex CCXT MCP,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
ccxt-mcp
ccxt-mcp 是一个独立的 MCP stdio 服务,用 CCXT 暴露加密货币交易所能力给 Codex 调用。默认交易关闭并启用 dry-run;需要真实下单时必须同时设置 CCXT_ENABLE_TRADING=true 和 CCXT_DRY_RUN=false。
MCP Registry 名称:io.github.lucyfox199818-collab/ccxt-mcp
公开 OCI 镜像:ghcr.io/lucyfox199818-collab/ccxt-mcp:0.1.0
功能
- 市场数据:markets、ticker、tickers、ticker summary、order book、trades、OHLCV、交易所状态、交易所时间、币种、手续费。
- 账户信息:accounts、balance/free/used/total balance、positions、ledger、my trades、充值/提现记录、充值地址、杠杆档位。
- 订单交易:普通下单/批量下单、查询订单、查询全部订单、编辑订单、撤单、批量撤单、全部撤单。
- 条件单和衍生品交易:trigger、stop loss、take profit、stop order、stop limit、stop market、trailing、post-only、reduce-only、TP/SL 组合单。
- 合约/资金费率:funding rate/history、open interest/history、mark price、mark/index/premium index OHLCV。
- Binance USDT-M 公共衍生品情绪数据:open-interest history、global long/short、top trader account/position long/short、taker buy/sell volume,均为只读免费公开数据端点。
- 账户变更:set leverage、margin mode、position mode、add/reduce/set margin、transfer、withdraw,全部走交易开关和 dry-run 保护。
- 通用能力:
ccxt_call可以调用当前交易所实例上存在的任意 CCXT 方法,包含 unified API 和 exchange-specific implicit API。 - 代理/IP:支持
TRADINGAGENTS_PROXY_URL或CCXT_PROXY_URL,并提供ccxt_proxy_ip检查当前出口 IP 是否命中配置的白名单 IP。 - Docker:支持构建成独立镜像,通过 stdio 运行 MCP。
环境变量
本地运行
Codex MCP stdio 配置示例:
Docker
直接运行公开镜像:
或从源码构建:
Docker MCP stdio 配置示例:
工具列表
当前显式注册 101 个 MCP tools;此外 ccxt_call 可以调用当前交易所实例上存在的任意 CCXT 方法。
基础和市场数据:
ccxt_get_configccxt_list_exchangesccxt_exchange_infoccxt_proxy_ipccxt_load_marketsccxt_fetch_currenciesccxt_fetch_statusccxt_fetch_timeccxt_fetch_tickerccxt_fetch_tickersccxt_fetch_ticker_summaryccxt_fetch_order_bookccxt_fetch_tradesccxt_fetch_ohlcvccxt_fetch_trading_feesccxt_fetch_trading_feeccxt_fetch_deposit_withdraw_feesccxt_fetch_deposit_withdraw_feeccxt_call
账户信息:
ccxt_fetch_accountsccxt_fetch_balanceccxt_fetch_free_balanceccxt_fetch_used_balanceccxt_fetch_total_balanceccxt_fetch_positionsccxt_fetch_positions_for_symbolccxt_fetch_positions_riskccxt_fetch_positions_historyccxt_fetch_leverageccxt_fetch_leveragesccxt_fetch_leverage_tiersccxt_fetch_market_leverage_tiersccxt_fetch_ledgerccxt_fetch_ledger_entryccxt_fetch_my_tradesccxt_fetch_order_tradesccxt_fetch_deposit_addressccxt_fetch_deposit_addressesccxt_fetch_deposit_addresses_by_networkccxt_fetch_depositsccxt_fetch_withdrawalsccxt_fetch_deposits_withdrawalsccxt_fetch_borrow_interest
订单和条件单:
ccxt_fetch_orderccxt_fetch_ordersccxt_fetch_open_ordersccxt_fetch_open_algo_ordersccxt_cancel_algo_orderccxt_cancel_all_algo_ordersccxt_fetch_closed_ordersccxt_fetch_canceled_ordersccxt_fetch_canceled_and_closed_ordersccxt_create_orderccxt_create_ordersccxt_edit_orderccxt_edit_ordersccxt_cancel_orderccxt_cancel_ordersccxt_cancel_all_ordersccxt_cancel_all_orders_afterccxt_cancel_orders_for_symbolsccxt_create_limit_orderccxt_create_market_orderccxt_create_trigger_orderccxt_create_stop_loss_orderccxt_create_take_profit_orderccxt_create_protected_futures_entryccxt_create_order_with_take_profit_and_stop_lossccxt_create_trailing_amount_orderccxt_create_trailing_percent_orderccxt_create_stop_orderccxt_create_stop_limit_orderccxt_create_stop_market_orderccxt_create_post_only_orderccxt_create_reduce_only_order
Binance USDT-M close-position 保护单默认会跳过同合约、同方向、同仓位方向的重复
STOP_MARKET / TAKE_PROFIT_MARKET algo 单。需要替换已有保护单时,在创建请求的
params 里显式传 replaceExistingClosePosition: true;工具会先取消匹配的旧 algo 单,
再提交新的 close-position 保护单,并返回撤单和新单结果。
Binance USDT-M protected entry 应优先使用 ccxt_create_protected_futures_entry。该工具会先提交
close-position 止损和止盈 algo 保护单,再提交入场单;如果任一保护单或入场单创建失败,会撤销已经
接受的保护单并返回失败阶段。对 Binance futures 调用
ccxt_create_order_with_take_profit_and_stop_loss 时,服务端也会自动走同一条保护优先路径,避免直通
CCXT 当前不支持的 createOrderWithTakeProfitAndStopLoss。
Binance USDT-M hedge mode 下,关闭 positionSide=LONG / SHORT 的普通订单不应向交易所提交
reduceOnly 参数。服务端会在普通下单工具里自动移除该参数;ccxt_create_reduce_only_order 在此场景下
会改走 createOrder 并保留 positionSide,避免 Binance 返回 -1106 Parameter 'reduceonly' sent when not required。
合约和账户变更:
ccxt_fetch_funding_rateccxt_fetch_funding_ratesccxt_fetch_funding_rate_historyccxt_fetch_funding_historyccxt_fetch_open_interestccxt_fetch_open_interestsccxt_fetch_open_interest_historyccxt_fetch_binance_derivatives_sentimentccxt_fetch_binance_global_long_short_account_ratioccxt_fetch_binance_top_long_short_account_ratioccxt_fetch_binance_top_long_short_position_ratioccxt_fetch_binance_taker_long_short_ratioccxt_fetch_binance_open_interest_histccxt_fetch_mark_priceccxt_fetch_mark_pricesccxt_fetch_mark_ohlcvccxt_fetch_index_ohlcvccxt_fetch_premium_index_ohlcvccxt_set_leverageccxt_set_margin_modeccxt_set_position_modeccxt_add_marginccxt_reduce_marginccxt_set_marginccxt_transferccxt_withdraw
所有 mutating 工具都会经过交易开关。默认返回 dry-run,不会真实请求下单、撤单、改杠杆、划转或提现类操作。
联系方式
- 微信:
mypcwza - Telegram:
mypcwza
來源:ccxt-mcp/README.md,提交 04b7c7a
工具
0版本歷史
1- v0.1.0最新Sep 16, 2026
評分
已滿足適用檢查項的 40%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分
請在儲存庫或註冊中心條目中宣告授權條款。
