@aicoin/opendata-mcp 2.0.1 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -99
- package/build/index.js +83 -19
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,113 +1,26 @@
|
|
|
1
|
-
# @aicoin/opendata-mcp
|
|
1
|
+
# @aicoin/opendata-mcp (Deprecated)
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
> **This package has been deprecated.** Please use [@aicoin/aicoin-mcp](https://www.npmjs.com/package/@aicoin/aicoin-mcp) instead — it includes everything in this package plus 11 exchange trading tools.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## Migration
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Replace in your MCP config:
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
Works out of the box — a free API key is built in (10 req/min, IP rate-limited).
|
|
12
|
-
|
|
13
|
-
### Claude Code
|
|
14
|
-
|
|
15
|
-
```bash
|
|
16
|
-
claude mcp add aicoin-opendata -- npx -y @aicoin/opendata-mcp
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
### Other Clients
|
|
20
|
-
|
|
21
|
-
Add to your MCP config (`.mcp.json`, `claude_desktop_config.json`, etc.):
|
|
22
|
-
|
|
23
|
-
```json
|
|
9
|
+
```diff
|
|
24
10
|
{
|
|
25
11
|
"mcpServers": {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
12
|
+
- "aicoin-opendata": {
|
|
13
|
+
- "command": "npx",
|
|
14
|
+
- "args": ["-y", "@aicoin/opendata-mcp"]
|
|
15
|
+
+ "aicoin": {
|
|
16
|
+
+ "command": "npx",
|
|
17
|
+
+ "args": ["-y", "@aicoin/aicoin-mcp"]
|
|
29
18
|
}
|
|
30
19
|
}
|
|
31
20
|
}
|
|
32
21
|
```
|
|
33
22
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
For higher rate limits, get a key at [aicoin.com/opendata](https://www.aicoin.com/opendata) and add env vars:
|
|
37
|
-
|
|
38
|
-
```json
|
|
39
|
-
{
|
|
40
|
-
"mcpServers": {
|
|
41
|
-
"aicoin-opendata": {
|
|
42
|
-
"command": "npx",
|
|
43
|
-
"args": ["-y", "@aicoin/opendata-mcp"],
|
|
44
|
-
"env": {
|
|
45
|
-
"AICOIN_ACCESS_KEY_ID": "your-key-id",
|
|
46
|
-
"AICOIN_ACCESS_SECRET": "your-secret"
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
## Tools
|
|
54
|
-
|
|
55
|
-
| Tool | What it does |
|
|
56
|
-
|------|-------------|
|
|
57
|
-
| `coin_info` | Coin list, real-time prices, profiles, AI analysis |
|
|
58
|
-
| `coin_funding_rate` | Funding rate history (per-exchange or volume-weighted) |
|
|
59
|
-
| `coin_liquidation` | Liquidation heatmap, history, estimated liquidation chart |
|
|
60
|
-
| `coin_open_interest` | Aggregated OI history (stablecoin / coin-margined) |
|
|
61
|
-
| `coin_futures_data` | Futures order book history, large orders, trade data |
|
|
62
|
-
| `market_info` | Exchange list, platform tickers, trending coins, futures OI rankings |
|
|
63
|
-
| `kline` | Standard & indicator K-lines, trading pair discovery |
|
|
64
|
-
| `index_data` | Index prices, details, list of all available indexes |
|
|
65
|
-
| `crypto_stock` | Crypto-related stock quotes, top gainers, company info |
|
|
66
|
-
| `coin_treasury` | Corporate holdings (entities, trade history, accumulated) |
|
|
67
|
-
| `depth` | Real-time order book snapshots (latest, full, grouped) |
|
|
68
|
-
| `market_overview` | Market nav, long/short ratio, liquidation, grayscale, stocks |
|
|
69
|
-
| `order_flow` | Whale order tracking, aggregated large trades |
|
|
70
|
-
| `trading_pair` | Trading pair tickers, pairs by platform, filtered search |
|
|
71
|
-
| `signal_data` | Win-rate strategy signals, alerts, abnormal price movements |
|
|
72
|
-
| `signal_manage` | Add or delete signal alerts |
|
|
73
|
-
| `news` | Paginated news articles, full article detail, RSS feed |
|
|
74
|
-
| `flash` | Flash news, industry flashes, exchange listing announcements |
|
|
75
|
-
| `hl_ticker` | Hyperliquid tickers (single coin or all) |
|
|
76
|
-
| `hl_whale` | HL whale positions, events, long/short directions |
|
|
77
|
-
| `hl_liquidation` | HL liquidation history, stats, top liquidated positions |
|
|
78
|
-
| `hl_open_interest` | HL OI summary, top coins, per-coin history |
|
|
79
|
-
| `hl_taker` | HL taker buy/sell delta, K-lines with taker volume |
|
|
80
|
-
| `hl_trader` | HL trader stats, best trades, performance, batch analytics |
|
|
81
|
-
| `hl_fills` | HL trade fills by address/order/TWAP, top trades |
|
|
82
|
-
| `hl_orders` | HL orders (latest, filled, top open, active stats, TWAP) |
|
|
83
|
-
| `hl_position` | HL position history, PnL, execution trace |
|
|
84
|
-
| `hl_portfolio` | HL portfolio curve, PnL, max drawdown, net flow |
|
|
85
|
-
| `hl_advanced` | HL generic info API, smart money finder, trader discovery |
|
|
86
|
-
| `guide` | Setup guides for API key and tier upgrade |
|
|
87
|
-
|
|
88
|
-
## Environment Variables
|
|
89
|
-
|
|
90
|
-
| Variable | Required | Description |
|
|
91
|
-
|----------|----------|-------------|
|
|
92
|
-
| `AICOIN_ACCESS_KEY_ID` | No | AiCoin API key (free tier built-in, rate-limited) |
|
|
93
|
-
| `AICOIN_ACCESS_SECRET` | No | AiCoin API secret |
|
|
94
|
-
|
|
95
|
-
## API Tiers
|
|
96
|
-
|
|
97
|
-
| Tier | Price | Rate Limit | Features |
|
|
98
|
-
|------|-------|------------|----------|
|
|
99
|
-
| Basic | Free | 10 req/min | Market data, news, K-lines, indexes |
|
|
100
|
-
| Normal | ¥99/mo | 60 req/min | + Funding rate, liquidation, OI |
|
|
101
|
-
| Premium | ¥299/mo | 120 req/min | + Depth, whale tracking, order flow |
|
|
102
|
-
| Professional | ¥999/mo | 300 req/min | + Full depth, all features |
|
|
103
|
-
|
|
104
|
-
Upgrade at [aicoin.com/opendata](https://www.aicoin.com/opendata). Your existing key is automatically upgraded.
|
|
105
|
-
|
|
106
|
-
## Migrating from v1.x
|
|
107
|
-
|
|
108
|
-
v2.0 consolidates 100+ individual tools into **30 action-based tools**. Each tool now supports multiple actions via an `action` parameter (e.g., `coin_info` with `action: "list"` / `"ticker"` / `"config"` / `"ai_analysis"`).
|
|
109
|
-
|
|
110
|
-
This reduces context overhead for AI assistants and improves tool selection accuracy. All API endpoints remain the same — only the tool interface changed.
|
|
23
|
+
All tools and environment variables remain the same. No code changes needed.
|
|
111
24
|
|
|
112
25
|
## License
|
|
113
26
|
|
package/build/index.js
CHANGED
|
@@ -31,7 +31,7 @@ function generateSignature(accessKeyId, accessSecret) {
|
|
|
31
31
|
// src/client/api.ts
|
|
32
32
|
var DOMAIN = process.env.AICOIN_BASE_URL || "https://open.aicoin.com";
|
|
33
33
|
var TIMEOUT_MS = 3e4;
|
|
34
|
-
var UPGRADE_GUIDE = "\n\n--- How to fix ---\nYour current API tier does not have access to this endpoint. Please upgrade your plan.\n1. Visit https://www.aicoin.com/opendata to purchase or upgrade\n2. Tiers: Basic(
|
|
34
|
+
var UPGRADE_GUIDE = "\n\n--- How to fix ---\nYour current API tier does not have access to this endpoint. Please upgrade your plan.\n1. Visit https://www.aicoin.com/opendata to purchase or upgrade\n2. Tiers: Free($0) | Basic($29/mo) | Standard($79/mo) | Advanced($299/mo) | Professional($699/mo)\n3. Set AICOIN_ACCESS_KEY_ID and AICOIN_ACCESS_SECRET in your MCP config\n4. Restart your MCP client";
|
|
35
35
|
var AUTH_GUIDE = "\n\n--- How to fix ---\nAn API key is required to access this endpoint.\n1. Visit https://www.aicoin.com/opendata to register and create an API key\n2. Set AICOIN_ACCESS_KEY_ID and AICOIN_ACCESS_SECRET in your MCP config\n3. Restart your MCP client";
|
|
36
36
|
function throwApiError(status, body, path) {
|
|
37
37
|
let msg = `API ${status}: ${body}`;
|
|
@@ -605,6 +605,72 @@ function registerContentTools(server2) {
|
|
|
605
605
|
}
|
|
606
606
|
}
|
|
607
607
|
);
|
|
608
|
+
server2.tool(
|
|
609
|
+
"twitter",
|
|
610
|
+
"Twitter/X crypto tweets.\n\u2022 latest \u2014 latest crypto tweets, cursor-paginated\n\u2022 search \u2014 search tweets by keyword. Requires: keyword\n\u2022 members \u2014 search Twitter KOL/users. Requires: word\n\u2022 interaction_stats \u2014 tweet engagement stats. Requires: flash_ids (POST)",
|
|
611
|
+
{
|
|
612
|
+
action: z3.enum(["latest", "search", "members", "interaction_stats"]).describe(
|
|
613
|
+
"latest: latest crypto tweets; search: search by keyword; members: search KOL/users; interaction_stats: tweet engagement"
|
|
614
|
+
),
|
|
615
|
+
keyword: z3.string().optional().describe("REQUIRED for search. Search keyword"),
|
|
616
|
+
word: z3.string().optional().describe("REQUIRED for members. User search keyword"),
|
|
617
|
+
flash_ids: z3.string().optional().describe(
|
|
618
|
+
'REQUIRED for interaction_stats. Comma-separated tweet flash IDs, e.g. "123,456,789" (max 50)'
|
|
619
|
+
),
|
|
620
|
+
language: z3.string().optional().describe("For latest/search: language filter (cn, en)"),
|
|
621
|
+
last_time: z3.string().optional().describe("For latest/search: cursor for pagination (last item timestamp)"),
|
|
622
|
+
page_size: z3.string().optional().describe("For latest/search: page size, default 20"),
|
|
623
|
+
page: z3.string().optional().describe("For members: page number, default 1"),
|
|
624
|
+
size: z3.string().optional().describe("For members: page size, default 20"),
|
|
625
|
+
...maxItemsParam
|
|
626
|
+
},
|
|
627
|
+
async ({ action, keyword, word, flash_ids, language, last_time, page_size, page, size, _max_items }) => {
|
|
628
|
+
try {
|
|
629
|
+
switch (action) {
|
|
630
|
+
case "latest": {
|
|
631
|
+
const params = {};
|
|
632
|
+
if (language) params.language = language;
|
|
633
|
+
if (last_time) params.last_time = last_time;
|
|
634
|
+
if (page_size) params.page_size = page_size;
|
|
635
|
+
return okList(
|
|
636
|
+
await apiGet("/api/upgrade/v2/content/twitter/latest", params),
|
|
637
|
+
parseMax(_max_items, 20)
|
|
638
|
+
);
|
|
639
|
+
}
|
|
640
|
+
case "search": {
|
|
641
|
+
if (!keyword) return err("keyword is required for search action");
|
|
642
|
+
const params = { keyword };
|
|
643
|
+
if (language) params.language = language;
|
|
644
|
+
if (last_time) params.last_time = last_time;
|
|
645
|
+
if (page_size) params.page_size = page_size;
|
|
646
|
+
return okList(
|
|
647
|
+
await apiGet("/api/upgrade/v2/content/twitter/search", params),
|
|
648
|
+
parseMax(_max_items, 20)
|
|
649
|
+
);
|
|
650
|
+
}
|
|
651
|
+
case "members": {
|
|
652
|
+
if (!word) return err("word is required for members action");
|
|
653
|
+
const params = { word };
|
|
654
|
+
if (page) params.page = page;
|
|
655
|
+
if (size) params.size = size;
|
|
656
|
+
return okList(
|
|
657
|
+
await apiGet("/api/upgrade/v2/content/twitter/members", params),
|
|
658
|
+
parseMax(_max_items, 20)
|
|
659
|
+
);
|
|
660
|
+
}
|
|
661
|
+
case "interaction_stats": {
|
|
662
|
+
if (!flash_ids) return err("flash_ids is required for interaction_stats action");
|
|
663
|
+
const ids = flash_ids.split(",").map((s) => Number(s.trim())).filter((n) => !isNaN(n));
|
|
664
|
+
if (ids.length === 0) return err("flash_ids must contain valid numeric IDs");
|
|
665
|
+
if (ids.length > 50) return err("flash_ids max 50 items");
|
|
666
|
+
return ok(await apiPost("/api/upgrade/v2/content/twitter/interaction-stats", { flash_ids: ids }));
|
|
667
|
+
}
|
|
668
|
+
}
|
|
669
|
+
} catch (e) {
|
|
670
|
+
return err(e);
|
|
671
|
+
}
|
|
672
|
+
}
|
|
673
|
+
);
|
|
608
674
|
}
|
|
609
675
|
|
|
610
676
|
// src/tools/markets.ts
|
|
@@ -1590,12 +1656,13 @@ Visit https://www.aicoin.com/opendata to manage your API keys.
|
|
|
1590
1656
|
## Step 3: Create API Key
|
|
1591
1657
|
Click "Create Key" and select your desired tier:
|
|
1592
1658
|
|
|
1593
|
-
| Tier | Price | Rate Limit | Features |
|
|
1594
|
-
|
|
1595
|
-
|
|
|
1596
|
-
|
|
|
1597
|
-
|
|
|
1598
|
-
|
|
|
1659
|
+
| Tier | Price | Rate Limit | Monthly Quota | Features |
|
|
1660
|
+
|------|-------|------------|---------------|----------|
|
|
1661
|
+
| Free | $0 | 15 req/min | 20K | Market, coin & special data |
|
|
1662
|
+
| Basic | $29/mo | 30 req/min | 20K | + Content data |
|
|
1663
|
+
| Standard | $79/mo | 80 req/min | 500K | + Content data |
|
|
1664
|
+
| Advanced | $299/mo | 300 req/min | 1.5M | + Content data, commercial use |
|
|
1665
|
+
| Professional | $699/mo | 1200 req/min | 3.5M | + Content data, commercial use |
|
|
1599
1666
|
|
|
1600
1667
|
## Step 4: Configure MCP Server
|
|
1601
1668
|
After creating the key, you will get two values:
|
|
@@ -1636,18 +1703,15 @@ ${endpoint ? `Endpoint: ${endpoint}` : ""}
|
|
|
1636
1703
|
|
|
1637
1704
|
## API Tier Comparison
|
|
1638
1705
|
|
|
1639
|
-
| Feature | Basic (
|
|
1640
|
-
|
|
1641
|
-
| Market
|
|
1642
|
-
|
|
|
1643
|
-
|
|
|
1644
|
-
|
|
|
1645
|
-
|
|
|
1646
|
-
|
|
|
1647
|
-
|
|
|
1648
|
-
| Depth data | \u274C | \u274C | \u2705 | \u2705 |
|
|
1649
|
-
| Strategy signals | \u274C | \u274C | \u274C | \u2705 |
|
|
1650
|
-
| Full depth & grouped | \u274C | \u274C | \u274C | \u2705 |
|
|
1706
|
+
| Feature | Free ($0) | Basic ($29) | Standard ($79) | Advanced ($299) | Professional ($699) |
|
|
1707
|
+
|---------|:---:|:---:|:---:|:---:|:---:|
|
|
1708
|
+
| Market data | \u2705 | \u2705 | \u2705 | \u2705 | \u2705 |
|
|
1709
|
+
| Coin data | \u2705 | \u2705 | \u2705 | \u2705 | \u2705 |
|
|
1710
|
+
| Special data | \u2705 | \u2705 | \u2705 | \u2705 | \u2705 |
|
|
1711
|
+
| Content data | \u274C | \u2705 | \u2705 | \u2705 | \u2705 |
|
|
1712
|
+
| Rate limit | 15/min | 30/min | 80/min | 300/min | 1200/min |
|
|
1713
|
+
| Monthly quota | 20K | 20K | 500K | 1.5M | 3.5M |
|
|
1714
|
+
| Commercial use | \u274C | \u274C | \u274C | \u2705 | \u2705 |
|
|
1651
1715
|
|
|
1652
1716
|
## How to Upgrade
|
|
1653
1717
|
1. Visit https://www.aicoin.com/opendata
|