@cryptoquant_official/mcp 0.0.4 → 0.0.7
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 +308 -39
- package/dist/ai-sdk/execute.d.ts +35 -0
- package/dist/ai-sdk/execute.d.ts.map +1 -0
- package/dist/ai-sdk/execute.js +531 -0
- package/dist/ai-sdk/execute.js.map +1 -0
- package/dist/ai-sdk/index.d.ts +51 -0
- package/dist/ai-sdk/index.d.ts.map +1 -0
- package/dist/ai-sdk/index.js +54 -0
- package/dist/ai-sdk/index.js.map +1 -0
- package/dist/ai-sdk/prompts.d.ts +34 -0
- package/dist/ai-sdk/prompts.d.ts.map +1 -0
- package/dist/ai-sdk/prompts.js +74 -0
- package/dist/ai-sdk/prompts.js.map +1 -0
- package/dist/ai-sdk/schemas.d.ts +66 -0
- package/dist/ai-sdk/schemas.d.ts.map +1 -0
- package/dist/ai-sdk/schemas.js +136 -0
- package/dist/ai-sdk/schemas.js.map +1 -0
- package/dist/ai-sdk/tools.d.ts +165 -0
- package/dist/ai-sdk/tools.d.ts.map +1 -0
- package/dist/ai-sdk/tools.js +152 -0
- package/dist/ai-sdk/tools.js.map +1 -0
- package/dist/ai-sdk/types.d.ts +149 -0
- package/dist/ai-sdk/types.d.ts.map +1 -0
- package/dist/ai-sdk/types.js +5 -0
- package/dist/ai-sdk/types.js.map +1 -0
- package/dist/core/auth/storage.d.ts.map +1 -0
- package/dist/core/auth/storage.js.map +1 -0
- package/dist/core/cache/storage.d.ts +110 -0
- package/dist/core/cache/storage.d.ts.map +1 -0
- package/dist/core/cache/storage.js +356 -0
- package/dist/core/cache/storage.js.map +1 -0
- package/dist/core/cache/summary.d.ts.map +1 -0
- package/dist/core/cache/summary.js.map +1 -0
- package/dist/{cache → core/cache}/types.d.ts +25 -0
- package/dist/{cache → core/cache}/types.d.ts.map +1 -1
- package/dist/core/cache/types.js.map +1 -0
- package/dist/core/config.d.ts.map +1 -0
- package/dist/core/config.js.map +1 -0
- package/dist/core/discovery.d.ts.map +1 -0
- package/dist/{discovery.js → core/discovery.js} +14 -2
- package/dist/core/discovery.js.map +1 -0
- package/dist/core/index.d.ts +16 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +19 -0
- package/dist/core/index.js.map +1 -0
- package/dist/{permissions.d.ts → core/permissions.d.ts} +2 -2
- package/dist/core/permissions.d.ts.map +1 -0
- package/dist/{permissions.js → core/permissions.js} +38 -14
- package/dist/core/permissions.js.map +1 -0
- package/dist/core/plan-limits.d.ts.map +1 -0
- package/dist/core/plan-limits.js.map +1 -0
- package/dist/{utils.d.ts → core/utils.d.ts} +13 -0
- package/dist/core/utils.d.ts.map +1 -0
- package/dist/{utils.js → core/utils.js} +34 -0
- package/dist/core/utils.js.map +1 -0
- package/dist/data/metrics.toon +8 -5
- package/dist/http/chat-proxy.d.ts +32 -0
- package/dist/http/chat-proxy.d.ts.map +1 -0
- package/dist/http/chat-proxy.js +305 -0
- package/dist/http/chat-proxy.js.map +1 -0
- package/dist/http/index.d.ts +16 -0
- package/dist/http/index.d.ts.map +1 -0
- package/dist/http/index.js +26 -0
- package/dist/http/index.js.map +1 -0
- package/dist/http/server.d.ts +20 -0
- package/dist/http/server.d.ts.map +1 -0
- package/dist/http/server.js +204 -0
- package/dist/http/server.js.map +1 -0
- package/dist/index.d.ts +8 -16
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +19 -29
- package/dist/index.js.map +1 -1
- package/dist/mcp/index.d.ts +6 -0
- package/dist/mcp/index.d.ts.map +1 -0
- package/dist/mcp/index.js +6 -0
- package/dist/mcp/index.js.map +1 -0
- package/dist/mcp/tools/auth.d.ts +3 -0
- package/dist/mcp/tools/auth.d.ts.map +1 -0
- package/dist/{tools → mcp/tools}/auth.js +38 -12
- package/dist/mcp/tools/auth.js.map +1 -0
- package/dist/mcp/tools/core.d.ts +3 -0
- package/dist/mcp/tools/core.d.ts.map +1 -0
- package/dist/{tools → mcp/tools}/core.js +122 -162
- package/dist/mcp/tools/core.js.map +1 -0
- package/dist/shared/metrics-data.generated.d.ts +176 -0
- package/dist/shared/metrics-data.generated.d.ts.map +1 -0
- package/dist/shared/metrics-data.generated.js +3077 -0
- package/dist/shared/metrics-data.generated.js.map +1 -0
- package/package.json +44 -5
- package/dist/auth/storage.d.ts.map +0 -1
- package/dist/auth/storage.js.map +0 -1
- package/dist/cache/storage.d.ts +0 -47
- package/dist/cache/storage.d.ts.map +0 -1
- package/dist/cache/storage.js +0 -140
- package/dist/cache/storage.js.map +0 -1
- package/dist/cache/summary.d.ts.map +0 -1
- package/dist/cache/summary.js.map +0 -1
- package/dist/cache/types.js.map +0 -1
- package/dist/config.d.ts.map +0 -1
- package/dist/config.js.map +0 -1
- package/dist/discovery.d.ts.map +0 -1
- package/dist/discovery.js.map +0 -1
- package/dist/permissions.d.ts.map +0 -1
- package/dist/permissions.js.map +0 -1
- package/dist/plan-limits.d.ts.map +0 -1
- package/dist/plan-limits.js.map +0 -1
- package/dist/tools/auth.d.ts +0 -3
- package/dist/tools/auth.d.ts.map +0 -1
- package/dist/tools/auth.js.map +0 -1
- package/dist/tools/core.d.ts +0 -3
- package/dist/tools/core.d.ts.map +0 -1
- package/dist/tools/core.js.map +0 -1
- package/dist/utils.d.ts.map +0 -1
- package/dist/utils.js.map +0 -1
- /package/dist/{auth → core/auth}/storage.d.ts +0 -0
- /package/dist/{auth → core/auth}/storage.js +0 -0
- /package/dist/{cache → core/cache}/summary.d.ts +0 -0
- /package/dist/{cache → core/cache}/summary.js +0 -0
- /package/dist/{cache → core/cache}/types.js +0 -0
- /package/dist/{config.d.ts → core/config.d.ts} +0 -0
- /package/dist/{config.js → core/config.js} +0 -0
- /package/dist/{discovery.d.ts → core/discovery.d.ts} +0 -0
- /package/dist/{plan-limits.d.ts → core/plan-limits.d.ts} +0 -0
- /package/dist/{plan-limits.js → core/plan-limits.js} +0 -0
package/README.md
CHANGED
|
@@ -1,20 +1,35 @@
|
|
|
1
1
|
# @cryptoquant_official/mcp
|
|
2
2
|
|
|
3
|
-
CryptoQuant
|
|
3
|
+
CryptoQuant on-chain analytics for Claude and AI applications.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Integration Modes
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
| Mode | Use Case | Streaming | Setup |
|
|
8
|
+
|------|----------|-----------|-------|
|
|
9
|
+
| [**MCP**](#mode-1-mcp-claude-desktopcode) | Claude Desktop, Claude Code, Cursor | - | Config file |
|
|
10
|
+
| [**AI SDK**](#mode-2-ai-sdk-nextjs) | Next.js web apps | ✅ | npm package |
|
|
11
|
+
| [**HTTP**](#mode-3-http-chat-proxy) | Any backend / non-Node.js | ❌ | Standalone server |
|
|
8
12
|
|
|
9
|
-
|
|
13
|
+
**Get your API key**: [cryptoquant.com/settings/api](https://cryptoquant.com/settings/api)
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## Mode 1: MCP (Claude Desktop/Code)
|
|
18
|
+
|
|
19
|
+
For Claude Desktop, Claude Code, Cursor, and other MCP-compatible apps.
|
|
10
20
|
|
|
11
|
-
|
|
21
|
+
### Setup
|
|
22
|
+
|
|
23
|
+
**Claude Code** (`~/.claude/mcp.json` or `.mcp.json`):
|
|
12
24
|
```json
|
|
13
25
|
{
|
|
14
26
|
"mcpServers": {
|
|
15
27
|
"cryptoquant": {
|
|
16
28
|
"command": "npx",
|
|
17
|
-
"args": ["-y", "@cryptoquant_official/mcp"]
|
|
29
|
+
"args": ["-y", "@cryptoquant_official/mcp"],
|
|
30
|
+
"env": {
|
|
31
|
+
"CRYPTOQUANT_API_KEY": "your-api-key"
|
|
32
|
+
}
|
|
18
33
|
}
|
|
19
34
|
}
|
|
20
35
|
}
|
|
@@ -26,51 +41,302 @@ Add to your MCP configuration:
|
|
|
26
41
|
"mcpServers": {
|
|
27
42
|
"cryptoquant": {
|
|
28
43
|
"command": "npx",
|
|
29
|
-
"args": ["-y", "@cryptoquant_official/mcp"]
|
|
44
|
+
"args": ["-y", "@cryptoquant_official/mcp"],
|
|
45
|
+
"env": {
|
|
46
|
+
"CRYPTOQUANT_API_KEY": "your-api-key"
|
|
47
|
+
}
|
|
30
48
|
}
|
|
31
49
|
}
|
|
32
50
|
}
|
|
33
51
|
```
|
|
34
52
|
|
|
35
|
-
|
|
53
|
+
Restart your app after configuration.
|
|
36
54
|
|
|
37
|
-
###
|
|
55
|
+
### Usage
|
|
38
56
|
|
|
39
|
-
|
|
57
|
+
```
|
|
58
|
+
User: "Is Bitcoin overvalued?"
|
|
59
|
+
|
|
60
|
+
Claude: Let me check the MVRV ratio...
|
|
61
|
+
→ Calls query_data({ endpoint: "/v1/btc/market-data/mvrv" })
|
|
62
|
+
→ Returns analysis with current valuation status
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
## Mode 2: AI SDK (Next.js)
|
|
68
|
+
|
|
69
|
+
For Next.js web apps with streaming responses via Vercel AI SDK.
|
|
70
|
+
|
|
71
|
+
### Installation
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
npm install @cryptoquant_official/mcp ai @ai-sdk/react @ai-sdk/anthropic
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### Environment Variables
|
|
78
|
+
|
|
79
|
+
```env
|
|
80
|
+
# .env.local
|
|
81
|
+
ANTHROPIC_API_KEY=sk-ant-...
|
|
82
|
+
CRYPTOQUANT_API_KEY=cq-...
|
|
83
|
+
```
|
|
40
84
|
|
|
41
|
-
|
|
85
|
+
> `@ai-sdk/anthropic` automatically reads `ANTHROPIC_API_KEY`.
|
|
42
86
|
|
|
43
|
-
|
|
87
|
+
### API Route
|
|
44
88
|
|
|
45
|
-
|
|
89
|
+
```typescript
|
|
90
|
+
// app/api/chat/route.ts
|
|
91
|
+
import { streamText } from "ai";
|
|
92
|
+
import { anthropic } from "@ai-sdk/anthropic";
|
|
93
|
+
import { createCryptoQuantTools } from "@cryptoquant_official/mcp/ai-sdk";
|
|
46
94
|
|
|
47
|
-
|
|
95
|
+
export const maxDuration = 60;
|
|
48
96
|
|
|
97
|
+
export async function POST(req: Request) {
|
|
98
|
+
const { messages } = await req.json();
|
|
99
|
+
|
|
100
|
+
const result = streamText({
|
|
101
|
+
model: anthropic("claude-sonnet-4-20250514"),
|
|
102
|
+
messages,
|
|
103
|
+
tools: createCryptoQuantTools({
|
|
104
|
+
cryptoquantApiKey: process.env.CRYPTOQUANT_API_KEY!,
|
|
105
|
+
}),
|
|
106
|
+
maxSteps: 5,
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
return result.toDataStreamResponse();
|
|
110
|
+
}
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### Client Component
|
|
114
|
+
|
|
115
|
+
```tsx
|
|
116
|
+
"use client";
|
|
117
|
+
import { useChat } from "@ai-sdk/react";
|
|
118
|
+
|
|
119
|
+
export function CryptoChat() {
|
|
120
|
+
const { messages, input, handleInputChange, handleSubmit, isLoading } = useChat();
|
|
121
|
+
|
|
122
|
+
return (
|
|
123
|
+
<div>
|
|
124
|
+
{messages.map((m) => (
|
|
125
|
+
<div key={m.id}>{m.content}</div>
|
|
126
|
+
))}
|
|
127
|
+
<form onSubmit={handleSubmit}>
|
|
128
|
+
<input value={input} onChange={handleInputChange} />
|
|
129
|
+
<button type="submit" disabled={isLoading}>Send</button>
|
|
130
|
+
</form>
|
|
131
|
+
</div>
|
|
132
|
+
);
|
|
133
|
+
}
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
### API Reference
|
|
137
|
+
|
|
138
|
+
```typescript
|
|
139
|
+
// Option 1: With explicit API key
|
|
140
|
+
import { createCryptoQuantTools } from "@cryptoquant_official/mcp/ai-sdk";
|
|
141
|
+
const tools = createCryptoQuantTools({ cryptoquantApiKey: "cq-..." });
|
|
142
|
+
|
|
143
|
+
// Option 2: Using CRYPTOQUANT_API_KEY env var
|
|
144
|
+
import { cryptoQuantTools } from "@cryptoquant_official/mcp/ai-sdk";
|
|
145
|
+
streamText({ tools: cryptoQuantTools, ... });
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
See [examples/nextjs-ai-sdk/](examples/nextjs-ai-sdk/) for complete example.
|
|
149
|
+
|
|
150
|
+
---
|
|
151
|
+
|
|
152
|
+
## Mode 3: HTTP (Chat Proxy)
|
|
153
|
+
|
|
154
|
+
Standalone HTTP server for any backend or non-Node.js environments.
|
|
155
|
+
|
|
156
|
+
### Start Server
|
|
157
|
+
|
|
158
|
+
```bash
|
|
159
|
+
MCP_TRANSPORT=http npx @cryptoquant_official/mcp
|
|
160
|
+
# Server runs at http://localhost:3100
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
### Endpoints
|
|
164
|
+
|
|
165
|
+
| Endpoint | Method | Description |
|
|
166
|
+
|----------|--------|-------------|
|
|
167
|
+
| `/chat` | POST | Chat with Claude + automatic tool execution |
|
|
168
|
+
| `/tools/schema` | GET | Get Claude API tool definitions |
|
|
169
|
+
| `/health` | GET | Server health check |
|
|
170
|
+
| `/mcp` | POST/GET/DELETE | Streamable HTTP MCP protocol |
|
|
171
|
+
|
|
172
|
+
### POST /chat
|
|
173
|
+
|
|
174
|
+
```bash
|
|
175
|
+
curl -X POST http://localhost:3100/chat \
|
|
176
|
+
-H "Content-Type: application/json" \
|
|
177
|
+
-d '{
|
|
178
|
+
"message": "Analyze Bitcoin MVRV",
|
|
179
|
+
"claude_api_key": "sk-ant-...",
|
|
180
|
+
"cryptoquant_api_key": "cq-..."
|
|
181
|
+
}'
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
**Request:**
|
|
49
185
|
```json
|
|
50
186
|
{
|
|
51
|
-
"
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
187
|
+
"message": "Is Bitcoin overvalued?",
|
|
188
|
+
"claude_api_key": "sk-ant-...",
|
|
189
|
+
"cryptoquant_api_key": "cq-...",
|
|
190
|
+
"conversation_id": "optional-session-id",
|
|
191
|
+
"model": "claude-sonnet-4-20250514"
|
|
192
|
+
}
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
**Response:**
|
|
196
|
+
```json
|
|
197
|
+
{
|
|
198
|
+
"success": true,
|
|
199
|
+
"response": "Based on the current MVRV of 2.1...",
|
|
200
|
+
"tool_calls": [
|
|
201
|
+
{ "name": "initialize", "result": { "success": true } },
|
|
202
|
+
{ "name": "query_data", "result": { "data": [...] } }
|
|
203
|
+
],
|
|
204
|
+
"conversation_id": "abc-123",
|
|
205
|
+
"usage": { "input_tokens": 150, "output_tokens": 300 }
|
|
206
|
+
}
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
### Next.js with HTTP Mode
|
|
210
|
+
|
|
211
|
+
```typescript
|
|
212
|
+
// app/api/chat/route.ts
|
|
213
|
+
export async function POST(request: Request) {
|
|
214
|
+
const { message, conversation_id } = await request.json();
|
|
215
|
+
|
|
216
|
+
const response = await fetch("http://localhost:3100/chat", {
|
|
217
|
+
method: "POST",
|
|
218
|
+
headers: { "Content-Type": "application/json" },
|
|
219
|
+
body: JSON.stringify({
|
|
220
|
+
message,
|
|
221
|
+
claude_api_key: process.env.CLAUDE_API_KEY,
|
|
222
|
+
cryptoquant_api_key: process.env.CRYPTOQUANT_API_KEY,
|
|
223
|
+
conversation_id,
|
|
224
|
+
}),
|
|
225
|
+
});
|
|
226
|
+
|
|
227
|
+
return Response.json(await response.json());
|
|
228
|
+
}
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
See [examples/nextjs/](examples/nextjs/) for complete example.
|
|
232
|
+
|
|
233
|
+
---
|
|
234
|
+
|
|
235
|
+
## Custom Cache Storage
|
|
236
|
+
|
|
237
|
+
The MCP server caches API discovery data to reduce startup time. By default:
|
|
238
|
+
- **CLI/Local**: File storage (`~/.cryptoquant/discovery-cache.json`)
|
|
239
|
+
- **Web Server**: No caching (requires Redis configuration)
|
|
240
|
+
|
|
241
|
+
### Redis Storage for Web Servers
|
|
242
|
+
|
|
243
|
+
For production web servers or serverless environments, configure Redis storage:
|
|
244
|
+
|
|
245
|
+
```typescript
|
|
246
|
+
// app/lib/cryptoquant-cache.ts
|
|
247
|
+
import { createClient } from "redis";
|
|
248
|
+
import { setRedisStorage, type CacheStorage } from "@cryptoquant_official/mcp";
|
|
249
|
+
|
|
250
|
+
const redis = createClient({ url: process.env.REDIS_URL });
|
|
251
|
+
|
|
252
|
+
export async function configureRedisCache() {
|
|
253
|
+
if (!redis.isOpen) {
|
|
254
|
+
await redis.connect();
|
|
59
255
|
}
|
|
256
|
+
|
|
257
|
+
const redisStorage: CacheStorage = {
|
|
258
|
+
type: "redis",
|
|
259
|
+
|
|
260
|
+
async read(apiUrl, apiKeyPrefix) {
|
|
261
|
+
const key = `cryptoquant:cache:${apiUrl}:${apiKeyPrefix}`;
|
|
262
|
+
const data = await redis.get(key);
|
|
263
|
+
return data ? JSON.parse(data) : null;
|
|
264
|
+
},
|
|
265
|
+
|
|
266
|
+
async write(apiUrl, cache) {
|
|
267
|
+
const key = `cryptoquant:cache:${apiUrl}:${cache.metadata.api_key_prefix}`;
|
|
268
|
+
const ttl = 7 * 24 * 60 * 60; // 7 days
|
|
269
|
+
await redis.setEx(key, ttl, JSON.stringify(cache));
|
|
270
|
+
},
|
|
271
|
+
|
|
272
|
+
async invalidate(apiUrl, apiKeyPrefix) {
|
|
273
|
+
if (apiKeyPrefix) {
|
|
274
|
+
await redis.del(`cryptoquant:cache:${apiUrl}:${apiKeyPrefix}`);
|
|
275
|
+
} else {
|
|
276
|
+
const keys = await redis.keys(`cryptoquant:cache:${apiUrl}:*`);
|
|
277
|
+
if (keys.length > 0) await redis.del(keys);
|
|
278
|
+
}
|
|
279
|
+
},
|
|
280
|
+
|
|
281
|
+
async clearAll() {
|
|
282
|
+
const keys = await redis.keys("cryptoquant:cache:*");
|
|
283
|
+
if (keys.length > 0) await redis.del(keys);
|
|
284
|
+
},
|
|
285
|
+
|
|
286
|
+
getPath() {
|
|
287
|
+
return "[redis]";
|
|
288
|
+
},
|
|
289
|
+
};
|
|
290
|
+
|
|
291
|
+
setRedisStorage(redisStorage);
|
|
60
292
|
}
|
|
61
293
|
```
|
|
62
294
|
|
|
63
|
-
|
|
295
|
+
```typescript
|
|
296
|
+
// app/api/chat/route.ts
|
|
297
|
+
import { configureRedisCache } from "@/lib/cryptoquant-cache";
|
|
64
298
|
|
|
65
|
-
|
|
299
|
+
// Configure once at startup
|
|
300
|
+
await configureRedisCache();
|
|
66
301
|
|
|
302
|
+
export async function POST(req: Request) {
|
|
303
|
+
// ... your chat handler
|
|
304
|
+
}
|
|
67
305
|
```
|
|
68
|
-
|
|
306
|
+
|
|
307
|
+
### CacheStorage Interface
|
|
308
|
+
|
|
309
|
+
Implement this interface for custom storage backends:
|
|
310
|
+
|
|
311
|
+
```typescript
|
|
312
|
+
interface CacheStorage {
|
|
313
|
+
/** Storage type identifier */
|
|
314
|
+
readonly type: "file" | "redis" | "auto";
|
|
315
|
+
|
|
316
|
+
/** Read cache data, returns null if not found */
|
|
317
|
+
read(apiUrl: string, apiKeyPrefix?: string): Promise<DiscoveryCacheSchema | null> | DiscoveryCacheSchema | null;
|
|
318
|
+
|
|
319
|
+
/** Write cache data */
|
|
320
|
+
write(apiUrl: string, cache: DiscoveryCacheSchema): Promise<void> | void;
|
|
321
|
+
|
|
322
|
+
/** Delete cache for specific API URL */
|
|
323
|
+
invalidate(apiUrl: string, apiKeyPrefix?: string): Promise<void> | void;
|
|
324
|
+
|
|
325
|
+
/** Clear all caches */
|
|
326
|
+
clearAll(): Promise<void> | void;
|
|
327
|
+
|
|
328
|
+
/** Get storage path for display */
|
|
329
|
+
getPath(apiUrl: string): string;
|
|
330
|
+
}
|
|
69
331
|
```
|
|
70
332
|
|
|
71
|
-
|
|
333
|
+
See [examples/redis-cache/](examples/redis-cache/) for complete implementation.
|
|
334
|
+
|
|
335
|
+
---
|
|
336
|
+
|
|
337
|
+
## Reference
|
|
72
338
|
|
|
73
|
-
|
|
339
|
+
### Available Tools
|
|
74
340
|
|
|
75
341
|
| Tool | Description |
|
|
76
342
|
|------|-------------|
|
|
@@ -79,31 +345,34 @@ initialize(api_key='your-api-key')
|
|
|
79
345
|
| `get_endpoint_info` | Get endpoint parameter details |
|
|
80
346
|
| `query_data` | Query raw on-chain data |
|
|
81
347
|
| `describe_metric` | Get metric descriptions and thresholds |
|
|
82
|
-
| `list_assets` | List supported assets
|
|
348
|
+
| `list_assets` | List supported assets |
|
|
83
349
|
| `reset_session` | Clear session / switch accounts |
|
|
84
350
|
|
|
85
|
-
|
|
351
|
+
### Supported Assets
|
|
86
352
|
|
|
87
353
|
BTC, ETH, ALT, Stablecoin, ERC20, TRX, XRP
|
|
88
354
|
|
|
89
|
-
|
|
355
|
+
### Environment Variables
|
|
90
356
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
357
|
+
| Variable | Description | Default |
|
|
358
|
+
|----------|-------------|---------|
|
|
359
|
+
| `CRYPTOQUANT_API_KEY` | CryptoQuant API key | - |
|
|
360
|
+
| `ANTHROPIC_API_KEY` | Anthropic API key (AI SDK mode) | - |
|
|
361
|
+
| `MCP_TRANSPORT` | Transport mode (`stdio` / `http`) | `stdio` |
|
|
362
|
+
| `MCP_HTTP_PORT` | HTTP server port | `3100` |
|
|
363
|
+
| `MCP_HTTP_HOST` | HTTP server host | `0.0.0.0` |
|
|
364
|
+
| `MCP_CORS_ORIGINS` | CORS allowed origins | `*` |
|
|
365
|
+
| `DEBUG` | Enable debug logging | - |
|
|
98
366
|
|
|
99
|
-
|
|
367
|
+
### Requirements
|
|
100
368
|
|
|
101
369
|
- Node.js 18+
|
|
102
370
|
- CryptoQuant API key
|
|
371
|
+
- Anthropic API key (for AI SDK / HTTP mode)
|
|
103
372
|
|
|
104
373
|
## Links
|
|
105
374
|
|
|
106
|
-
- [
|
|
375
|
+
- [GitHub](https://github.com/CryptoQuantOfficial/cryptoquant-skills)
|
|
107
376
|
- [CryptoQuant](https://cryptoquant.com)
|
|
108
377
|
- [API Docs](https://docs.cryptoquant.com)
|
|
109
378
|
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool execution logic for CryptoQuant tools
|
|
3
|
+
* Shared between AI SDK integration and chat-proxy
|
|
4
|
+
*/
|
|
5
|
+
import type { DescribeMetricParams, DiscoverEndpointsParams, InitializeParams, MarketSummaryParams, QueryDataParams, TradingSignalParams, WhaleActivityParams } from "./schemas.js";
|
|
6
|
+
import type { DescribeResult, DiscoverResult, InitializeResult, MarketSummaryResult, QueryResult, TradingSignalResult, ToolExecutionContext, WhaleActivityResult } from "./types.js";
|
|
7
|
+
/**
|
|
8
|
+
* Execute initialize tool
|
|
9
|
+
*/
|
|
10
|
+
export declare function executeInitialize(params: InitializeParams, context: ToolExecutionContext): Promise<InitializeResult>;
|
|
11
|
+
/**
|
|
12
|
+
* Execute discover_endpoints tool
|
|
13
|
+
*/
|
|
14
|
+
export declare function executeDiscoverEndpoints(params: DiscoverEndpointsParams): Promise<DiscoverResult>;
|
|
15
|
+
/**
|
|
16
|
+
* Execute query_data tool
|
|
17
|
+
*/
|
|
18
|
+
export declare function executeQueryData(params: QueryDataParams, _context: ToolExecutionContext): Promise<QueryResult>;
|
|
19
|
+
/**
|
|
20
|
+
* Execute describe_metric tool
|
|
21
|
+
*/
|
|
22
|
+
export declare function executeDescribeMetric(params: DescribeMetricParams): Promise<DescribeResult>;
|
|
23
|
+
/**
|
|
24
|
+
* Execute market_summary tool
|
|
25
|
+
*/
|
|
26
|
+
export declare function executeMarketSummary(params: MarketSummaryParams, _context: ToolExecutionContext): Promise<MarketSummaryResult>;
|
|
27
|
+
/**
|
|
28
|
+
* Execute trading_signal tool
|
|
29
|
+
*/
|
|
30
|
+
export declare function executeTradingSignal(params: TradingSignalParams, _context: ToolExecutionContext): Promise<TradingSignalResult>;
|
|
31
|
+
/**
|
|
32
|
+
* Execute whale_activity tool
|
|
33
|
+
*/
|
|
34
|
+
export declare function executeWhaleActivity(params: WhaleActivityParams, _context: ToolExecutionContext): Promise<WhaleActivityResult>;
|
|
35
|
+
//# sourceMappingURL=execute.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execute.d.ts","sourceRoot":"","sources":["../../src/ai-sdk/execute.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAuBH,OAAO,KAAK,EACV,oBAAoB,EACpB,uBAAuB,EACvB,gBAAgB,EAChB,mBAAmB,EACnB,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACpB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EACV,cAAc,EACd,cAAc,EACd,gBAAgB,EAChB,mBAAmB,EACnB,WAAW,EACX,mBAAmB,EACnB,oBAAoB,EACpB,mBAAmB,EACpB,MAAM,YAAY,CAAC;AASpB;;GAEG;AACH,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,gBAAgB,EACxB,OAAO,EAAE,oBAAoB,GAC5B,OAAO,CAAC,gBAAgB,CAAC,CA8C3B;AAED;;GAEG;AACH,wBAAsB,wBAAwB,CAC5C,MAAM,EAAE,uBAAuB,GAC9B,OAAO,CAAC,cAAc,CAAC,CAoCzB;AAED;;GAEG;AACH,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,eAAe,EACvB,QAAQ,EAAE,oBAAoB,GAC7B,OAAO,CAAC,WAAW,CAAC,CAqHtB;AAED;;GAEG;AACH,wBAAsB,qBAAqB,CACzC,MAAM,EAAE,oBAAoB,GAC3B,OAAO,CAAC,cAAc,CAAC,CAgBzB;AAED;;GAEG;AACH,wBAAsB,oBAAoB,CACxC,MAAM,EAAE,mBAAmB,EAC3B,QAAQ,EAAE,oBAAoB,GAC7B,OAAO,CAAC,mBAAmB,CAAC,CA6F9B;AAED;;GAEG;AACH,wBAAsB,oBAAoB,CACxC,MAAM,EAAE,mBAAmB,EAC3B,QAAQ,EAAE,oBAAoB,GAC7B,OAAO,CAAC,mBAAmB,CAAC,CAuF9B;AAED;;GAEG;AACH,wBAAsB,oBAAoB,CACxC,MAAM,EAAE,mBAAmB,EAC3B,QAAQ,EAAE,oBAAoB,GAC7B,OAAO,CAAC,mBAAmB,CAAC,CA8G9B"}
|