🚀 Aster Info MCP
Aster Info MCP 是一個 MCP 服務器,它提供對 Aster DEX 市場數據的結構化訪問,涵蓋K線圖、訂單簿、交易記錄和資金費率等數據。

✨ 主要特性
- 13 種工具:可訪問多種 Aster Finance Futures API 端點,包括:
- K線數據(
get_kline、get_index_price_kline、get_mark_price_kline)
- 價格和行情數據(
get_latest_price、get_price_change_statistics_24h、get_order_book_ticker)
- 訂單簿和交易數據(
get_order_book、get_recent_trades、get_historical_trades、get_aggregated_trades)
- 資金和指數數據(
get_premium_index、get_funding_rate_history)
- Markdown 輸出:所有工具返回的數據均為格式化的 Markdown 表格,便於閱讀和集成。
- 強大的錯誤處理:能夠處理 HTTP 錯誤(如 400、429)和數據處理問題,並拋出清晰的異常。
📦 安裝指南
前提條件
- Python 3.10 或更高版本
- uv(推薦的包管理器)
步驟
-
克隆倉庫:
git clone https://github.com/kukapay/aster-info-mcp.git
cd aster-info-mcp
-
安裝依賴:
uv sync
-
安裝到 Claude Desktop:
將服務器作為 Claude Desktop 應用程序進行安裝:
uv run mcp install main.py --name "Aster Info"
參考配置文件如下:
{
"mcpServers": {
"Aster Info": {
"command": "uv",
"args": [ "--directory", "/path/to/aster-info-mcp", "run", "main.py" ]
}
}
}
請將 /path/to/aster-info-mcp 替換為你實際的安裝路徑。
💻 使用示例
可用工具
| 工具名稱 |
描述 |
參數 |
get_kline |
獲取某個交易對的K線數據 |
symbol、interval、startTime(可選)、endTime(可選)、limit(可選) |
get_index_price_kline |
獲取某個交易對的指數價格K線數據 |
pair、interval、startTime(可選)、endTime(可選)、limit(可選) |
get_mark_price_kline |
獲取某個交易對的標記價格K線數據 |
symbol、interval、startTime(可選)、endTime(可選)、limit(可選) |
get_premium_index |
獲取某個交易對的溢價指數數據 |
symbol(可選) |
get_funding_rate_history |
獲取某個交易對的歷史資金費率數據 |
symbol、startTime(可選)、endTime(可選)、limit(可選) |
get_price_change_statistics_24h |
獲取某個交易對的 24 小時價格變動統計數據 |
symbol(可選) |
get_latest_price |
獲取某個交易對或所有交易對的最新價格 |
symbol(可選) |
get_order_book_ticker |
獲取某個交易對的訂單簿行情數據(最佳買賣價格和數量) |
symbol(可選) |
get_order_book |
獲取某個交易對的訂單簿數據(買賣盤) |
symbol、limit(可選) |
get_recent_trades |
獲取某個交易對的最近交易記錄 |
symbol、limit(可選) |
get_historical_trades |
獲取某個交易對的歷史交易記錄 |
symbol、limit(可選)、fromId(可選) |
get_aggregated_trades |
獲取某個交易對的聚合交易記錄 |
symbol、fromId(可選)、startTime(可選)、endTime(可選)、limit(可選) |
注意事項:
- 所有工具返回的數據均為 Markdown 表格。
- 標記為
(可選) 的參數為可選參數。
- 時間戳以毫秒為單位(Unix 時間戳);輸出會轉換為易讀的日期時間格式。
- 數字字段會四捨五入到 8 位小數(
priceChangePercent 四捨五入到 2 位)。
基礎用法
下面是 13 種工具的使用示例。
示例:獲取 K 線數據(get_kline)
提示:
Get me the latest 1-minute candlestick data for ETHUSDT, limited to the last 2 entries.
預期響應(Markdown 表格):
| open_time | open | high | low | close |
|---------------------|-----------|-----------|-----------|-----------|
| 2025-06-18 22:42:00 | 3500.1234 | 3510.5678 | 3490.4321 | 3505.6789 |
| 2025-06-18 22:43:00 | 3505.6789 | 3520.1234 | 3500.8765 | 3510.2345 |
示例:獲取指數價格 K 線數據(get_index_price_kline)
提示:
Show me the 1-hour index price candlestick data for BTCUSD for the last 2 hours.
預期響應(Markdown 表格):
| open_time | open | high | low | close |
|---------------------|------------|------------|------------|------------|
| 2025-06-18 21:00:00 | 65000.1234 | 65200.5678 | 64900.4321 | 65100.6789 |
| 2025-06-18 22:00:00 | 65100.6789 | 65300.1234 | 65050.8765 | 65210.2345 |
示例:獲取標記價格 K 線數據(get_mark_price_kline)
提示:
Give me the 1-minute mark price candlestick data for BTCUSDT, limited to the last 2 entries.
預期響應(Markdown 表格):
| open_time | open | high | low | close |
|---------------------|------------|------------|------------|------------|
| 2025-06-18 22:42:00 | 65010.1234 | 65020.5678 | 65000.4321 | 65015.6789 |
| 2025-06-18 22:43:00 | 65015.6789 | 65030.1234 | 65010.8765 | 65025.2345 |
示例:獲取溢價指數數據(get_premium_index)
提示:
Show me the premium index data for ETHUSDT.
預期響應(Markdown 表格):
| symbol | markPrice | indexPrice | lastFundingRate | nextFundingTime |
|---------|------------|------------|-----------------|---------------------|
| ETHUSDT | 3505.1234 | 3500.5678 | 0.0001 | 2025-06-19 00:00:00 |
示例:獲取歷史資金費率數據(get_funding_rate_history)
提示:
Get the funding rate history for BTCUSDT, limited to the last 2 records.
預期響應(Markdown 表格):
| symbol | fundingTime | fundingRate |
|---------|---------------------|-------------|
| BTCUSDT | 2025-06-18 16:00:00 | 0.00012 |
| BTCUSDT | 2025-06-18 20:00:00 | 0.00015 |
示例:獲取 24 小時價格變動統計數據(get_price_change_statistics_24h)
提示:
Show me the 24-hour price change statistics for ETHUSDT.
預期響應(Markdown 表格):
| symbol | priceChange | priceChangePercent | lastPrice | volume |
|---------|-------------|--------------------|------------|------------|
| ETHUSDT | 50.1234 | 1.45 | 3505.6789 | 1000.4321 |
示例:獲取最新價格(get_latest_price)
提示:
Show me the current price of BTCUSDT.
預期響應(Markdown 表格):
| symbol | price |
|---------|------------|
| BTCUSDT | 65000.1234 |
示例:獲取訂單簿行情數據(get_order_book_ticker)
提示:
Get the best bid and ask prices for ETHUSDT.
預期響應(Markdown 表格):
| symbol | bidPrice | bidQty | askPrice | askQty |
|---------|-----------|-----------|-----------|-----------|
| ETHUSDT | 3500.1234 | 10.5678 | 3505.6789 | 15.4321 |
示例:獲取訂單簿數據(get_order_book)
提示:
Show me the order book for BTCUSDT with 2 entries per side.
預期響應(Markdown 表格):
| side | price | quantity |
|------|------------|------------|
| bid | 65000.1234 | 0.5678 |
| bid | 64995.6789 | 0.4321 |
| ask | 65005.1234 | 0.8765 |
| ask | 65010.6789 | 0.2345 |
示例:獲取最近交易記錄(get_recent_trades)
提示:
Get the most recent trades for ETHUSDT, limited to 2 trades.
預期響應(Markdown 表格):
| tradeId | price | qty | quoteQty | time | isBuyerMaker |
|---------|-----------|-----------|-----------|---------------------|--------------|
| 123456 | 3505.6789 | 1.2345 | 4321.1234 | 2025-06-18 22:43:00 | True |
| 123457 | 3500.1234 | 0.8765 | 3067.5678 | 2025-06-18 22:42:00 | False |
示例:獲取歷史交易記錄(get_historical_trades)
提示:
Show me historical trades for BTCUSDT starting from trade ID 1000, limited to 2 trades.
預期響應(Markdown 表格):
| tradeId | price | qty | quoteQty | time | isBuyerMaker |
|---------|------------|-----------|------------|---------------------|--------------|
| 1000 | 65000.1234 | 0.1234 | 8025.6789 | 2025-06-18 20:00:00 | True |
| 1001 | 64995.6789 | 0.2345 | 15245.1234 | 2025-06-18 20:01:00 | False |
示例:獲取聚合交易記錄(get_aggregated_trades)
提示:
Get aggregated trades for ETHUSDT starting from aggregated trade ID 500, limited to 2 trades.
預期響應(Markdown 表格):
| aggTradeId | price | qty | firstTradeId | lastTradeId | time | isBuyerMaker |
|------------|-----------|-----------|--------------|-------------|---------------------|--------------|
| 500 | 3500.1234 | 5.6789 | 1000 | 1005 | 2025-06-18 22:40:00 | True |
| 501 | 3505.6789 | 3.4321 | 1006 | 1010 | 2025-06-18 22:41:00 | False |
📄 許可證
本項目採用 MIT 許可證 進行許可。