
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 分
请在仓库或注册中心条目中声明许可证。
