AsterDex MCP Server
Provides access to AsterDex perpetual futures market data including real-time order books, candlestick charts, funding rates, and price statistics for cryptocurrency trading pairs.
README
AsterDex MCP Server
MCP (Model Context Protocol) server for AsterDex perpetual futures market data. Provides real-time and historical market data tools for Claude Code.
Features
9 Market Data Tools:
- get_orderbook - Order book depth with bids and asks
- get_klines - OHLCV candlestick data for technical analysis
- get_funding_rate_history - Historical funding rate data
- get_ticker_24h - 24-hour price statistics
- get_mark_price - Mark price and funding rate info
- get_ticker_price - Latest price lookup
- get_book_ticker - Best bid/ask prices
- get_index_price_klines - Index price history
- get_mark_price_klines - Mark price history
Installation
Prerequisites
- Python 3.10 or higher
- Claude Code CLI
Install the MCP Server
cd asterdex-mcp
pip install -e .
Configure Claude Code
Add the server to your Claude Code MCP settings:
claude mcp add asterdex-mcp
Or manually add to your MCP configuration file (~/.claude/mcp.json):
{
"mcpServers": {
"asterdex": {
"command": "python",
"args": ["-m", "asterdex_mcp.server"]
}
}
}
Usage
Once installed, you can use the tools directly in Claude Code conversations:
Example Queries
Get BTC/USDT order book:
Get the orderbook for BTCUSDT with 20 levels
Get ETH price data:
Show me 4-hour klines for ETHUSDT from the last 7 days
Analyze funding rates:
Get funding rate history for BTCUSDT over the last 30 days
Check current prices:
What's the current mark price and funding rate for SOLUSDT?
Compare index vs mark price:
Show me the difference between index price and mark price klines for BTCUSDT over the last day
Available Tools
get_orderbook
Get order book depth for a trading pair.
Parameters:
symbol(required): Trading pair (e.g., "BTCUSDT")limit(optional): Depth limit - 5, 10, 20, 50, 100, 500, or 1000. Default: 100
Example:
{
"symbol": "BTCUSDT",
"limit": 50
}
get_klines
Get OHLCV candlestick data.
Parameters:
symbol(required): Trading pair (e.g., "ETHUSDT")interval(required): Time interval - "1m", "5m", "15m", "30m", "1h", "4h", "1d", etc.start_time(optional): Start time in millisecondsend_time(optional): End time in millisecondslimit(optional): Number of candles (max 1500). Default: 500
Example:
{
"symbol": "ETHUSDT",
"interval": "1h",
"limit": 100
}
get_funding_rate_history
Get historical funding rate data.
Parameters:
symbol(optional): Trading pair (returns all if not provided)start_time(optional): Start time in millisecondsend_time(optional): End time in millisecondslimit(optional): Number of records (max 1000). Default: 100
Example:
{
"symbol": "BTCUSDT",
"limit": 50
}
get_ticker_24h
Get 24-hour price change statistics.
Parameters:
symbol(optional): Trading pair (returns all if not provided)
Example:
{
"symbol": "SOLUSDT"
}
get_mark_price
Get mark price and funding rate information.
Parameters:
symbol(optional): Trading pair (returns all if not provided)
Example:
{
"symbol": "BTCUSDT"
}
get_ticker_price
Get latest price.
Parameters:
symbol(optional): Trading pair (returns all if not provided)
Example:
{
"symbol": "ETHUSDT"
}
get_book_ticker
Get best bid/ask from order book.
Parameters:
symbol(optional): Trading pair (returns all if not provided)
Example:
{
"symbol": "BTCUSDT"
}
get_index_price_klines
Get index price candlestick history.
Parameters:
pair(required): Trading pair (e.g., "BTCUSDT")interval(required): Time intervalstart_time(optional): Start time in millisecondsend_time(optional): End time in millisecondslimit(optional): Number of candles (max 1500). Default: 500
Example:
{
"pair": "BTCUSDT",
"interval": "1h",
"limit": 200
}
get_mark_price_klines
Get mark price candlestick history.
Parameters:
symbol(required): Trading pair (e.g., "BTCUSDT")interval(required): Time intervalstart_time(optional): Start time in millisecondsend_time(optional): End time in millisecondslimit(optional): Number of candles (max 1500). Default: 500
Example:
{
"symbol": "BTCUSDT",
"interval": "4h",
"limit": 100
}
Configuration
Environment Variables
ASTERDEX_BASE_URL: Override the API base URL (default:https://fapi.asterdex.com)
Example:
export ASTERDEX_BASE_URL=https://testnet-fapi.asterdex.com
Time Format
All timestamps are in milliseconds since Unix epoch.
Convert from seconds:
time_ms = time.time() * 1000
Common time calculations:
import time
# Current time
now_ms = int(time.time() * 1000)
# 24 hours ago
day_ago_ms = now_ms - (24 * 60 * 60 * 1000)
# 7 days ago
week_ago_ms = now_ms - (7 * 24 * 60 * 60 * 1000)
Interval Options
Valid kline intervals:
- Minutes:
1m,3m,5m,15m,30m - Hours:
1h,2h,4h,6h,8h,12h - Days/Weeks/Months:
1d,3d,1w,1M
Common Trading Pairs
BTCUSDT- Bitcoin/USDTETHUSDT- Ethereum/USDTSOLUSDT- Solana/USDTBNBUSDT- BNB/USDTDOGEUSDT- Dogecoin/USDT
Use the get_ticker_price tool without a symbol to see all available trading pairs.
Troubleshooting
Server not connecting
Check that the MCP server is properly installed:
claude mcp list
You should see asterdex in the list.
Import errors
Make sure dependencies are installed:
pip install -e .
API errors
The AsterDex API may have rate limits. If you encounter errors, wait a moment and try again.
Development
Project Structure
asterdex-mcp/
├── src/asterdex_mcp/
│ ├── __init__.py
│ ├── server.py # MCP server and tools
│ ├── client.py # AsterDex API client
│ └── tools/
│ └── __init__.py
├── pyproject.toml
└── README.md
Testing
Run the server directly:
python -m asterdex_mcp.server
API Documentation
For detailed API documentation, see:
License
MIT
Support
For issues or questions:
- GitHub: asterdex/api-docs
- AsterDex Docs: docs.asterdex.com
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
E2B
Using MCP to run code via e2b.