AsterDex MCP Server

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.

Category
访问服务器

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:

  1. get_orderbook - Order book depth with bids and asks
  2. get_klines - OHLCV candlestick data for technical analysis
  3. get_funding_rate_history - Historical funding rate data
  4. get_ticker_24h - 24-hour price statistics
  5. get_mark_price - Mark price and funding rate info
  6. get_ticker_price - Latest price lookup
  7. get_book_ticker - Best bid/ask prices
  8. get_index_price_klines - Index price history
  9. 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 milliseconds
  • end_time (optional): End time in milliseconds
  • limit (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 milliseconds
  • end_time (optional): End time in milliseconds
  • limit (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 interval
  • start_time (optional): Start time in milliseconds
  • end_time (optional): End time in milliseconds
  • limit (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 interval
  • start_time (optional): Start time in milliseconds
  • end_time (optional): End time in milliseconds
  • limit (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/USDT
  • ETHUSDT - Ethereum/USDT
  • SOLUSDT - Solana/USDT
  • BNBUSDT - BNB/USDT
  • DOGEUSDT - 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:

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选