← MCP server and skill grades

ccxt-mcp

lazy-dinosaur/ccxt-mcp

B
Type
MCP server
Scanned
Nov 17, 2026
Version
71cd2a22bea3
Files read
26

This MCP server connects an AI assistant to cryptocurrency exchanges through the CCXT library to check market prices, read account balances and trade history, and place or cancel live buy and sell orders. Because it trades real funds with no server-side order caps, loss limits, or strict spot-only isolation, a prompt injection in untrusted text read by the AI—or an unchanged example token in remote SSE mode—could trigger unauthorized or leveraged trades on your exchange accounts.

What it can reach

Files
Reads the JSON configuration file from ~/.config/Claude/claude_desktop_config.json by default or from a custom path passed via --config.
Secrets
Loads cryptocurrency exchange API keys, secrets, passphrases, and private keys (plus mcpBearerToken for SSE mode) from the configuration file.
Network
Connects to external cryptocurrency exchange APIs via CCXT to fetch market data, read account balances and transaction histories, and execute or cancel live trading orders; optionally opens an HTTP+SSE listener (default 127.0.0.1:2298) when started with --sse.

Findings

1 medium2 low
  1. MediumOrder creation allows bypassing account defaultType and enforces no server-side risk or loss limits

    src/tools/order-tools.ts:68

    Even when an account is configured with 'defaultType': 'spot', the createOrder tool passes arbitrary exchange-specific 'params' and any 'symbol' straight to CCXT's createOrder method. In CCXT, per-order parameters (such as {'type': 'swap'}, {'category': 'linear'}, or {'marginMode': 'cross'}) and derivative contract symbols override the account's defaultType, allowing leveraged margin or futures orders if the underlying exchange API key permits them. In addition, although the README lists 'Maximum allowable loss limit (daily/weekly)' and risk management under Key Features, the server enforces no order-size caps or loss limits in code, so a prompt injection in untrusted content read by the agent could place unrestricted trades.

    Fix: Strip or reject market-type and margin/leverage override keys in 'params' (and reject contract symbols) when they conflict with the account's configured 'defaultType', validate that 'amount' is positive and within a configurable per-order/daily cap, and update the README to accurately describe what is enforced by the server.

  2. LowRemote SSE mode accepts known placeholder bearer tokens from the example configuration

    src/index.ts:89

    The shipped config/ccxt-config.example.json file pre-fills 'mcpBearerToken' with 'REPLACE_WITH_A_LONG_RANDOM_TOKEN' (and README examples use 'YOUR_MCP_TOKEN'), while readMcpBearerTokenFromConfig only checks that mcpBearerToken is a non-empty string. If a user copies the example configuration file as instructed for Docker/SSE setup, fills in their exchange API keys, and forgets to replace mcpBearerToken, the server starts without warning and grants full trading access over HTTP+SSE to anyone who sends the public placeholder token.

    Fix: Reject known placeholder values (such as 'REPLACE_WITH_A_LONG_RANDOM_TOKEN' and 'YOUR_MCP_TOKEN') and enforce a minimum token length/entropy requirement in readMcpBearerTokenFromConfig before starting the SSE server.

  3. LowBearer token authentication in SSE mode uses non-constant-time string comparison

    src/index.ts:144

    When running with --sse, the HTTP server compares the incoming Authorization bearer token against expectedBearerToken using JavaScript's '!==' operator instead of crypto.timingSafeEqual. Standard string comparison returns early on length mismatches or the first differing character, leaking small timing differences that weaken authentication when the SSE endpoint is exposed over a network.

    Fix: Hash both tokens with SHA-256 (or compare equal-length buffers) and verify equality using node:crypto's timingSafeEqual.