CCXT-MCP添加福利群:解决AI开发者的「MCP实战痛点」CCXT MCP服务器是一家服务器,允许AI模型通过Model Context Protocol (MCP)。该服务器使用CCXT library提供100多个加密货币交易所及其交易功能的访问权限。
# Install the package globally
npm install -g @lazydino/ccxt-mcp
# Run with default settings
ccxt-mcp
# or run without installation
npx @lazydino/ccxt-mcp

# Install the package globally
npm install -g @lazydino/ccxt-mcp

您可以直接运行它而无需安装:
# Using default settings
npx @lazydino/ccxt-mcp
# Using custom configuration file
npx @lazydino/ccxt-mcp --config /path/to/config.json

查看帮助:
npx @lazydino/ccxt-mcp --help

打开Claude Desktop设置:
添加新的MCP服务器:
ccxt-mcpnpx @lazydino/ccxt-mcp--config /path/to/config.json保存和测试服务器:
此方法直接在Claude Desktop设置文件(Claude_desktop_config.json)中包含CCXT帐户信息:
{
"mcpServers": {
"ccxt-mcp": {
"command": "npx",
"args": ["-y", "@lazydino/ccxt-mcp"],
"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"
}
]
}
}
}

使用此方法,您不需要单独的配置文件。所有设置都集成到Claude桌面配置文件中。
要将帐户信息分为单独的配置文件,请设置如下:
ccxt-accounts.json):{
"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"
}
]
}

重要:配置文件必须包含一个
accounts如上图所示,在根级别的数组。
{
"mcpServers": {
"ccxt-mcp": {
"command": "npx",
"args": [
"-y",
"@lazydino/ccxt-mcp",
"--config",
"/path/to/ccxt-accounts.json"
]
}
}
}

注意:使用单独的配置文件与
--config选项,服务器将寻找accounts数组直接在JSON文件的根中,而不是mcpServers.ccxt-mcp.accounts小路。
# Using custom configuration file
npx @lazydino/ccxt-mcp --config /path/to/ccxt-accounts.json

您可以在examples/config-example.json在存储库中。
使用单独配置文件的原因**:
- 防止递归参考问题
- 分开敏感信息,例如API键
- 更轻松的多环境配置(开发,测试,生产)
- 改进的配置文件版本控制
市场信息检索:
交易功能:
交易分析:
职位管理:
风险管理:
User <--> AI Model(Claude/GPT) <--> MCP Protocol <--> CCXT MCP Server <--> Cryptocurrency Exchange API
在Claude Desktop注册时,您可以向AI模型进行以下请求类型:
使用AI模型时,请考虑以下注意事项并使用以下提示进行有效交易:
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 capital
笔记:
Check and compare the current Bitcoin price on binance and coinbase.
职位管理
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.
绩效分析
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.
详细的交易分析
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.
# 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 build

欢迎捐款!请随时提交拉动请求。
根据MIT许可分发。有关更多信息,请参见许可证文件。
如果您觉得这个项目有用,请考虑在Github上给它一个⭐️!