AGENTS

An integration guide for cdcx, a command-line tool and MCP server for account and cryptocurrency trading operations. MCP is a standard way for an AI agent to call external tools.

In plain words
What is it for?
Use it to configure cdcx for an agent, verify credentials, start its MCP server, and follow documented trading workflows.
Why use it?
It explains how agents authenticate, handle errors, respect rate limits, and use safety levels before making account or trading requests.

Agent

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/crypto-com/cdcx-cli/agents
Clone the repo
git clone --depth 1 https://github.com/crypto-com/cdcx-cli
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 3,670 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.03670
Opus 5 $0.00000 $0.01835
Sonnet 5 $0.00000 $0.00734
Haiku 4.5 $0.00000 $0.00367

Measured yesterday against content hash 9a0a79fbfc67, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

AGENTS scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Runs shell commandslowCapability

Expected in a hook, worth knowing in a rule or an instructions file.

result = subprocess.run(command, capture_output=True, text=True)
agents/AGENTS.md · 516 lines

How it starts

The opening of the file, as written. The whole thing — 516 lines — stays where its author put it; the contents beside it link to each section on GitHub.

cdcx Agent Integration Guide

This guide provides comprehensive integration documentation for AI agents using the cdcx CLI and MCP server.

Table of Contents

  1. Authentication
  2. Error Handling
  3. Rate Limiting
  4. Safety Tiers
  5. MCP Server Setup
  6. Example Workflows
  7. Best Practices

Authentication

Credential Resolution

The CLI resolves credentials in this order:

  1. Environment variables (highest priority)

    export CDC_API_KEY="ABC123"
    export CDC_API_SECRET="XYZ789"
    cdcx account info
    
  2. Config file (lowest priority)

    # ~/.config/cdcx/config.toml
    [profiles.default]
    api_key = "ABC123"
    api_secret = "XYZ789"
    

Verification

Before executing trading or account operations, verify authentication:

cdcx account info

Expected response on success:

{"status":"ok","result":{...account data...}}

Expected response on auth failure:

{
  "status":"error",
  "error":{
    "category":"auth",
    "code":10002,
    "message":"Invalid API key",
    "retryable":false
  }
}

For Agents Using MCP

Configure services and start the MCP server:

cdcx mcp config --enable trade,account
cdcx mcp

The server will attempt to resolve credentials from the environment or config file. If credentials are not available for private endpoints, the MCP server will reject requests with an auth error.

Error Handling

Error Categories

All errors returned by cdcx fall into well-defined categories. Each error envelope includes:

  • category — Error classification (see table below)
  • code — CDC exchange error code (0 for non-CDC errors)
  • message — Human-readable error message
  • retryable — Whether the operation should be retried
Category Description CDC Codes Retryable Guidance
auth Authentication or authorization failure 10002, 10003, 10006, 10007, 40101, 40102 No Check API key and secret. Verify permissions on the key.
validation Invalid parameters or request format 10001, 10004, 10005, 10008, 10009 No Check parameter types and values. Use cdcx schema show <method> to verify.
safety Operation blocked by safety rails N/A No Set acknowledged=true in parameters for mutate-tier commands.
rate_limit Too many requests (HTTP 429) 42901 Yes Implement exponential backoff (start with 1s, max 32s).
insufficient_funds Account balance too low 20001, 306 No Check balance with cdcx account summary before retrying.
order_error Order rejection or processing failure 20002, 20005, 20006, 20007, 318 Maybe Verify order parameters. Check if order was partially filled.
network Connection, timeout, or I/O error N/A Yes Retry with exponential backoff.
api API returned non-zero code (unmapped) Varies Depends Check code and message for guidance.
config Configuration or setup error N/A No Fix configuration. Check file paths and syntax.
io File or stream I/O error N/A Maybe Check file permissions and disk space.

Read the full file on GitHub · 516 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 516 lines · 0 tokens per session scan A 9a0a79fbfc67

Subscribe to this mod's changes

AGENTS is an agent published in the GitHub repository crypto-com/cdcx-cli (24 stars, last pushed 1mo ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 3,670 tokens. A static security scan graded it A with 1 finding (runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other agents, from other repositories

Demonstrate

Agent for demonstrating VS Code features.

microsoft/vscode · 10 tokens

playwright-test-generator

Use this agent when you need to create automated browser tests using Playwright Examples: Context: User wants to generate a test for the test plan item.

microsoft/playwright · 151 tokens

.NET-Notebook-Migration-Agent

Expert .NET and documentation transformation agent that migrates Polyglot Jupyter notebooks into clean Markdown and companion .NET sample code.

microsoft/ai-agents-for-beginners · 33 tokens

AVM Owner Triage

Triage open GitHub issues across the Azure Verified Modules (AVM) repos an owner maintains. Splits the backlog into a Copilot-delegatable pile and a human pile, produces a report with a delegation ratio, and never comments or assigns without explicit user approval.

github/awesome-copilot · 61 tokens

Ultimate Transparent Thinking Beast Mode

Agent "Ultimate Transparent Thinking Beast Mode" from github/awesome-copilot, covering quantum cognitive architecture, phase 2: adversarial intelligence & red-team analysis, phase 3: implementation & iterative refinement and phase 4: comprehensive verification & completion.

github/awesome-copilot · 11 tokens

code-reviewer

Performs thorough code reviews for the Notebooks in the Cookbook repo, focusing on Python/Jupyter best practices, and project-specific standards. Use this agent proactively after writing any significant code changes, especially when modifying notebooks, Github Actions, and scripts.

anthropics/claude-cookbooks · 52 tokens