CCXT MCP Server
CCXT MCP Server
CCXT MCP Server ist ein Server, der es KI-Modellen ermöglicht, über das Model Context Protocol (MCP) mit Kryptobörsen-APIs zu interagieren. Dieser Server nutzt die CCXT-Bibliothek, um Zugriff auf mehr als 100 Kryptobörsen und deren Handelsfunktionen zu bieten.
🚀 Schnelleinstieg
# Install the package globally
npm install -g @lazydino/ccxt-mcp
# Run with default settings
ccxt-mcp
# or run without installation
npx @lazydino/ccxt-mcpRelated MCP server: CCXT MCP Server
Installation und Verwendung
Globale Installation
# Install the package globally
npm install -g @lazydino/ccxt-mcpAusführung mit npx
Sie können es direkt ohne Installation ausführen:
# Using default settings
npx @lazydino/ccxt-mcp
# Using custom configuration file
npx @lazydino/ccxt-mcp --config /path/to/config.jsonHilfe anzeigen:
npx @lazydino/ccxt-mcp --helpKonfiguration
Registrierung des MCP-Servers in Claude Desktop
Claude Desktop-Einstellungen öffnen:
Gehen Sie zum Einstellungsmenü in der Claude Desktop-App
Suchen Sie den Abschnitt "MCP Servers"
Einen neuen MCP-Server hinzufügen:
Klicken Sie auf die Schaltfläche "Add Server"
Server-Name:
ccxt-mcpBefehl:
npx @lazydino/ccxt-mcpZusätzliche Argumente (optional):
--config /pfad/zu/config.json
Server speichern und testen:
Speichern Sie die Einstellungen
Testen Sie die Verbindung mit der Schaltfläche "Test Connection"
Konfigurationsmethoden - Zwei Optionen
Option 1: Kontoinformationen direkt in die Claude Desktop-Einstellungen einfügen (Grundlegende Methode)
Diese Methode fügt die CCXT-Kontoinformationen direkt in die Konfigurationsdatei von Claude Desktop (claude_desktop_config.json) ein:
{
"mcpServers": {
"ccxt-mcp": {
"command": "npx",
"args": ["-y", "@lazydino/ccxt-mcp"],
"mcpBearerToken": "YOUR_MCP_TOKEN",
"accounts": [
{
"name": "bybit_main",
"exchangeId": "bybit",
"apiKey": "YOUR_API_KEY",
"secret": "YOUR_SECRET_KEY",
"defaultType": "spot"
},
{
"name": "bybit_futures",
"exchangeId": "bybit",
"apiKey": "YOUR_API_KEY",
"secret": "YOUR_SECRET_KEY",
"defaultType": "swap"
}
]
}
}
}Bei dieser Methode benötigen Sie keine separate Konfigurationsdatei. Alle Einstellungen sind in die Konfigurationsdatei von Claude Desktop integriert.
Option 2: Verwendung einer separaten Konfigurationsdatei (Erweiterte Methode)
Um Kontoinformationen in eine separate Konfigurationsdatei auszulagern, gehen Sie wie folgt vor:
Erstellen Sie eine separate Konfigurationsdatei (z. B.
ccxt-config.json):
{
"mcpBearerToken": "YOUR_MCP_TOKEN",
"accounts": [
{
"name": "bybit_main",
"exchangeId": "bybit",
"apiKey": "YOUR_API_KEY",
"secret": "YOUR_SECRET_KEY",
"defaultType": "spot"
},
{
"name": "bybit_futures",
"exchangeId": "bybit",
"apiKey": "YOUR_API_KEY",
"secret": "YOUR_SECRET_KEY",
"defaultType": "swap"
}
]
}Wichtig: Die Konfigurationsdatei muss auf der Stammebene ein
accounts-Array enthalten, wie oben gezeigt.
Wichtig: Wenn Sie den Server im HTTP+SSE-Modus (
--sse) ausführen, legen SiemcpBearerTokenin derselben Konfigurationsdatei fest. Clients müssen bei AnfragenAuthorization: Bearer <mcpBearerToken>senden.
Geben Sie den Pfad zur Konfigurationsdatei in den Claude Desktop-Einstellungen an:
{
"mcpServers": {
"ccxt-mcp": {
"command": "npx",
"args": [
"-y",
"@lazydino/ccxt-mcp",
"--config",
"/path/to/ccxt-config.json"
]
}
}
}Hinweis: Wenn Sie eine separate Konfigurationsdatei mit der Option
--configverwenden, sucht der Server direkt im Stammverzeichnis der JSON-Datei nach demaccounts-Array, nicht im PfadmcpServers.ccxt-mcp.accounts.
Ausführung mit externer Konfigurationsdatei über die Befehlszeile:
# Using custom configuration file
npx @lazydino/ccxt-mcp --config /path/to/ccxt-config.jsonSie finden eine Beispiel-Konfigurationsdatei unter config/ccxt-config.example.json im Repository.
Gründe für die Verwendung einer separaten Konfigurationsdatei:
Verhindert Probleme mit rekursiven Referenzen
Trennt sensible Informationen wie API-Schlüssel
Einfachere Konfiguration für mehrere Umgebungen (Entwicklung, Test, Produktion)
Verbesserte Versionskontrolle der Konfigurationsdatei
Hauptfunktionen
Abruf von Marktinformationen:
Börsen auflisten
Marktinformationen nach Börse anzeigen
Preisinformationen für bestimmte Symbole abrufen
Orderbuchinformationen für bestimmte Symbole anzeigen
Historische OHLCV-Daten durchsuchen
Handelsfunktionen:
Market-/Limit-Orders erstellen
Orders stornieren und Status prüfen
Kontostände anzeigen
Handelshistorie prüfen
Handelsanalyse:
Analyse der täglichen/wöchentlichen/monatlichen Performance
Berechnung der Gewinnrate (letzte 7 Tage, 30 Tage, insgesamt)
Durchschnittliches Gewinn-/Verlustverhältnis (R-Multiple)
Analyse der maximalen aufeinanderfolgenden Verlust-/Gewinnserien
Nachverfolgung von Vermögensänderungen
Umfassende Leistungskennzahlen
Erkennung von Handelsmustern
Periodenbasierte Renditeberechnungen
Positionsmanagement:
Handel nach Kapitalverhältnis (z. B. Einstieg mit 5 % des Kontokapitals)
Einstellung des Hebels für den Terminmarkt (1-100x)
Dynamische Positionsgrößenbestimmung (volatilitätsbasiert)
Implementierung von Split-Kauf-/Verkaufsstrategien
Risikomanagement:
Stop-Loss-Einstellung basierend auf technischen Indikatoren (z. B. tiefster Punkt unter 10 Kerzen im 5-Minuten-Chart)
Volatilitätsbasierter Stop-Loss/Take-Profit (ATR-Multiplikatoren)
Maximal zulässiges Verlustlimit (täglich/wöchentlich)
Dynamische Take-Profit-Einstellung (Trailing Profit)
Funktionsweise
User <--> AI Model(Claude/GPT) <--> MCP Protocol <--> CCXT MCP Server <--> Cryptocurrency Exchange APIBenutzer: Anfragen wie "Sag mir den Bitcoin-Preis" oder "Kaufe Ethereum auf meinem Binance-Konto"
KI-Modell: Versteht Benutzeranfragen und bestimmt, welche MCP-Tools/-Ressourcen verwendet werden sollen
MCP-Protokoll: Standardisierte Kommunikation zwischen KI und CCXT MCP-Server
CCXT MCP-Server: Kommuniziert mit Kryptobörsen-APIs unter Verwendung der CCXT-Bibliothek
Börsen-API: Liefert tatsächliche Daten und führt Handelsaufträge aus
Verwendung mit KI-Modellen
Wenn Sie bei Claude Desktop registriert sind, können Sie folgende Arten von Anfragen an KI-Modelle stellen:
Vorsichtsmaßnahmen und empfohlene Prompts
Berücksichtigen Sie bei der Verwendung von KI-Modellen die folgenden Vorsichtsmaßnahmen und verwenden Sie den unten stehenden Prompt für effektiven Handel:
Your goal is to execute trades using the ccxt tools as much as possible
Cautions:
- Accurately identify whether it's a futures market or spot market before proceeding with trades
- If there's no instruction about percentage of capital or amount to use, always calculate and execute trades using the entire available capitalHinweise:
KI-Modelle verwechseln manchmal den Terminhandel mit dem Spot-Handel.
Ohne klare Anweisungen zur Größe des Handelskapitals könnte die KI verwirrt sein.
Die Verwendung des obigen Prompts hilft dabei, Ihre Handelsabsichten klar zu kommunizieren.
Grundlegende Abfragebeispiele
Check and compare the current Bitcoin price on binance and coinbase.Beispiele für fortgeschrittene Handelsabfragen
Positionsmanagement
Open a long position on BTC/USDT futures market in my Bybit account (bybit_futures) with 5% of capital using 10x leverage.
Enter based on moving average crossover strategy and set stop loss at the lowest point among the 12 most recent 5-minute candles.Performance-Analyse
Analyze my Binance account (bybit_main) trading records for the last 7 days and show me the win rate, average profit, and maximum consecutive losses.Detaillierte Handelsanalytik
Analyze my trading performance on the bybit_futures account for BTC/USDT over the last 30 days. Calculate win rate, profit factor, and identify any patterns in my winning trades.Show me the monthly returns for my bybit_main account over the past 90 days and identify my best and worst trading months.Analyze my consecutive wins and losses on my bybit_futures account and tell me if I have any psychological patterns affecting my trading after losses.Entwicklung
Erstellen aus dem Quellcode
# Clone repository
git clone https://github.com/lazy-dinosaur/ccxt-mcp.git
# Navigate to project directory
cd ccxt-mcp
# Install dependencies
npm install
# Build
npm run buildDocker
Erstellen und Ausführen mit Docker Compose
Erstellen Sie eine Konfigurationsdatei:
cp config/ccxt-config.example.json config/ccxt-config.jsonTragen Sie dann Ihre echten API-Schlüssel in config/ccxt-config.json ein.
Legen Sie außerdem mcpBearerToken in derselben Konfigurationsdatei fest.
2. Image erstellen:
docker compose buildStarten Sie den MCP-Server im Hintergrund (SSE-Modus auf localhost:2298):
docker compose up -dÜberprüfen Sie den lokalen Health-Endpunkt:
curl -H "Authorization: Bearer YOUR_MCP_TOKEN" http://127.0.0.1:2298/healthzDieses Compose-Setup führt MCP über HTTP+SSE (/sse + /messages) auf localhost:2298 für Reverse-Proxying aus.
Konfiguration des Remote-MCP-Clients
Wenn Ihr MCP-Client auf einem anderen Host läuft, verwenden Sie einen Nginx-Reverse-Proxy auf dieser Maschine.
Kopieren Sie
ccxt-mcp.nginxan Ihren Nginx-Konfigurationsort und aktualisieren Sie die Zertifikatspfade:
sudo cp ccxt-mcp.nginx /etc/nginx/conf.d/ccxt-mcp.confBearbeiten Sie
/etc/nginx/conf.d/ccxt-mcp.confund legen Sie Folgendes fest:
ssl_certificatessl_certificate_keyWeiterleitung des Authorization-Headers (in dieser Datei bereits enthalten)
Nginx neu laden:
sudo nginx -t && sudo systemctl reload nginxKonfigurieren Sie in Ihrem MCP-Client die MCP-Server-URL auf Ihren TLS-Endpunkt:
SSE-URL:
https://IHR_HOSTNAME_ODER_IP:42299/sseNachrichten-URL:
https://IHR_HOSTNAME_ODER_IP:42299/messagesHeader:
Authorization: Bearer IHR_MCP_TOKEN
Sie können ein starkes Token generieren mit:
openssl rand -hex 32Konfigurationsbeispiel:
{
"mcpBearerToken": "YOUR_MCP_TOKEN",
"accounts": [
{
"name": "bybit_main",
"exchangeId": "bybit",
"apiKey": "YOUR_API_KEY",
"secret": "YOUR_SECRET_KEY"
}
]
}Port-Hinweis:
42298ist HTTP (nur Weiterleitung)42299ist HTTPS2298stammt vonCCXTauf einer Telefontastatur
Wenn Ihr MCP-Client befehlsbasierte MCP-Server anstelle einer URL-Konfiguration akzeptiert, konfigurieren Sie ccxt-mcp mit:
Befehl:
dockerArgumente:
[
"run",
"--rm",
"-i",
"-p",
"127.0.0.1:2298:2298",
"-v",
"/absolute/path/to/ccxt-mcp/config/ccxt-config.json:/config/ccxt-config.json:ro",
"ccxt-mcp:local",
"--sse",
"--host",
"0.0.0.0",
"--port",
"2298",
"--config",
"/config/ccxt-config.json"
]Erstellen Sie das Image zuerst mit docker compose build.
🤝 Mitwirken
Beiträge sind willkommen! Bitte zögern Sie nicht, einen Pull Request einzureichen.
📄 Lizenz
Vertrieben unter der MIT-Lizenz. Weitere Informationen finden Sie in der Datei LICENSE.
❤️ Unterstützung
Wenn Sie dieses Projekt nützlich finden, ziehen Sie bitte in Betracht, ihm ein ⭐️ auf GitHub zu geben!
Available Tools
20 toolsanalyzeConsecutiveProfitLossC
Analyze consecutive winning and losing trades
Inputs: accountName (required), symbol, period.
analyzePeriodicReturnsB
Analyze daily and monthly returns for a configured account
Inputs: accountName (required), symbol, period, interval.
analyzeTradingPerformanceC
Analyze trading performance for a configured account
Inputs: accountName (required), symbol, period.
calculateWinRateC
Calculate win rate and profit metrics for a configured account
Inputs: accountName (required), symbol, period.
cancelOrderC
Cancel an existing order using a configured account
Inputs: accountName (required), id (required), symbol (required), params.
createOrderC
Create a new order using a configured account
Inputs: accountName (required), symbol (required), type (required), side (required), +3 more.
fetchBalanceC
Fetch account balance for a configured account
Inputs: accountName (required).
fetchClosedOrdersC
Fetch all closed orders using a configured account
Inputs: accountName (required), symbol, since, limit, +1 more.
fetchDepositsC
Fetch deposit history for a configured account
Inputs: accountName (required), code, since, limit.
fetchMarketsC
Fetch markets from a cryptocurrency exchange
Inputs: exchangeId (required).
fetchMyTradesC
Fetch personal trade history for a configured account
Inputs: accountName (required), symbol, since, limit.
fetchOHLCVC
Fetch OHLCV candlestick data for a symbol on an exchange
Inputs: exchangeId (required), symbol (required), timeframe, since, +1 more.
fetchOpenOrdersC
Fetch all open orders using a configured account
Inputs: accountName (required), symbol, since, limit, +1 more.
fetchOrderC
Fetch information about a specific order using a configured account
Inputs: accountName (required), id (required), symbol (required), params.
fetchOrderBookC
Fetch order book for a symbol on an exchange
Inputs: exchangeId (required), symbol (required), limit.
fetchTickerC
Fetch ticker information for a symbol on an exchange
Inputs: exchangeId (required), symbol (required).
fetchTickersC
Fetch all tickers from an exchange
Inputs: exchangeId (required), symbols.
fetchTradesC
Fetch recent trades for a symbol on an exchange
Inputs: exchangeId (required), symbol (required), since, limit.
fetchWithdrawalsC
Fetch withdrawal history for a configured account
Inputs: accountName (required), code, since, limit.
listAccountsB
List all configured account names
Inputs: no named parameters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 20 tools
Most tools have distinct purposes, but there is some overlap between analyzeConsecutiveProfitLoss, analyzePeriodicReturns, analyzeTradingPerformance, and calculateWinRate, which all focus on performance analysis and could cause confusion. The remaining tools are clearly differentiated by their specific actions and targets.
The naming is mostly consistent with a verb_noun pattern, using camelCase throughout. However, there are minor deviations: 'listAccounts' uses 'list' while others use 'fetch' or 'analyze', and 'calculateWinRate' uses 'calculate' instead of 'analyze' for similar analysis tasks, slightly breaking the pattern.
With 20 tools, the count is on the higher side but reasonable for a cryptocurrency trading server that needs to cover account management, order handling, market data, and performance analysis. It feels slightly heavy but not excessive for the domain's complexity.
The tool set provides comprehensive coverage for cryptocurrency trading: it includes account listing and balance fetching, full order lifecycle (create, fetch, cancel, open/closed orders), market data (markets, tickers, trades, OHLCV, order book), deposit/withdrawal history, and performance analysis. No obvious gaps are present for core trading workflows.
Maintenance
Related MCP Connectors
Trading MCP server for AI agents, with live market data, account reads and controlled execution.
Trade 16 crypto exchanges + MetaTrader 5 from your AI assistant via one MCP connection.
MCP server for Mudrex futures trading enabling AI agents to securely access data and risk tools.
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA server that provides real-time cryptocurrency data through the Model Context Protocol, allowing access to detailed exchange information and current cryptocurrency rates from the CoinCap API.6 npm1MIT
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that enables LLMs to interact with cryptocurrency exchanges through CCXT, allowing for tasks like fetching balances, market data, creating orders, and trading operations in a standardized way.8MIT
- AlicenseNot gradedqualityDmaintenanceA server that implements the Model Context Protocol, providing a standardized way to connect AI models to different data sources and tools.12MIT
- FlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that provides a standardized interface for AI models and applications to interact with the Luno cryptocurrency exchange API for trading operations.2-