小行星信息MCP
提供结构化访问的MCP服务器 阿斯特DEX 市场数据——包括烛台、订单簿、交易和融资率。
特性
- 13工具:访问各种Aster Finance Futures API端点,包括:
- 烛台数据(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错误(例如400429)和数据处理问题,但有明显的异常。
安装
先决条件
- Python 3.10或更高版本
- 紫外线 (推荐包管理器)
步骤
- 克隆存储库:
git clone https://github.com/kukapay/aster-info-mcp.git
cd aster-info-mcp- 再进行:
uv sync- 安装到克劳德桌面:
将服务器安装为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 | 获取某个交易品种的烛台数据。 | symbol, interval, startTime (可选), endTime (可选), limit (可选) |
get_index_price_kline | 获取一对的指数价格烛台数据。 | pair, interval, startTime (可选), endTime (可选), limit (可选) |
get_mark_price_kline | 获取某个交易品种的标记价格烛台数据。 | 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表的形式返回数据。
- 标记的参数
(opt)是可选的。 - 时间戳以毫秒为单位(Unix纪元);输出被转换为可读的日期时间格式。
- 数字字段四舍五入到小数点后8位(除
priceChangePercent,四舍五入为2)。
例子
下面是13个工具中的每个工具的示例。
示例:获取烛台数据(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 |示例:获取指数价格烛台数据(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 |示例:获取标记价格烛台数据(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许可证.
