Coinex MCP Server: Market Data & Trading API
Access CoinEx's official MCP server to retrieve market data, K-line charts, order book depth, account balances and place trades via the trading API.
npx -y @coinexcom/coinex_mcp_serverOverview
Coinex MCP Server implements a Model Context Protocol (MCP) gateway for CoinEx, exposing market data and trading functionality so AI agents and MCP-enabled clients can interact with the CoinEx exchange. It can run as a hosted HTTP MCP endpoint (public market data only) or locally (supporting authenticated account operations such as balance queries and order placement).
For developers building trading agents, analytics tools, or integration prototypes, the server provides a unified surface for spot and futures data (K-lines, order book depth, funding/premium history) plus authenticated endpoints for account balances, order management and futures-specific metadata (margin tiers, liquidation history, etc.).
Features
- Public market data: unified queries for spot and futures symbols
- K-line (candlestick) history retrieval for multiple intervals
- Order book depth (market depth) queries
- Authenticated account endpoints: account balances, open orders, order history
- Trading APIs: create, cancel, query orders (spot & futures)
- Futures-specific endpoints: funding rates, premium/basis history, margin tiers, liquidation records
- Runs over stdio (MCP native), HTTP transport, or as a Python module (for local deployment)
- Lightweight and suitable for integration with MCP-aware agents (Claude, CherryStudio, custom clients)
Installation / Configuration
Choose the deployment that fits your needs: hosted (public data), local package (authenticated trading), or from-source (development).
Table: installation options at a glance
| Method | Authentication | Recommended for |
|---|---|---|
| Hosted HTTP | No | Quick market data access, demos |
| Local (uvx/pip) | Yes | Trading bots, authenticated workflows |
| From source | Yes | Development, customization |
- Hosted HTTP (public market data)
No local install. Endpoint: https://mcp.coinex.com/mcp
Add to an MCP-aware client (example: Claude):
- Local installation via uvx or pip (supports authenticated operations)
- Install via pip:
# or using uv:
- Run as a module with credentials set as environment variables:
# For HTTP transport locally:
- Example Claude Desktop config (python module):
- From source (development)
# edit .env and set:
# COINEX_ACCESS_ID=...
# COINEX_SECRET_KEY=...
Security: only supply API credentials for local deployments; hosted endpoint is public-only. Keep keys out of version control and restrict API permissions.
Available Resources
- GitHub repository (source & issues): https://github.com/coinexcom/coinex_mcp_server
- Hosted MCP endpoint (public market data): https://mcp.coinex.com/mcp
- Environment variables for authenticated runs:
- COINEX_ACCESS_ID
- COINEX_SECRET_KEY
- Transport modes:
- stdio (default MCP mode)
- http (serve MCP over HTTP)
- subprocess (uvx/python module integration)
Typical MCP capabilities exposed by the server:
- market.get_ticker, market.get_kline, market.get_depth
- account.get_balances, account.get_orders, account.place_order, account.cancel_order
- futures.funding_rates, futures.premium_history, futures.margin_tiers, futures.liquidations
(Refer to the repository for the full list of RPC/Tool names and request/response schemas.)
Use Cases
- Agent-driven market research: Attach an MCP-enabled LLM agent to the hosted endpoint to fetch tickers, K-lines and depth snapshots for strategy exploration without exposing any account credentials.
- Automated trading bot: Run the server locally with your API keys set in environment variables. Use the trading endpoints to place market/limit orders and monitor fills programmatically.
- Backtest data pipeline: Pull historical K-line data (multiple intervals) to build backtesting datasets or feed a model for signal generation.
- Risk monitoring for futures: Query funding rates, margin tiers and liquidation history to implement automated alerts and position-sizing controls in a risk-management agent.
Concrete example — fetch 1m K-line for BTC/USDT (hosted):
- Point your MCP client at https://mcp.coinex.com/mcp
- Call the K-line tool/endpoint (tool names or RPC calls available in repo docs) This yields timestamped candlesticks suitable for charting or feature generation.
Concrete example — place a limit order (local, authenticated):
- Start server locally with COINEX_ACCESS_ID and COINEX_SECRET_KEY set
- From your MCP-capable client, call the trading tool to create an order with symbol, side, price, quantity
- Monitor order status and fills via account