Skip to content
Back to search

mcp-server-ccxt

High-performance CCXT MCP server for cryptocurrency exchange integration

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/doggybee--mcp-server-ccxt/badge.svg)](/listings/doggybee--mcp-server-ccxt)

HTML

<a href="/listings/doggybee--mcp-server-ccxt"><img src="/api/listings/doggybee--mcp-server-ccxt/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

Installing via Smithery

To install mcp-server-ccxt for Claude Desktop automatically via [Smithery](https://smithery.ai/server/@doggybee/mcp-server-ccxt):

npx -y @smithery/cli install @doggybee/mcp-server-ccxt --client claude

NPM Package (Recommended)

You can install CCXT MCP Server from npm:

# Install globally
npm install -g @mcpfun/mcp-server-ccxt

# Start the server
mcp-server-ccxt

Or run directly:

npx @mcpfun/mcp-server-ccxt

Manual Installation

Alternatively, you can clone and build the repository:

# Clone the repository
git clone https://github.com/doggybee/mcp-server-ccxt.git
cd mcp-server-ccxt

# Install dependencies
npm install

# Build the server
npm run build

# Start the server
npm start

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 315 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. # CCXT MCP Server
  2. <img src="assets/ccxt-logo.png" alt="CCXT Logo" width="100" height="100"/>
  3. ![Version](https://img.shields.io/badge/version-1.2.1-blue.svg)
  4. [![MCP Standard](https://img.shields.io/badge/MCP-Standard-green.svg)](https://www.modelcontextprotocol.org/)
  5. [![CCXT](https://img.shields.io/badge/CCXT-4.0.0-orange.svg)](https://github.com/ccxt/ccxt)
  6. [![smithery badge](https://smithery.ai/badge/@doggybee/mcp-server-ccxt)](https://smithery.ai/server/@doggybee/mcp-server-ccxt)
  7. High-performance cryptocurrency exchange integration using MCP (Model Context Protocol) and CCXT.
  8. ## Features
  9. - 🚀 **Exchange Support**: Connects to 20+ cryptocurrency exchanges
  10. - 🔃 **Market Types**: Supports spot, futures, swap markets and more
  11. - 🔧 **Proxy Configuration**: Options for accessing exchanges through proxies
  12. - 📊 **Fast & Reliable**: Optimized caching and rate limiting
  13. - 🌐 **MCP Standard**: Compatible with LLMs like Claude and GPT via MCP
  14. ## CCXT MCP Server Integration Architecture
  15. ![CCXT MCP Server Integration Architecture](docs/images/mcp-integration.svg)
  16. The CCXT MCP Server connects language models to cryptocurrency exchanges through the Model Context Protocol. It serves as a bridge that allows LLMs to access real-time market data and execute trading operations across multiple exchanges through a unified API.
  17. The architecture includes:
  18. - LLM clients (Claude and other MCP-compatible models) that send requests
  19. - The Model Context Protocol (MCP) that standardizes communication
  20. - The CCXT MCP Server that processes requests and manages exchange interactions
  21. - The CCXT Library that provides unified access to exchange APIs
  22. - Connections to multiple cryptocurrency exchanges
  23. ## CCXT MCP Server Code Architecture
  24. ![CCXT MCP Server Code Architecture](docs/images/code-architecture.svg)
  25. The server is organized into three main modules for better maintainability and extensibility:
  26. - **Exchange**: Manages exchange instances, credentials, and symbol validation
  27. - **Utils**: Provides caching, rate limiting, and logging functionality
  28. - **Tools**: Implements MCP tools and resources for exchange interaction
  29. ## Quick Start
  30. ### Installing via Smithery
  31. To install mcp-server-ccxt for Claude Desktop automatically via [Smithery](https://smithery.ai/server/@doggybee/mcp-server-ccxt):
  32. ```bash
  33. npx -y @smithery/cli install @doggybee/mcp-server-ccxt --client claude
  34. ```
  35. ### NPM Package (Recommended)
  36. You can install CCXT MCP Server from npm:
  37. ```bash
  38. # Install globally
  39. npm install -g @mcpfun/mcp-server-ccxt
  40. # Start the server
  41. mcp-server-ccxt
  42. ```
  43. Or run directly:
  44. ```bash
  45. npx @mcpfun/mcp-server-ccxt
  46. ```
  47. ### Manual Installation
  48. Alternatively, you can clone and build the repository:
  49. ```bash
  50. # Clone the repository
  51. git clone https://github.com/doggybee/mcp-server-ccxt.git
  52. cd mcp-server-ccxt
  53. # Install dependencies
  54. npm install
  55. # Build the server
  56. npm run build
  57. # Start the server
  58. npm start
  59. ```
  60. ## Configuration
  61. 1. Create an environment file
  62. ```bash
  63. cp .env.example .env
  64. ```
  65. 2. Edit the `.env` file to add your exchange API keys
  66. ```
  67. # Default exchange (optional)
  68. DEFAULT_EXCHANGE=binance
  69. # Default market type (optional)
  70. DEFAULT_MARKET_TYPE=spot
  71. # API credentials (optional)
  72. BINANCE_API_KEY=your_api_key
  73. BINANCE_SECRET=your_api_secret
  74. # For exchanges requiring passphrase (e.g., KuCoin)
  75. KUCOIN_API_KEY=your_kucoin_api_key
  76. KUCOIN_SECRET=your_kucoin_secret
  77. KUCOIN_PASSPHRASE=your_kucoin_passphrase
  78. # Proxy configuration (optional)
  79. USE_PROXY=false
  80. PROXY_URL=http://username:password@your-proxy-server:port
  81. # Legacy format (still supported but recommended to use the integrated URL format above)
  82. # PROXY_USERNAME=
  83. # PROXY_PASSWORD=
  84. ```
  85. ## Usage
  86. > **Note**: If you encounter any issues with MCP communication, please see the [Troubleshooting Guide](docs/troubleshooting.md) for solutions.
  87. ### Running the Server
  88. Start the server:
  89. ```bash
  90. # If installed globally via npm
  91. mcp-server-ccxt
  92. # If installed manually
  93. npm start
  94. ```
  95. ### Using with Claude for Desktop
  96. 1. Add the server to your `claude_desktop_config.json`:
  97. If installed via npm (globally):
  98. ```json
  99. {
  100. "mcpServers": {
  101. "ccxt": {
  102. "command": "mcp-server-ccxt"
  103. }
  104. }
  105. }
  106. ```
  107. If installed manually:
  108. ```json
  109. {
  110. "mcpServers": {
  111. "ccxt": {
  112. "command": "node",
  113. "args": [
  114. "/path/to/mcp-server-ccxt/build/index.js"
  115. ]
  116. }
  117. }
  118. }
  119. ```
  120. 2. Restart Claude for Desktop
  121. ### Using as a Module in Another Project
  122. You can also use this package as a module in your own Node.js projects:
  123. ```javascript
  124. // Import the CCXT MCP Server
  125. import '@mcpfun/mcp-server-ccxt';
  126. // The server starts automatically when imported
  127. // You can configure it through environment variables
  128. ```
  129. ## Example Queries
  130. Here are some example queries you can use with the MCP server:
  131. - "What's the current price of Bitcoin on Binance?"
  132. - "Show me the order book for ETH/USDT on Coinbase"
  133. - "Get the 1-hour OHLCV data for BTC/USDT on Binance for the last 24 candles"
  134. - "Compare the price of SOL/USDT across different exchanges"
  135. - "What's my current balance on Binance?" (requires API keys)
  136. - "Place a market buy order for 0.1 ETH on Kraken" (requires API keys)
  137. ## Available Tools
  138. ### Public API Tools
  139. - `list-exchanges`: List all available cryptocurrency exchanges
  140. - `get-ticker`: Get current ticker information for a trading pair
  141. - `batch-get-tickers`: Get ticker information for multiple trading pairs at once
  142. - `get-orderbook` / `get-order-book`: Get market order book for a trading pair
  143. - `get-ohlcv`: Get OHLCV candlestick data for a trading pair
  144. - `get-trades`: Get recent trades for a trading pair
  145. - `get-markets`: Get all available markets for an exchange
  146. - `get-exchange-info`: Get exchange information and status
  147. - `get-leverage-tiers`: Get futures leverage tiers
  148. - `get-funding-rates`: Get current funding rates
  149. - `get-positions`: Get open positions information
  150. - `get-open-orders`: Get all open orders
  151. - `get-order-history`: Get order history
  152. ### Private API Tools (requires API keys)
  153. - `account-balance`: Get your account balance from a crypto exchange
  154. - `place-market-order`: Place a market order on an exchange
  155. - `place-limit-order`: Place a limit order on an exchange
  156. - `cancel-order`: Cancel an existing order
  157. - `cancel-all-orders`: Cancel all open orders
  158. - `set-leverage`: Set leverage for futures
  159. - `set-margin-mode`: Set margin mode for futures
  160. - `place-futures-market-order`: Place futures market orders
  161. - `place-futures-limit-order`: Place futures limit orders
  162. - `transfer-funds`: Transfer funds between accounts (e.g., spot to futures)
  163. ### Configuration & Utility Tools
  164. - `cache-stats`: Get CCXT cache statistics
  165. - `clear-cache`: Clear CCXT cache
  166. - `set-log-level`: Set logging level
  167. - `get-proxy-config`: Get proxy settings
  168. - `set-proxy-config`: Configure proxy settings
  169. - `set-market-type`: Set default market type
  170. - `set-default-exchange`: Change the default exchange
  171. - `system-info`: Get system and environment information
  172. ## Performance Optimizations
  173. MCP-CCXT includes several optimizations to ensure high performance:
  174. 1. **LRU Caching System**:
  175. - Different TTLs for different types of data
  176. - Ticker data: 10 seconds
  177. - Order book data: 5 seconds
  178. - Market data: 1 hour
  179. 2. **Adaptive Rate Limiting**:
  180. - Automatically adjusts request rates based on exchange responses
  181. - Implements exponential backoff for errors
  182. - Manages concurrent requests per exchange
  183. 3. **Exchange Connection Management**:
  184. - Efficient initialization of exchange instances
  185. - Proper error handling and retries
  186. ## Security Best Practices
  187. ### API Key Security
  188. 1. **Create Dedicated API Keys**:
  189. - Create separate API keys for different applications/purposes
  190. - Never reuse API keys across different services or applications
  191. 2. **Limit API Key Permissions**:
  192. - Enable only the permissions you need (e.g., read-only for market data)
  193. - Disable withdrawal permissions if you only need trading functionality
  194. - Use IP whitelisting when available to restrict access to known IPs
  195. 3. **Secure Storage**:
  196. - Never commit API keys to version control systems
  197. - Store API keys in environment variables or a secure vault
  198. - Use `.env` files that are excluded from git via `.gitignore`
  199. ## Risk Disclaimer
  200. This software is provided for informational purposes only. Using this software to interact with cryptocurrency exchanges involves significant risks:
  201. - **Financial Risk**: Cryptocurrency trading involves risk of loss
  202. - **API Security**: Ensure your API keys have appropriate permission limits
  203. - **No Investment Advice**: This tool does not provide investment advice
  204. - **No Warranty**: The software is provided "as is" without warranty of any kind
  205. ## License
  206. This project is licensed under the MIT License - see the [LICENSE.txt](LICENSE.txt) file for details.
  207. ## Copyright and Attribution
  208. This project uses the CCXT library (https://github.com/ccxt/ccxt), which is:
  209. ```
  210. Copyright (c) 2016-2024 CCXT developers
  211. ```
  212. CCXT is released under the MIT License, which is included below:
  213. ```
  214. Permission is hereby granted, free of charge, to any person obtaining a copy
  215. of this software and associated documentation files (the "Software"), to deal
  216. in the Software without restriction, including without limitation the rights
  217. to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  218. copies of the Software, and to permit persons to whom the Software is
  219. furnished to do so, subject to the following conditions:
  220. The above copyright notice and this permission notice shall be included in all
  221. copies or substantial portions of the Software.
  222. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  223. IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  224. FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  225. AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  226. LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  227. OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  228. SOFTWARE.
  229. ```
  230. ---
  231. For issues, feature requests, or contributions, please visit [the GitHub repository](https://github.com/doggybee/mcp-server-ccxt).

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.