Codex CCXT MCP

io.github.lucyfox199818-collabPublished by GitHub account lucyfox199818-collabv0.1.0Updated Oct 24, 2026

Dry-run-first CCXT MCP with market, account, derivatives, and guarded trading tools.

VerifiedSTDIODesktop onlyFinanceDeveloper Tools

Overview

AI-generated overview

A local CCXT-based MCP server that gives an assistant read access to crypto exchange market and account data, plus guarded, dry-run-first trading tools.

What you can do
Read market data: markets, tickers, order books, trades, OHLCV, exchange status and time, currencies and fees, with a generic call for any CCXT method on the configured exchange instance. Read account data: balances, positions, leverage tiers, ledger, own trades, deposits, withdrawals and deposit addresses. Read derivatives data: funding rates and history, open interest, mark and index prices, and Binance USDT-M public long/short and taker sentiment endpoints. Query orders: open, closed, canceled and algo orders. Place, edit and cancel orders, including limit, market, trigger, stop-loss, take-profit, trailing, post-only and reduce-only variants and protected futures entries. Change account/f
When to use it
Use it when you want an assistant to inspect crypto exchange markets, balances, positions and order history, or to prepare and place orders on a CCXT-supported exchange, especially Binance. It suits users who want trading actions gated behind explicit opt-in and dry-run defaults.
Requirements
Runs locally over stdio, either as the published OCI image via Docker or from source with Node.js (npm install, build, then run the entry file). Optional Binance API key and secret are supplied through environment variables; exchange, market type, sandbox, proxy and IP-whitelist settings are also environment variables. Network access to the exchange and to an IP-check endpoint is needed.
Before you install
The API key and secret grant access to a real exchange account; keep them scoped and stored safely. Live trading is possible: real orders, cancellations, leverage and margin changes, transfers and withdrawals are only blocked while the trading gate stays off and dry-run stays on, so verify both settings. Withdrawals and transfers move funds. The generic CCXT call tool can reach any method on the exchange instance, widening what the assistant can do. Proxy and IP-check settings send traffic to a,

Installation

In SourceWeft

  1. Open Codex CCXT MCP in the dashboard and add it to a workspace.
  2. Enable the server for the chats that should use its tools.

Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.

Other MCP clients

Follow the launch instructions in the repository.

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。

环境变量

变量说明
TRADINGAGENTS_PROXY_URL / CCXT_PROXY_URLHTTP、HTTPS、SOCKS4 或 SOCKS5 代理 URL。
BINANCE_API_KEY / CCXT_API_KEYAPI key。
BINANCE_API_SECRET / CCXT_SECRET / CCXT_API_SECRETAPI secret。
CCXT_EXCHANGE_IDCCXT 交易所 ID,默认 binance。
CCXT_DEFAULT_TYPEBinance 常用市场类型,例如 spot、future、swap。
CCXT_SANDBOX是否开启交易所 sandbox/testnet。
CCXT_ENABLE_TRADING是否允许真实交易类调用,默认 false。
CCXT_DRY_RUN是否强制 dry-run,默认 true。
CCXT_WHITELIST_IPS / BINANCE_WHITELIST_IPS逗号分隔的预期出口 IP,用于 ccxt_proxy_ip 对比。
CCXT_IP_CHECK_URL出口 IP 检查地址,默认 https://api.ipify.org?format=json。

本地运行

bash
cd ccxt-mcpnpm installnpm run buildnode dist/index.js

Codex MCP stdio 配置示例:

json
{  "mcpServers": {    "ccxt": {      "command": "node",      "args": ["/home/adon/codes/codex-binance-agent/ccxt-mcp/dist/index.js"],      "cwd": "/home/adon/codes/codex-binance-agent/ccxt-mcp"    }  }}

Docker

直接运行公开镜像:

bash
docker run --rm -i \  -e CCXT_ENABLE_TRADING=false \  -e CCXT_DRY_RUN=true \  ghcr.io/lucyfox199818-collab/ccxt-mcp:0.1.0

或从源码构建:

bash
cd ccxt-mcpdocker build -t ccxt-mcp:local .docker run --rm -i --env-file .env ccxt-mcp:local

Docker MCP stdio 配置示例:

json
{  "mcpServers": {    "ccxt": {      "command": "docker",      "args": ["run", "--rm", "-i", "--env-file", "/home/adon/codes/codex-binance-agent/ccxt-mcp/.env", "ccxt-mcp:local"]    }  }}

工具列表

当前显式注册 101 个 MCP tools;此外 ccxt_call 可以调用当前交易所实例上存在的任意 CCXT 方法。

