cdcx
MCP server for the Crypto.com Exchange API, providing 86 dynamically generated tools for market data, trading, account management, and more with real-time WebSocket streaming and safety enforcement.
README
cdcx
A CLI, MCP server, and terminal dashboard for the Crypto.com Exchange API. Single binary, zero runtime dependencies.
86 REST endpoints across 10 API groups, dynamically generated from the Crypto.com Exchange OpenAPI spec. Real-time WebSocket streaming. Full-screen TUI dashboard. Paper trading. Works as a standalone CLI, an MCP tool server for AI agents, or an interactive terminal.
Caution: This software interacts with the live Crypto.com Exchange and can execute real financial transactions. Test with
cdcx paperbefore using real funds.
Install
curl -sSfL https://raw.githubusercontent.com/crypto-com/cdcx-cli/main/install.sh | sh
From source:
cargo install --git https://github.com/crypto-com/cdcx-cli.git --bin cdcx
Why cdcx?
For AI Agents
Every response is structured JSON. 86 MCP tools with typed parameters, enum validation, safety enforcement, and schema discovery — all generated from the OpenAPI spec at runtime. Your LLM can trade, analyze markets, and manage positions without custom tooling.
cdcx mcp config --enable trade,account
Compatible with Claude Code, Cursor, Claude Desktop, Codex, Github Copilot, Gemini CLI, and other MCP clients. Includes 13 agent skill files in skills/ for guided workflows.
Things you can ask your AI agent:
"What's the current BTC price and 24h volume?"
"Paper trade BTC for a few rounds and show me the P&L"
"Place an OTOCO bracket on BTC_USDT: entry at 70000, stop-loss at 65000, take-profit at 75000"
For the Command Line
Every endpoint is a command. --help on everything. --dry-run to preview. --output json for scripting. Tab completion. Profiles for multi-account.
cdcx market ticker BTC_USDT -o table
cdcx trade order BUY BTC_USDT 0.001 --dry-run
cdcx stream ticker BTC_USDT ETH_USDT
cdcx paper buy BTC_USDT --quantity 0.01
For the Dashboard
Full-screen terminal trading interface. 6 tabs, real-time streaming, candlestick charts, heatmap mode, split screen, order workflows. Zero flicker.
cdcx tui
Press p to toggle paper mode. Press O for OTOCO bracket orders. Press ? for all shortcuts.
Quick Start
Public market data works without credentials:
cdcx market ticker BTC_USDT -o table
cdcx market book BTC_USDT --depth 10 -o table
cdcx market candlestick BTC_USDT --timeframe 1h -o table
Paper trading works without credentials:
cdcx paper init --balance 50000
cdcx paper buy BTC_USDT --quantity 0.01
cdcx paper positions
cdcx paper balance
For trading, set credentials:
export CDCX_API_KEY="your-key"
export CDCX_API_SECRET="your-secret"
cdcx account summary
MCP Server
Expose the Exchange API as MCP tools for AI agents:
cdcx mcp # Start server (reads config)
cdcx mcp config # Show current config
cdcx mcp config --enable trade,account # Enable service groups
cdcx mcp config --allow-dangerous # Allow withdrawals, cancel-all
cdcx mcp config --reset # Reset to defaults (market only)
Service groups: market, account, trade, advanced, margin, staking, funding, fiat, otc, stream
Configuration is stored in ~/.config/cdcx/mcp.toml and persists across updates.
Note:
accountalso exposes historical endpoints (orders, trades, transactions).fundingcovers wallet deposit/withdrawal endpoints. Paper trading is a CLI-only feature and has no MCP tools.
Safety Model
| Tier | Behavior | Examples |
|---|---|---|
| read | No confirmation | market ticker, market book |
| sensitive_read | No confirmation | account summary, trade open-orders |
| mutate | Requires acknowledged: true |
trade order, trade cancel |
| dangerous | Requires --allow-dangerous |
trade cancel-all, wallet withdraw |
Plugin Installation
Install cdcx as a one-click plugin from your AI coding tool's marketplace.
Claude Code:
claude plugin marketplace add crypto-com/cdcx-cli
claude plugin install cdcx-cli@cdcx-cli
Codex CLI:
codex plugin marketplace add crypto-com/cdcx-cli
Other: Open Settings > MCP Servers, add:
{
"cdcx": {
"command": "npx",
"args": ["-y", "@cryptocom/cdcx-cli@latest", "mcp"]
}
}
Then configure services with cdcx mcp config --enable trade,account.
Switching Profiles for MCP
The MCP server reads CDCX_PROFILE from the environment to select which config profile to use. Set it in your MCP client's env config.
Claude Code (~/.claude/settings.json):
{
"env": {
"CDCX_PROFILE": "uat"
}
}
Other MCP clients — add "env" to the server definition:
{
"cdcx": {
"command": "npx",
"args": ["-y", "@cryptocom/cdcx-cli@latest", "mcp"],
"env": {
"CDCX_PROFILE": "prod"
}
}
}
This selects the matching [profiles.<name>] section from ~/.config/cdcx/config.toml.
Agent Skills
13 skill files in skills/ covering:
| Skill | Purpose |
|---|---|
cdcx-market-intel |
Market analysis and price discovery |
cdcx-portfolio-intel |
Portfolio analysis and risk assessment |
cdcx-execution |
Order placement with safety checks |
cdcx-advanced |
OCO, OTO, OTOCO contingency orders |
cdcx-paper-strategy |
Paper trading strategy testing |
cdcx-wallet-ops |
Deposits, withdrawals, network management |
cdcx-auth-setup |
Credential configuration |
cdcx-autonomy-levels |
Safety tier configuration |
cdcx-check-balance |
Balance and credential verification |
cdcx-place-limit-order |
Limit order workflow with preflight checks |
cdcx-isolated-margin |
Isolated margin trading (equity/RWA perpetuals) |
recipe-morning-brief |
Daily market briefing workflow |
recipe-emergency-flatten |
Emergency position flattening |
CLI Reference
Market Data (public)
cdcx market ticker # All tickers
cdcx market ticker BTC_USDT # Single instrument
cdcx market book BTC_USDT --depth 20 # Order book
cdcx market trades BTC_USDT # Recent trades
cdcx market candlestick BTC_USDT --timeframe 1h
cdcx market instruments # All instruments
Trading (requires auth)
cdcx trade order BUY BTC_USDT 0.001 --type LIMIT --price 50000
cdcx trade open-orders
cdcx trade cancel --order-id ORDER_ID
cdcx trade cancel-all
Advanced Orders
cdcx advanced create-oto --instrument-name BTC_USDT ...
cdcx advanced create-otoco --instrument-name BTC_USDT ...
cdcx advanced open-orders
Paper Trading
Local paper trading engine with live market prices. No auth required.
cdcx paper init --balance 50000 # Create account
cdcx paper buy BTC_USDT --quantity 0.01 # Market buy
cdcx paper sell BTC_USDT --quantity 0.01 # Market sell
cdcx paper buy BTC_USDT --quantity 0.01 --price 65000 # Limit buy
cdcx paper positions # Portfolio + P&L
cdcx paper history # Trade history
cdcx paper balance # Account balance
cdcx paper reset --balance 100000 # Reset account
Streaming (WebSocket)
cdcx stream ticker BTC_USDT ETH_USDT # Real-time tickers
cdcx stream book BTC_USDT # Order book updates
cdcx stream trades BTC_USDT # Trade executions
cdcx stream orders # Your order updates (auth)
cdcx stream positions # Position changes (auth)
Account
cdcx account summary # Balances
cdcx account positions # Open positions
cdcx trade fee-rate # Fee rates
History / Wallet / Staking / Fiat / Margin
cdcx history orders cdcx wallet deposit-address --currency BTC
cdcx history trades cdcx wallet deposit-history
cdcx history transactions cdcx wallet withdrawal-history
cdcx staking instruments cdcx fiat accounts
cdcx staking positions cdcx margin transfer --dry-run
Interactive Dashboard
cdcx tui # Launch
cdcx tui --theme amber # With theme
cdcx tui --setup # Setup wizard
Features
- 6 tabs: Market, Portfolio, Orders, History, Watchlist, Positions
- Real-time streaming: WebSocket ticker, order book, candlestick, trade channels
- Sparklines: 24h Braille-dot price charts inline per instrument
- Heatmap mode: rows glow red/green by 24h performance
- Candlestick charts: volume bars, 9 timeframes, streaming updates, time axis
- Multi-chart compare: up to 4 instruments side by side
- Split screen: table + chart, auto-updates on selection
- Order book detail: cumulative depth bars, buy/sell pressure bar
- Order workflows: place order, OCO, OTOCO, cancel
- Live portfolio P&L: session P&L in status bar, cash vs position breakdown in Portfolio tab
- Paper mode: toggle
pto trade against local paper engine with unrealized/realized P&L - Instrument picker: search-as-you-type overlay
- Price alerts: set thresholds with terminal bell notification
- Ticker tape: scrolling top movers banner
- 6 themes: terminal-pro, cyber-midnight, monochrome, neon, micky-d, amber + custom TOML
- Mouse support: click to select, scroll, double-click to detail
- Export:
ycopies table as CSV to clipboard
Keyboard Shortcuts
| Key | Action |
|---|---|
1-6 / Tab |
Switch tabs |
Enter |
Instrument detail (book + trades) |
k |
Candlestick chart |
m |
Compare charts (up to 4) |
h |
Toggle heatmap |
i |
Instrument spotlight |
\ |
Split screen (table + chart) |
[ / ] |
Cycle chart timeframe |
s / S |
Sort / reverse sort |
/ |
Search instruments |
t |
Place order |
o |
OCO order (stop-loss + take-profit) |
O |
OTOCO order (entry + SL + TP) |
c |
Cancel orders |
p |
Toggle LIVE / PAPER mode |
! |
Set price alert |
y |
Copy to clipboard (CSV) |
, |
Settings (theme, MCP services) |
? |
Help overlay |
q |
Quit |
Configuration
Credentials
Resolved in order: flags > CDCX_API_KEY/CDCX_API_SECRET env > CDC_API_KEY/CDC_API_SECRET env > ~/.config/cdcx/config.toml profile.
Empty or whitespace-only env vars are treated as unset and fall through to the config file.
cdcx setup # Interactive credential setup
cdcx --profile uat account summary # Use named profile
cdcx auth list # Show all profiles with auth status
MCP Config
~/.config/cdcx/mcp.toml (managed via cdcx mcp config or TUI settings):
services = ["market", "trade", "account"]
allow_dangerous = false
TUI Config
~/.config/cdcx/tui.toml:
theme = "terminal-pro"
tick_rate_ms = 250
watchlist = ["BTC_USDT", "ETH_USDT", "SOL_USDT", "CRO_USDT"]
[themes.my-theme]
bg = "#1a1a2e"
accent = "#00d4ff"
positive = "#00ff88"
negative = "#ff4444"
Global Flags
| Flag | Description |
|---|---|
-o, --output |
Output format: json (default), table, ndjson |
--dry-run |
Preview request without executing |
--env |
Environment: production (default), uat |
--profile |
Config profile name |
--yes |
Skip confirmation prompts |
-v, --verbose |
Verbose output |
Architecture
crates/cdcx-core/ # API client, auth, signing, schema, OpenAPI parser, paper engine
crates/cdcx-cli/ # CLI binary, dispatch, MCP server, setup
crates/cdcx-tui/ # Terminal dashboard (ratatui + crossterm)
schemas/ # CLI overlay files (command aliases, positional args, defaults)
skills/ # Agent skill files for guided workflows
site/ # Marketing site (single HTML file)
- OpenAPI sole source: All API commands and MCP tools are generated from the exchange's OpenAPI spec at runtime (24h cache). Thin TOML overlay files in
schemas/add CLI-only metadata (positional args, defaults, command aliases). No hand-maintained endpoint definitions. - Single binary: ~11MB, no runtime dependencies
- Zero flicker: ratatui double-buffer character-level diffing
Development
cargo test # Run all tests
cargo build --release # Build release binary
cargo run -- market ticker BTC_USDT # Run from source
cargo run -- tui # TUI from source
Git hooks
Install once per clone to catch CI failures locally:
./hooks/install.sh
pre-commitrunscargo fmt --check+cargo clippy -- -D warningspre-pushruns the full test suite (skipped for doc-only pushes)
The toolchain is pinned to stable via rust-toolchain.toml; run rustup update stable if your local clippy is older than CI's.
License
Dual-licensed under MIT and Apache 2.0.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。