@aicoin/opendata-mcp 2.0.0 → 2.0.2

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.
Files changed (3) hide show
  1. package/README.md +15 -115
  2. package/build/index.js +83 -19
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -6,135 +6,34 @@ AiCoin OpenData MCP Server — real-time crypto market data & analytics for any
6
6
 
7
7
  > Need exchange trading (place orders, check balances)? Use [@aicoin/aicoin-mcp](https://www.npmjs.com/package/@aicoin/aicoin-mcp) instead — it includes everything here plus 11 CCXT trading tools.
8
8
 
9
- ## Connect
9
+ ## Quick Start
10
10
 
11
- Get your free API key at [aicoin.com/opendata](https://www.aicoin.com/opendata), then add to your MCP client:
11
+ Works out of the box — a free API key is built in (15 req/min, IP rate-limited).
12
12
 
13
13
  ### Claude Code
14
14
 
15
15
  ```bash
16
- claude mcp add aicoin-opendata -- npx -y @aicoin/opendata-mcp \
17
- --env AICOIN_ACCESS_KEY_ID=your-key-id \
18
- --env AICOIN_ACCESS_SECRET=your-secret
16
+ claude mcp add aicoin-opendata -- npx -y @aicoin/opendata-mcp
19
17
  ```
20
18
 
21
- Or add to `.mcp.json` in your project root:
19
+ ### Other Clients
22
20
 
23
- ```json
24
- {
25
- "mcpServers": {
26
- "aicoin-opendata": {
27
- "command": "npx",
28
- "args": ["-y", "@aicoin/opendata-mcp"],
29
- "env": {
30
- "AICOIN_ACCESS_KEY_ID": "your-key-id",
31
- "AICOIN_ACCESS_SECRET": "your-secret"
32
- }
33
- }
34
- }
35
- }
36
- ```
37
-
38
- ### Cursor
39
-
40
- Settings → MCP → Add new MCP server:
21
+ Add to your MCP config (`.mcp.json`, `claude_desktop_config.json`, etc.):
41
22
 
42
23
  ```json
43
24
  {
44
25
  "mcpServers": {
45
26
  "aicoin-opendata": {
46
27
  "command": "npx",
47
- "args": ["-y", "@aicoin/opendata-mcp"],
48
- "env": {
49
- "AICOIN_ACCESS_KEY_ID": "your-key-id",
50
- "AICOIN_ACCESS_SECRET": "your-secret"
51
- }
28
+ "args": ["-y", "@aicoin/opendata-mcp"]
52
29
  }
53
30
  }
54
31
  }
55
32
  ```
56
33
 
57
- ### Windsurf
58
-
59
- Add to `~/.codeium/windsurf/mcp_config.json`:
60
-
61
- ```json
62
- {
63
- "mcpServers": {
64
- "aicoin-opendata": {
65
- "command": "npx",
66
- "args": ["-y", "@aicoin/opendata-mcp"],
67
- "env": {
68
- "AICOIN_ACCESS_KEY_ID": "your-key-id",
69
- "AICOIN_ACCESS_SECRET": "your-secret"
70
- }
71
- }
72
- }
73
- }
74
- ```
75
-
76
- ### VS Code (Copilot)
77
-
78
- Add to `.vscode/mcp.json` in your project:
79
-
80
- ```json
81
- {
82
- "mcp": {
83
- "servers": {
84
- "aicoin-opendata": {
85
- "type": "stdio",
86
- "command": "npx",
87
- "args": ["-y", "@aicoin/opendata-mcp"],
88
- "env": {
89
- "AICOIN_ACCESS_KEY_ID": "your-key-id",
90
- "AICOIN_ACCESS_SECRET": "your-secret"
91
- }
92
- }
93
- }
94
- }
95
- }
96
- ```
97
-
98
- ### Claude Desktop
99
-
100
- Add to `claude_desktop_config.json`:
101
-
102
- ```json
103
- {
104
- "mcpServers": {
105
- "aicoin-opendata": {
106
- "command": "npx",
107
- "args": ["-y", "@aicoin/opendata-mcp"],
108
- "env": {
109
- "AICOIN_ACCESS_KEY_ID": "your-key-id",
110
- "AICOIN_ACCESS_SECRET": "your-secret"
111
- }
112
- }
113
- }
114
- }
115
- ```
116
-
117
- ### OpenCode
118
-
119
- Add to `.opencode/config.toml`:
120
-
121
- ```toml
122
- [mcp_servers.aicoin-opendata]
123
- command = "npx"
124
- args = ["-y", "@aicoin/opendata-mcp"]
125
-
126
- [mcp_servers.aicoin-opendata.env]
127
- AICOIN_ACCESS_KEY_ID = "your-key-id"
128
- AICOIN_ACCESS_SECRET = "your-secret"
129
- ```
130
-
131
- ### Codex
132
-
133
- ```bash
134
- codex --mcp-config mcp.json
135
- ```
34
+ ### Use Your Own API Key (Optional)
136
35
 
137
- Where `mcp.json` contains:
36
+ For higher rate limits, get a key at [aicoin.com/opendata](https://www.aicoin.com/opendata) and add env vars:
138
37
 
139
38
  ```json
140
39
  {
@@ -195,12 +94,13 @@ Where `mcp.json` contains:
195
94
 
196
95
  ## API Tiers
197
96
 
198
- | Tier | Price | Rate Limit | Features |
199
- |------|-------|------------|----------|
200
- | Basic | Free | 10 req/min | Market data, news, K-lines, indexes |
201
- | Normal | ¥99/mo | 60 req/min | + Funding rate, liquidation, OI |
202
- | Premium | ¥299/mo | 120 req/min | + Depth, whale tracking, order flow |
203
- | Professional | ¥999/mo | 300 req/min | + Full depth, all features |
97
+ | Tier | Price | Rate Limit | Monthly Quota | Features |
98
+ |------|-------|------------|---------------|----------|
99
+ | Free | $0 | 15 req/min | 20K | Market, coin & special data |
100
+ | Basic | $29/mo | 30 req/min | 20K | + Content data |
101
+ | Standard | $79/mo | 80 req/min | 500K | + Content data |
102
+ | Advanced | $299/mo | 300 req/min | 1.5M | + Content data, commercial use |
103
+ | Professional | $699/mo | 1200 req/min | 3.5M | + Content data, commercial use |
204
104
 
205
105
  Upgrade at [aicoin.com/opendata](https://www.aicoin.com/opendata). Your existing key is automatically upgraded.
206
106
 
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(free) | Normal(\xA599) | Premium(\xA5299) | Professional(\xA5999)\n3. Set AICOIN_ACCESS_KEY_ID and AICOIN_ACCESS_SECRET in your MCP config\n4. Restart your MCP client";
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
- | Basic | Free | 10 req/min | Market data, news, basic indicators |
1596
- | Normal | \xA599/mo | 60 req/min | + Funding rate, liquidation data |
1597
- | Premium | \xA5299/mo | 120 req/min | + Depth data, whale tracking |
1598
- | Professional | \xA5999/mo | 300 req/min | + Full depth, all features |
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 (Free) | Normal (\xA599) | Premium (\xA5299) | Professional (\xA5999) |
1640
- |---------|:---:|:---:|:---:|:---:|
1641
- | Market tickers & K-lines | \u2705 | \u2705 | \u2705 | \u2705 |
1642
- | News & flash | \u2705 | \u2705 | \u2705 | \u2705 |
1643
- | Index data | \u2705 | \u2705 | \u2705 | \u2705 |
1644
- | Funding rate history | \u274C | \u2705 | \u2705 | \u2705 |
1645
- | Liquidation data | \u274C | \u2705 | \u2705 | \u2705 |
1646
- | OI history | \u274C | \u2705 | \u2705 | \u2705 |
1647
- | Whale order tracking | \u274C | \u274C | \u2705 | \u2705 |
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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aicoin/opendata-mcp",
3
- "version": "2.0.0",
3
+ "version": "2.0.2",
4
4
  "description": "AiCoin OpenData MCP Server - crypto market data via AiCoin Open API",
5
5
  "main": "build/index.js",
6
6
  "type": "module",