mcp-ccxt
Open-source MCP Server for Crypto Exchanges via CCXT.
Connect AI agents (Claude, Cursor, CrewAI, LangChain) to 100+ crypto exchanges through the Model Context Protocol.
Features
- 13 tools: market data, trading, account management
- 100+ exchanges: Binance, OKX, Bybit, Coinbase, Kraken, and more via CCXT
- 2 transports: stdio (local) and Streamable HTTP (remote/Docker)
- Async only: built on
ccxt.async_supportfor performance - Safe by default: sandbox mode on, rate limiting built-in, no credential leaks
Quickstart (< 5 minutes)
1. Install
pip install mcp-ccxt
2. Configure
Create config.json:
{
"accounts": [
{
"name": "binance-test",
"exchange_id": "binance",
"api_key": "YOUR_API_KEY",
"secret": "YOUR_SECRET",
"sandbox": true,
"default_type": "spot"
}
]
}
3. Test connectivity
mcp-ccxt test-sandbox --config config.json
# [OK] binance-test: connected (BTC/USDT = 50000.0)
4. Run server
stdio (Claude Desktop / Cursor):
mcp-ccxt run --config config.json
Streamable HTTP (remote / Docker):
mcp-ccxt run --config config.json --transport streamable-http --host 0.0.0.0 --port 8000
Claude Desktop setup
Add to Claude Desktop config (claude_desktop_config.json):
{
"mcpServers": {
"ccxt": {
"command": "mcp-ccxt",
"args": ["run", "--config", "/path/to/config.json"]
}
}
}
See also examples/claude_desktop_config.json.
Cursor setup
Add to Cursor MCP settings:
{
"mcpServers": {
"ccxt": {
"command": "mcp-ccxt",
"args": ["run", "--config", "/path/to/config.json"]
}
}
}
See also examples/cursor_config.json.
Docker (remote deployment)
docker compose -f docker-compose.example.yml up -d
The server listens on http://localhost:8000 (Streamable HTTP). Connect from CrewAI or any MCP client, for example:
http://localhost:8000/mcp
See examples/crewai_example.py for a CrewAI sample.
Tools reference
Market data (5 tools)
| Tool | Description |
|---|---|
fetch_ticker |
Current price, spread, volume for a symbol |
fetch_ohlcv |
OHLCV candles (1m to 1M timeframes) |
fetch_order_book |
Bids/asks with spread calculation |
fetch_markets |
All markets with limits + precision |
list_exchanges |
All supported exchange IDs |
Trading (4 tools)
| Tool | Description |
|---|---|
create_order |
Place market or limit order |
cancel_order |
Cancel an open order |
edit_order |
Modify existing order (exchange-dependent) |
fetch_open_orders |
List open orders |
Account (4 tools)
| Tool | Description |
|---|---|
fetch_balance |
Account balances (zero-balance filtered) |
fetch_my_trades |
Trade history for a symbol |
fetch_positions |
Open futures positions |
get_server_info |
Server version + connected exchanges |
Configuration
Exchange accounts (config.json)
{
"accounts": [
{
"name": "unique-account-name",
"exchange_id": "binance",
"api_key": "...",
"secret": "...",
"password": "...",
"sandbox": true,
"default_type": "spot"
}
]
}
| Field | Required | Description |
|---|---|---|
name |
yes | Unique identifier for this account |
exchange_id |
yes | CCXT exchange ID (e.g. binance, okx) |
api_key |
no | API key (required for trading) |
secret |
no | API secret |
password |
no | Passphrase (OKX requires this) |
sandbox |
no | Enable testnet mode (default: true) |
default_type |
no | Market type: spot, swap, future (default: spot) |
Transport options
| Flag | Default | Description |
|---|---|---|
--transport |
stdio |
stdio or streamable-http |
--host |
127.0.0.1 |
Bind address (use 0.0.0.0 for Docker) |
--port |
8000 |
HTTP port |
--log-level |
INFO |
Logging level |
Security
- Sandbox on by default — testnet mode reduces accidental real trades
- No credential leaks — API keys never appear in tool responses or error messages
- SecretStr credentials — keys masked in logs and repr()
- Rate limiting — CCXT built-in rate limiter (no custom implementation)
Requirements
- Python 3.11+
- CCXT 4.4+
- FastMCP 2.3+
License
MIT
Metadata
Release files for mcp-ccxt 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| mcp_ccxt-1.0.0.tar.gz | 195.4 kB | Without provenance | Details for mcp_ccxt-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| mcp_ccxt-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for mcp_ccxt-1.0.0-py3-none-any.whl |
Total release size: 218.5 kB
Release files / mcp_ccxt-1.0.0.tar.gz
| Download URL | mcp_ccxt-1.0.0.tar.gz |
|---|---|
| Size | 195.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
72ce7d4f0ec16ac0c379f54ce0d40a57e5874592fff04943250875ac1e8074ef
|
|
BLAKE2b-256 checksum How to use checksums |
06cd5496fe19d1096201462bc099fe078a28eb5cca329d9f358fc118d8823ecf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / mcp_ccxt-1.0.0-py3-none-any.whl
| Download URL | mcp_ccxt-1.0.0-py3-none-any.whl |
|---|---|
| Size | 23.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
43f729635d559002defffede09005c91dd7aded973162a8559bb0e851359ab6a
|
|
BLAKE2b-256 checksum How to use checksums |
b3c48be7b4eb14d6e6326bbff35e95871362975aa98849050a45eb615533c1d0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for mcp-ccxt 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.