CO
OfficialFinance

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.

Quick Install
npx -y @coinexcom/coinex_mcp_server

Overview

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

MethodAuthenticationRecommended for
Hosted HTTPNoQuick market data access, demos
Local (uvx/pip)YesTrading bots, authenticated workflows
From sourceYesDevelopment, customization
  1. Hosted HTTP (public market data)
  • No local install. Endpoint: https://mcp.coinex.com/mcp

  • Add to an MCP-aware client (example: Claude):

claude mcp add --transport http coinex-mcp-server https://mcp.coinex.com/mcp
  1. Local installation via uvx or pip (supports authenticated operations)
  • Install via pip:
pip install coinex-mcp-server
# or using uv:
uv pip install coinex-mcp-server
  • Run as a module with credentials set as environment variables:
export COINEX_ACCESS_ID="your_access_id"
export COINEX_SECRET_KEY="your_secret_key"

python -m coinex_mcp_server.main
# For HTTP transport locally:
python -m coinex_mcp_server.main --transport http --host 0.0.0.0 --port 8000
  • Example Claude Desktop config (python module):
{
  "mcpServers": {
    "coinex": {
      "command": "python",
      "args": ["-m", "coinex_mcp_server.main"],
      "env": {
        "COINEX_ACCESS_ID": "your_access_id_here",
        "COINEX_SECRET_KEY": "your_secret_key_here"
      }
    }
  }
}
  1. From source (development)
git clone https://github.com/coinexcom/coinex_mcp_server
cd coinex_mcp_server
uv sync           # installs project dependencies when using uv tooling
cp .env.example .env
# edit .env and set:
# COINEX_ACCESS_ID=...
# COINEX_SECRET_KEY=...
python -m coinex_mcp_server.main

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):

  1. Point your MCP client at https://mcp.coinex.com/mcp
  2. 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):

  1. Start server locally with COINEX_ACCESS_ID and COINEX_SECRET_KEY set
  2. From your MCP-capable client, call the trading tool to create an order with symbol, side, price, quantity
  3. Monitor order status and fills via account
Tags:finance