基础和市场数据:

  • ccxt_get_config
  • ccxt_list_exchanges
  • ccxt_exchange_info
  • ccxt_proxy_ip
  • ccxt_load_markets
  • ccxt_fetch_currencies
  • ccxt_fetch_status
  • ccxt_fetch_time
  • ccxt_fetch_ticker
  • ccxt_fetch_tickers
  • ccxt_fetch_ticker_summary
  • ccxt_fetch_order_book
  • ccxt_fetch_trades
  • ccxt_fetch_ohlcv
  • ccxt_fetch_trading_fees
  • ccxt_fetch_trading_fee
  • ccxt_fetch_deposit_withdraw_fees
  • ccxt_fetch_deposit_withdraw_fee
  • ccxt_call

账户信息:

  • ccxt_fetch_accounts
  • ccxt_fetch_balance
  • ccxt_fetch_free_balance
  • ccxt_fetch_used_balance
  • ccxt_fetch_total_balance
  • ccxt_fetch_positions
  • ccxt_fetch_positions_for_symbol
  • ccxt_fetch_positions_risk
  • ccxt_fetch_positions_history
  • ccxt_fetch_leverage
  • ccxt_fetch_leverages
  • ccxt_fetch_leverage_tiers
  • ccxt_fetch_market_leverage_tiers
  • ccxt_fetch_ledger
  • ccxt_fetch_ledger_entry
  • ccxt_fetch_my_trades
  • ccxt_fetch_order_trades
  • ccxt_fetch_deposit_address
  • ccxt_fetch_deposit_addresses
  • ccxt_fetch_deposit_addresses_by_network
  • ccxt_fetch_deposits
  • ccxt_fetch_withdrawals
  • ccxt_fetch_deposits_withdrawals
  • ccxt_fetch_borrow_interest

订单和条件单:

  • ccxt_fetch_order
  • ccxt_fetch_orders
  • ccxt_fetch_open_orders
  • ccxt_fetch_open_algo_orders
  • ccxt_cancel_algo_order
  • ccxt_cancel_all_algo_orders
  • ccxt_fetch_closed_orders
  • ccxt_fetch_canceled_orders
  • ccxt_fetch_canceled_and_closed_orders
  • ccxt_create_order
  • ccxt_create_orders
  • ccxt_edit_order
  • ccxt_edit_orders
  • ccxt_cancel_order
  • ccxt_cancel_orders
  • ccxt_cancel_all_orders
  • ccxt_cancel_all_orders_after
  • ccxt_cancel_orders_for_symbols
  • ccxt_create_limit_order
  • ccxt_create_market_order
  • ccxt_create_trigger_order
  • ccxt_create_stop_loss_order
  • ccxt_create_take_profit_order
  • ccxt_create_protected_futures_entry
  • ccxt_create_order_with_take_profit_and_stop_loss
  • ccxt_create_trailing_amount_order
  • ccxt_create_trailing_percent_order
  • ccxt_create_stop_order
  • ccxt_create_stop_limit_order
  • ccxt_create_stop_market_order
  • ccxt_create_post_only_order
  • ccxt_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_rate
  • ccxt_fetch_funding_rates
  • ccxt_fetch_funding_rate_history
  • ccxt_fetch_funding_history
  • ccxt_fetch_open_interest
  • ccxt_fetch_open_interests
  • ccxt_fetch_open_interest_history
  • ccxt_fetch_binance_derivatives_sentiment
  • ccxt_fetch_binance_global_long_short_account_ratio
  • ccxt_fetch_binance_top_long_short_account_ratio
  • ccxt_fetch_binance_top_long_short_position_ratio
  • ccxt_fetch_binance_taker_long_short_ratio
  • ccxt_fetch_binance_open_interest_hist
  • ccxt_fetch_mark_price
  • ccxt_fetch_mark_prices
  • ccxt_fetch_mark_ohlcv
  • ccxt_fetch_index_ohlcv
  • ccxt_fetch_premium_index_ohlcv
  • ccxt_set_leverage
  • ccxt_set_margin_mode
  • ccxt_set_position_mode
  • ccxt_add_margin
  • ccxt_reduce_margin
  • ccxt_set_margin
  • ccxt_transfer
  • ccxt_withdraw

所有 mutating 工具都会经过交易开关。默认返回 dry-run,不会真实请求下单、撤单、改杠杆、划转或提现类操作。

联系方式

  • 微信:mypcwza
  • Telegram:mypcwza

Source: ccxt-mcp/README.md at commit 04b7c7a

Tools

0
SourceWeft has not started this package in its sandbox yet, so its tools are not known.

Version history

1
  1. v0.1.0LatestSep 16, 2026

Score

40% of the applicable checks met

How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.

  • Reached in the last 30 days25 pts

    Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.

  • Auth declared10 pts

    Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.

  • Tools listed15 pts

    Answer tools/list without a credential, or ship a package that starts in a sandbox without one.

  • DescriptionRequired15 pts
  • Logo10 pts
  • Documentation15 pts
  • License10 pts

    Declare a license in the repository or the registry entry.