coinex-mcp-server
OfficialClick on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@coinex-mcp-serverWhat is the current price of BTC?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
CoinEx MCP Server
中文版本 | English
A CoinEx MCP (Model Context Protocol) server that enables AI agents to interact with the CoinEx cryptocurrency exchange.
Features
🔍 Retrieve market data (spot/futures with unified parameters)
💰 Query account balances (authentication required)
📊 Get K-line data (spot/futures)
📈 View order book depth (spot/futures)
💹 Place orders (authentication required)
📋 Query order history (authentication required)
📜 Futures-specific: funding rates, premium/basis history, margin tiers, liquidation history, etc.
Related MCP server: FinClaw
Quick Start
Choose one of the following installation methods based on your needs:
Online HTTP Service (Recommended) - No local installation required, public market data only
Local Installation via uvx/pip - Supports authenticated operations (balance queries, trading)
From Source - For development or customization
Obtaining CoinEx API Credentials (Optional)
API credentials are only required for authenticated operations (account balance, trading). For market data queries only, you can skip this step.
Log in to CoinEx Official Website
Go to User Center -> API Management
Create a new API Key
Copy the Access ID and Secret Key for later use
⚠️ Security Notice:
Keep your API credentials safe and do not share them with others
Set appropriate permissions for your API Key, only enabling necessary functions
Do not commit credentials to version control systems
Installation Method 1: Online HTTP Service (Recommended)
No local installation required. Use CoinEx's hosted MCP service at https://mcp.coinex.com/mcp.
⚠️ Note: The online service only provides public market data queries. For authenticated operations (balance, trading), use Method 2 or 3.
Claude Code
claude mcp add --transport http coinex-mcp-server https://mcp.coinex.com/mcpClaude Desktop
Edit your Claude Desktop configuration file:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.jsonLinux:
~/.config/Claude/claude_desktop_config.json
{
"mcpServers": {
"coinex": {
"command": "http",
"args": ["https://mcp.coinex.com/mcp"]
}
}
}CherryStudio
In CherryStudio's MCP settings, GUI configuration:
Installation Method 2: Local Installation via uvx/pip
Install the package locally to support authenticated operations with your API credentials.
Option A: Using uvx (Recommended)
No pre-installation needed. The package will be automatically downloaded and run.
Claude Desktop
Edit your Claude Desktop configuration file:
{
"mcpServers": {
"coinex": {
"command": "uvx",
"args": ["coinex-mcp-server"],
"env": {
"COINEX_ACCESS_ID": "your_access_id_here",
"COINEX_SECRET_KEY": "your_secret_key_here"
}
}
}
}Claude Code
# Add the server
claude mcp add coinex-mcp-server uvx coinex-mcp-server
# Then manually edit the config file to add environment variables
# Config file location: ~/.config/claude/config.json
# Add env field to the coinex-mcp-server configuration:
# "env": {
# "COINEX_ACCESS_ID": "your_access_id",
# "COINEX_SECRET_KEY": "your_secret_key"
# }CherryStudio
In CherryStudio's MCP settings, add:
Option B: Using pip install
First, install the package:
# Using pip
pip install coinex-mcp-server
# Or using uv
uv pip install coinex-mcp-serverThen configure your MCP client:
Claude Desktop
{
"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"
}
}
}
}Claude Code
# Add the server
claude mcp add coinex-mcp-server python -m coinex_mcp_server.main
# Then manually edit the config file to add environment variables
# Config file location: ~/.config/claude/config.json
# Add env field to the coinex-mcp-server configuration:
# "env": {
# "COINEX_ACCESS_ID": "your_access_id",
# "COINEX_SECRET_KEY": "your_secret_key"
# }CherryStudio
Installation Method 3: From Source
For development or customization purposes.
Step 1: Clone the Repository
git clone https://github.com/coinexcom/coinex_mcp_server
cd coinex_mcp_serverStep 2: Install Dependencies
uv syncStep 3: Configure API Credentials
Copy the environment variable template file:
cp .env.example .envEdit the .env file and fill in your CoinEx API credentials:
COINEX_ACCESS_ID=your_access_id_here
COINEX_SECRET_KEY=your_secret_key_hereStep 4: Configure MCP Client
Claude Desktop
{
"mcpServers": {
"coinex": {
"command": "python",
"args": ["-m", "coinex_mcp_server.main"],
"cwd": "/path/to/coinex_mcp_server/src"
}
}
}Claude Code
# Run from the project directory
cd /path/to/coinex_mcp_server
python -m coinex_mcp_server.mainCherryStudio
Step 5: Run the Server (Optional)
For testing or running in HTTP mode:
# Default stdio mode
python -m coinex_mcp_server.main
# HTTP mode
python -m coinex_mcp_server.main --transport http --host 0.0.0.0 --port 8000
# View all available options
python -m coinex_mcp_server.main --helpAdvanced Configuration
Command Line Arguments
The server supports the following command line arguments:
--transport: Transport protocolOptions:
stdio(default) |http|streamable-http|sse
--host: HTTP service bind address (HTTP/SSE mode only)Default:
127.0.0.1
--port: HTTP service port (HTTP/SSE mode only)Default:
8000
--path: Endpoint pathHTTP mode: MCP endpoint path (default
/mcp)SSE mode: SSE mount path
--enable-http-auth: Enable HTTP-based authentication for trading toolsDefault:
false(only public market data tools exposed)
--workers: Number of worker processes (HTTP/SSE mode only)
Running as HTTP Service
# Basic HTTP service
python -m coinex_mcp_server.main --transport http --host 0.0.0.0 --port 8000
# HTTP service with authentication enabled
python -m coinex_mcp_server.main --transport http --host 0.0.0.0 --port 8000 --enable-http-auth
# HTTP service with multiple workers
python -m coinex_mcp_server.main --transport http --host 0.0.0.0 --port 8000 --workers 4⚠️ Note: If you access the /mcp endpoint directly via HTTP GET, it may return 406 Not Acceptable. This is normal—Streamable HTTP endpoints require protocol-compliant interaction flows.
HTTP Authentication Mode
When running in HTTP mode with --enable-http-auth, you can pass CoinEx credentials via HTTP headers:
Request Headers:
X-CoinEx-Access-Id: Your CoinEx Access IDX-CoinEx-Secret-Key: Your CoinEx Secret Key
Security Considerations:
Never enable HTTP authentication on publicly exposed services
Always use HTTPS in production (use reverse proxy like Nginx/Caddy)
Ensure reverse proxies/APM/logging systems don't record sensitive headers
Only use in trusted internal network environments
By default, HTTP mode only exposes public market data tools (no authentication required)
Tools Overview
Note: In HTTP mode, only public type tools are exposed by default; auth type tools require enabling --enable-http-auth or setting HTTP_AUTH_ENABLED=true to be available.
Standard Parameter Conventions:
market_type: Default"spot", use"futures"for contracts.symbol: SupportsBTCUSDT/BTC/USDT/btc/BTC(defaults toUSDTif no quote currency).interval(depth aggregation levels): Default"0".period: Default"1hour", validated against spot/futures whitelists.start_time/end_time: Millisecond timestamps.
Market Data (public)
list_markets(market_type="spot"|"futures", symbols: str|list[str]|None)Get market status;
symbolscan be comma-separated or array, returns all if not provided.
get_tickers(market_type="spot"|"futures", symbol: str|list[str]|None, top_n=5)Get ticker snapshots; returns top
top_nwhensymbolnot provided.
get_orderbook(symbol, limit=20, market_type="spot"|"futures", interval="0")Get order book (depth); supports futures.
get_kline(symbol, period="1hour", limit=100, market_type="spot"|"futures")Get K-line data; periods validated against respective spot/futures whitelists.
get_recent_trades(symbol, market_type="spot"|"futures", limit=100)Get recent trades (deals).
get_index_price(market_type="spot"|"futures", symbol: str|list[str]|None, top_n=5)Get market index (spot/futures).
Futures-Specific (public)
get_funding_rate(symbol)Get current funding rate.
get_funding_rate_history(symbol, start_time?, end_time?, page=1, limit=100)Get funding rate history.
get_premium_index_history(symbol, start_time?, end_time?, page=1, limit=100)Get premium index history.
get_basis_history(symbol, start_time?, end_time?, page=1, limit=100)Get basis rate history.
get_position_tiers(symbol)Get position tiers/margin tier information.
get_liquidation_history(symbol?, side?, start_time?, end_time?, page=1, limit=100)Get liquidation history.
Account & Trading (auth)
get_account_balance()Get account balance information.
place_order(symbol, side, type, amount, price?)Place trading order.
cancel_order(symbol, order_id)Cancel order.
get_order_history(symbol?, limit=100)Get order history (open orders + completed orders).
Environment Variables
Variable | Description | Required |
| CoinEx API Access ID | No (optional with HTTP pass-through) |
| CoinEx API Secret Key | No (optional with HTTP pass-through) |
| Bearer token to protect MCP endpoint | No |
| Required scopes for endpoint | No |
| Enable HTTP authentication (default false) | No |
Development
Project Structure
coinex_mcp_server/
├── main.py # MCP server main file
├── coinex_client.py # CoinEx API client (unified spot/futures wrapper)
├── doc/
│ ├── coinex_api/
│ │ └── coinex_api.md # CoinEx API documentation
├── pyproject.toml # Project configuration
└── README.md # Project documentationDependencies
fastmcp- FastMCP framework (2.x)httpx- HTTP clientpython-dotenv- Environment variable loading
Troubleshooting
If calls return
code != 0, record themessageand check parameters (period,limit,symbolnormalization).In corporate network environments or with firewall restrictions, external APIs may be blocked; please verify network policies.
License
This project is open source under the Apache 2.0 license.
Contributing
Issues and Pull Requests are welcome!
Disclaimer
This tool is for educational and research purposes only. When using this tool for actual trading, please fully understand the risks and operate carefully. The developers are not responsible for any losses resulting from the use of this tool.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
Alicense-qualityCmaintenanceMCP server connecting AI assistants to OKX exchange, enabling trading, market data, account management, and more via 150+ tools across 11 modules.Last updated387MIT- Alicense-qualityCmaintenanceMCP server that provides AI agents with financial tools including real-time quotes, backtesting, technical analysis, and multi-exchange data via a simple CLI interface.Last updated1MIT
- Alicense-qualityCmaintenanceAn MCP server that enables AI agents to scan the market, manage positions, and retrieve trading metrics for Bybit through natural language commands.Last updated1MIT
- Alicense-qualityBmaintenanceAn MCP server for cryptocurrency trading via Freqtrade, enabling trade management, balance checks, strategy configuration, backtesting, and bot lifecycle control from any MCP-compatible AI agent.Last updatedMIT
Related MCP Connectors
MCP server for Gainium — manage trading bots, deals, and balances via AI assistants
MCP server exposing the Backtest360 engine API as tools for AI agents.
MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/coinexcom/coinex_mcp_server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server