{"_id":"@iflow-mcp/ccxt-mcp","name":"@iflow-mcp/ccxt-mcp","dist-tags":{"latest":"0.4.1"},"versions":{"0.4.1":{"name":"@iflow-mcp/ccxt-mcp","version":"0.4.1","description":"CCXT integration for Model Context Protocol","type":"module","main":"dist/index.js","bin":{"ccxt-mcp":"bin/ccxt-mcp.js"},"scripts":{"build":"tsc","start":"node dist/index.js","dev":"tsx src/index.ts","test":"echo \"No tests specified\" && exit 0"},"keywords":["ccxt","mcp","modelcontextprotocol","cryptocurrency","trading","exchange","api"],"author":{"name":"LazyDino"},"license":"MIT","dependencies":{"@modelcontextprotocol/sdk":"^1.8.0","ccxt":"^4.4.0","zod":"^3.23.8","zod-to-json-schema":"^3.24.1"},"devDependencies":{"@types/node":"^20.17.28","tsx":"^4.7.0","typescript":"^5.5.0"},"engines":{"node":">=18.0.0"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/lazy-dinosaur/ccxt-mcp.git"},"bugs":{"url":"https://github.com/lazy-dinosaur/ccxt-mcp/issues"},"homepage":"https://github.com/lazy-dinosaur/ccxt-mcp#readme","_id":"@iflow-mcp/ccxt-mcp@0.4.1","gitHead":"dc518b41954ada0e0c9cf285607609aa853c318a","types":"./dist/index.d.ts","_nodeVersion":"24.1.0","_npmVersion":"11.3.0","dist":{"integrity":"sha512-3TH5iWOcYwOlM+HAMtkP0In54B2c/CZuh+sg0CKlaD63rwUWQ90aTw4U1LbgRT4Sjq0JTmCLdp/S/7pgWXAlFA==","shasum":"9ce8238bb2e01c97235e992528c032edb56f47b8","tarball":"https://registry.npmjs.org/@iflow-mcp/ccxt-mcp/-/ccxt-mcp-0.4.1.tgz","fileCount":35,"unpackedSize":169046,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCICeiLg+ZH6G9dDrQnxffkcRSfQ+G47CkQjOxbVEtRUzKAiEAp1jm1SFJJLSuIFzEWBAXd06pq+dDUorhZ+30IEAjzB8="}]},"_npmUser":{"name":"chatflowdev","email":"chatflowdev@gmail.com"},"directories":{},"maintainers":[{"name":"chatflowdev","email":"chatflowdev@gmail.com"},{"name":"qystart","email":"987472953@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/ccxt-mcp_0.4.1_1761881225169_0.9021409849993098"},"_hasShrinkwrap":false}},"time":{"created":"2025-10-31T03:27:05.104Z","0.4.1":"2025-10-31T03:27:05.384Z","modified":"2025-10-31T03:27:05.645Z"},"maintainers":[{"name":"chatflowdev","email":"chatflowdev@gmail.com"},{"name":"qystart","email":"987472953@qq.com"}],"description":"CCXT integration for Model Context Protocol","homepage":"https://github.com/lazy-dinosaur/ccxt-mcp#readme","keywords":["ccxt","mcp","modelcontextprotocol","cryptocurrency","trading","exchange","api"],"repository":{"type":"git","url":"git+https://github.com/lazy-dinosaur/ccxt-mcp.git"},"author":{"name":"LazyDino"},"bugs":{"url":"https://github.com/lazy-dinosaur/ccxt-mcp/issues"},"license":"MIT","readme":"# CCXT MCP Server\n\n[![npm version](https://img.shields.io/npm/v/@lazydino/ccxt-mcp.svg)](https://www.npmjs.com/package/@lazydino/ccxt-mcp)\n[![npm downloads](https://img.shields.io/npm/dm/@lazydino/ccxt-mcp.svg)](https://www.npmjs.com/package/@lazydino/ccxt-mcp)\n[![GitHub stars](https://img.shields.io/github/stars/lazy-dinosaur/ccxt-mcp.svg)](https://github.com/lazy-dinosaur/ccxt-mcp/stargazers)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\n[한국어 버전(Korean version)](README.ko.md)\n\nCCXT MCP Server is a server that allows AI models to interact with cryptocurrency exchange APIs through the [Model Context Protocol (MCP)](https://github.com/anthropics/anthropic-cookbook/tree/main/model-context-protocol). This server uses the [CCXT library](https://github.com/ccxt/ccxt) to provide access to more than 100 cryptocurrency exchanges and their trading capabilities.\n\n## 🚀 Quick Start\n\n```bash\n# Install the package globally\nnpm install -g @lazydino/ccxt-mcp\n\n# Run with default settings\nccxt-mcp\n\n# or run without installation\nnpx @lazydino/ccxt-mcp\n```\n\n## Installation and Usage\n\n### Global Installation\n\n```bash\n# Install the package globally\nnpm install -g @lazydino/ccxt-mcp\n```\n\n### Running with npx\n\nYou can run it directly without installation:\n\n```bash\n# Using default settings\nnpx @lazydino/ccxt-mcp\n\n# Using custom configuration file\nnpx @lazydino/ccxt-mcp --config /path/to/config.json\n```\n\nView help:\n\n```bash\nnpx @lazydino/ccxt-mcp --help\n```\n\n## Configuration\n\n### Registering the MCP Server in Claude Desktop\n\n1. **Open Claude Desktop Settings**:\n\n   - Go to the Settings menu in the Claude Desktop app\n   - Find the \"MCP Servers\" section\n\n2. **Add a New MCP Server**:\n\n   - Click the \"Add Server\" button\n   - Server name: `ccxt-mcp`\n   - Command: `npx @lazydino/ccxt-mcp`\n   - Additional arguments (optional): `--config /path/to/config.json`\n\n3. **Save and Test the Server**:\n   - Save the settings\n   - Test the connection with the \"Test Connection\" button\n\n### Configuration Methods - Two Options\n\n#### Option 1: Include Account Information Directly in Claude Desktop Settings (Basic Method)\n\nThis method includes CCXT account information directly in the Claude Desktop settings file (claude_desktop_config.json):\n\n```json\n{\n  \"mcpServers\": {\n    \"ccxt-mcp\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@lazydino/ccxt-mcp\"],\n      \"accounts\": [\n        {\n          \"name\": \"bybit_main\",\n          \"exchangeId\": \"bybit\",\n          \"apiKey\": \"YOUR_API_KEY\",\n          \"secret\": \"YOUR_SECRET_KEY\",\n          \"defaultType\": \"spot\"\n        },\n        {\n          \"name\": \"bybit_futures\",\n          \"exchangeId\": \"bybit\",\n          \"apiKey\": \"YOUR_API_KEY\",\n          \"secret\": \"YOUR_SECRET_KEY\",\n          \"defaultType\": \"swap\"\n        }\n      ]\n    }\n  }\n}\n```\n\nUsing this method, you don't need a separate configuration file. All settings are integrated into the Claude Desktop configuration file.\n\n#### Option 2: Using a Separate Configuration File (Advanced Method)\n\nTo separate account information into a separate configuration file, set up as follows:\n\n1. **Create a Separate Configuration File** (e.g., `ccxt-accounts.json`):\n\n```json\n{\n  \"accounts\": [\n    {\n      \"name\": \"bybit_main\",\n      \"exchangeId\": \"bybit\",\n      \"apiKey\": \"YOUR_API_KEY\",\n      \"secret\": \"YOUR_SECRET_KEY\",\n      \"defaultType\": \"spot\"\n    },\n    {\n      \"name\": \"bybit_futures\",\n      \"exchangeId\": \"bybit\",\n      \"apiKey\": \"YOUR_API_KEY\",\n      \"secret\": \"YOUR_SECRET_KEY\",\n      \"defaultType\": \"swap\"\n    }\n  ]\n}\n```\n\n> **Important**: The configuration file must contain an `accounts` array at the root level, as shown above.\n\n2. **Specify the Configuration File Path in Claude Desktop Settings**:\n\n```json\n{\n  \"mcpServers\": {\n    \"ccxt-mcp\": {\n      \"command\": \"npx\",\n      \"args\": [\n        \"-y\",\n        \"@lazydino/ccxt-mcp\",\n        \"--config\",\n        \"/path/to/ccxt-accounts.json\"\n      ]\n    }\n  }\n}\n```\n\n> **Note**: When using a separate configuration file with the `--config` option, the server will look for the `accounts` array directly in the root of the JSON file, not in `mcpServers.ccxt-mcp.accounts` path.\n\n3. **Running with External Configuration File from Command Line**:\n\n```bash\n# Using custom configuration file\nnpx @lazydino/ccxt-mcp --config /path/to/ccxt-accounts.json\n```\n\nYou can find an example configuration file at `examples/config-example.json` in the repository.\n\n> **Reasons to Use a Separate Configuration File**:\n>\n> - Prevents recursive reference issues\n> - Separates sensitive information like API keys\n> - Easier multi-environment configuration (development, testing, production)\n> - Improved configuration file version control\n\n## Key Features\n\n- **Market Information Retrieval**:\n\n  - List exchanges\n  - View market information by exchange\n  - Get price information for specific symbols\n  - View order book information for specific symbols\n  - Search historical OHLCV data\n\n- **Trading Functions**:\n\n  - Create market/limit orders\n  - Cancel orders and check status\n  - View account balances\n  - Check trading history\n\n- **Trading Analysis**:\n\n  - Daily/weekly/monthly performance analysis\n  - Win rate calculation (last 7 days, 30 days, all time)\n  - Average profit/loss ratio (R-multiple)\n  - Maximum consecutive loss/profit series analysis\n  - Asset variation tracking\n  - Comprehensive performance metrics\n  - Trade pattern recognition\n  - Period-based return calculations\n\n- **Position Management**:\n\n  - Capital ratio trading (e.g., enter with 5% of account capital)\n  - Futures market leverage setting (1-100x)\n  - Dynamic position sizing (volatility-based)\n  - Split buy/sell strategy implementation\n\n- **Risk Management**:\n  - Technical indicator-based stop loss setting (e.g., lowest point among 10 candles on 5-minute chart)\n  - Volatility-based stop loss/take profit (ATR multiples)\n  - Maximum allowable loss limit (daily/weekly)\n  - Dynamic take profit setting (trailing profit)\n\n## How It Works\n\n```\nUser <--> AI Model(Claude/GPT) <--> MCP Protocol <--> CCXT MCP Server <--> Cryptocurrency Exchange API\n```\n\n1. **User**: Requests like \"Tell me the Bitcoin price\" or \"Buy Ethereum on my Binance account\"\n2. **AI Model**: Understands user requests and determines which MCP tools/resources to use\n3. **MCP Protocol**: Standardized communication between AI and CCXT MCP server\n4. **CCXT MCP Server**: Communicates with cryptocurrency exchange APIs using the CCXT library\n5. **Exchange API**: Provides actual data and executes trade orders\n\n## Using with AI Models\n\nWhen registered with Claude Desktop, you can make the following types of requests to AI models:\n\n### Cautions and Recommended Prompts\n\nWhen using AI models, consider the following cautions and use the prompt below for effective trading:\n\n```\nYour goal is to execute trades using the ccxt tools as much as possible\nCautions:\n- Accurately identify whether it's a futures market or spot market before proceeding with trades\n- If there's no instruction about percentage of capital or amount to use, always calculate and execute trades using the entire available capital\n```\n\n**Notes:**\n\n- AI models sometimes confuse futures trading with spot trading.\n- Without clear guidance on trading capital size, AI might get confused.\n- Using the above prompt helps clearly communicate your trading intentions.\n\n### Basic Query Examples\n\n```\nCheck and compare the current Bitcoin price on binance and coinbase.\n```\n\n### Advanced Trading Query Examples\n\n**Position Management**\n\n```\nOpen a long position on BTC/USDT futures market in my Bybit account (bybit_futures) with 5% of capital using 10x leverage.\nEnter based on moving average crossover strategy and set stop loss at the lowest point among the 12 most recent 5-minute candles.\n```\n\n**Performance Analysis**\n\n```\nAnalyze my Binance account (bybit_main) trading records for the last 7 days and show me the win rate, average profit, and maximum consecutive losses.\n```\n\n**Detailed Trading Analytics**\n\n```\nAnalyze 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.\n```\n\n```\nShow me the monthly returns for my bybit_main account over the past 90 days and identify my best and worst trading months.\n```\n\n```\nAnalyze my consecutive wins and losses on my bybit_futures account and tell me if I have any psychological patterns affecting my trading after losses.\n```\n\n## Development\n\n### Building from Source\n\n```bash\n# Clone repository\ngit clone https://github.com/lazy-dinosaur/ccxt-mcp.git\n\n# Navigate to project directory\ncd ccxt-mcp\n\n# Install dependencies\nnpm install\n\n# Build\nnpm run build\n```\n\n## 🤝 Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n## 📄 License\n\nDistributed under the MIT License. See the LICENSE file for more information.\n\n## ❤️ Support\n\nIf you find this project useful, please consider giving it a ⭐️ on GitHub!\n","readmeFilename":"README.md","_rev":"1-23cda018da8438d7b65337c9cf03dc71"}