cryptoquant-mcp 0.2.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/LICENSE +21 -0
- package/README.md +183 -0
- package/dist/auth/storage.d.ts +11 -0
- package/dist/auth/storage.d.ts.map +1 -0
- package/dist/auth/storage.js +53 -0
- package/dist/auth/storage.js.map +1 -0
- package/dist/cache/storage.d.ts +47 -0
- package/dist/cache/storage.d.ts.map +1 -0
- package/dist/cache/storage.js +140 -0
- package/dist/cache/storage.js.map +1 -0
- package/dist/cache/summary.d.ts +16 -0
- package/dist/cache/summary.d.ts.map +1 -0
- package/dist/cache/summary.js +85 -0
- package/dist/cache/summary.js.map +1 -0
- package/dist/cache/types.d.ts +76 -0
- package/dist/cache/types.d.ts.map +1 -0
- package/dist/cache/types.js +6 -0
- package/dist/cache/types.js.map +1 -0
- package/dist/config.d.ts +18 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +23 -0
- package/dist/config.js.map +1 -0
- package/dist/data/metrics.toon +293 -0
- package/dist/discovery.d.ts +70 -0
- package/dist/discovery.d.ts.map +1 -0
- package/dist/discovery.js +171 -0
- package/dist/discovery.js.map +1 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +47 -0
- package/dist/index.js.map +1 -0
- package/dist/permissions.d.ts +36 -0
- package/dist/permissions.d.ts.map +1 -0
- package/dist/permissions.js +159 -0
- package/dist/permissions.js.map +1 -0
- package/dist/plan-limits.d.ts +71 -0
- package/dist/plan-limits.d.ts.map +1 -0
- package/dist/plan-limits.js +416 -0
- package/dist/plan-limits.js.map +1 -0
- package/dist/tools/auth.d.ts +3 -0
- package/dist/tools/auth.d.ts.map +1 -0
- package/dist/tools/auth.js +196 -0
- package/dist/tools/auth.js.map +1 -0
- package/dist/tools/core.d.ts +3 -0
- package/dist/tools/core.d.ts.map +1 -0
- package/dist/tools/core.js +546 -0
- package/dist/tools/core.js.map +1 -0
- package/dist/utils.d.ts +45 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +76 -0
- package/dist/utils.js.map +1 -0
- package/package.json +66 -0
package/dist/utils.js
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared utility functions for CryptoQuant MCP Server
|
|
3
|
+
*/
|
|
4
|
+
// =============================================================================
|
|
5
|
+
// Logger - Debug logging controlled by DEBUG environment variable
|
|
6
|
+
// =============================================================================
|
|
7
|
+
/**
|
|
8
|
+
* Check if debug logging is enabled.
|
|
9
|
+
* Set DEBUG=true or DEBUG=1 to enable debug output.
|
|
10
|
+
*/
|
|
11
|
+
function isDebugEnabled() {
|
|
12
|
+
const debug = process.env.DEBUG;
|
|
13
|
+
return debug === "true" || debug === "1";
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Logger with level-based output.
|
|
17
|
+
* - debug: Only shown when DEBUG=true (use for detailed tracing)
|
|
18
|
+
* - info: Always shown (use for important status messages)
|
|
19
|
+
* - warn: Always shown (use for warnings)
|
|
20
|
+
* - error: Always shown (use for errors)
|
|
21
|
+
*/
|
|
22
|
+
export const logger = {
|
|
23
|
+
debug: (...args) => {
|
|
24
|
+
if (isDebugEnabled()) {
|
|
25
|
+
console.error("[DEBUG]", ...args);
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
info: (...args) => {
|
|
29
|
+
console.error("[INFO]", ...args);
|
|
30
|
+
},
|
|
31
|
+
warn: (...args) => {
|
|
32
|
+
console.error("[WARN]", ...args);
|
|
33
|
+
},
|
|
34
|
+
error: (...args) => {
|
|
35
|
+
console.error("[ERROR]", ...args);
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* Create a JSON response for MCP tools.
|
|
40
|
+
*/
|
|
41
|
+
export function jsonResponse(data) {
|
|
42
|
+
return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Create an error response for MCP tools.
|
|
46
|
+
*/
|
|
47
|
+
export function errorResponse(error, extra) {
|
|
48
|
+
return jsonResponse({ success: false, error, ...extra });
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Get a human-readable note for a plan type.
|
|
52
|
+
* Plan hierarchy: basic < advanced < professional < premium < custom
|
|
53
|
+
*/
|
|
54
|
+
export function getPlanNote(plan) {
|
|
55
|
+
switch (plan) {
|
|
56
|
+
case "custom":
|
|
57
|
+
return "Custom enterprise plan with tailored access";
|
|
58
|
+
case "premium":
|
|
59
|
+
return "Full access to all data";
|
|
60
|
+
case "professional":
|
|
61
|
+
return "3-year data history limit on most endpoints";
|
|
62
|
+
case "advanced":
|
|
63
|
+
return "Extended endpoint access with some data limits";
|
|
64
|
+
case "basic":
|
|
65
|
+
return "Limited endpoint access. Upgrade for more data.";
|
|
66
|
+
default:
|
|
67
|
+
return "Plan not detected";
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Capitalize the first letter of a string.
|
|
72
|
+
*/
|
|
73
|
+
export function capitalizeFirst(str) {
|
|
74
|
+
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
75
|
+
}
|
|
76
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,gFAAgF;AAChF,kEAAkE;AAClE,gFAAgF;AAEhF;;;GAGG;AACH,SAAS,cAAc;IACrB,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC;IAChC,OAAO,KAAK,KAAK,MAAM,IAAI,KAAK,KAAK,GAAG,CAAC;AAC3C,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,KAAK,EAAE,CAAC,GAAG,IAAe,EAAE,EAAE;QAC5B,IAAI,cAAc,EAAE,EAA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AACH,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,eAAe,CAAC,GAAW;IACzC,OAAO,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AACpD,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "cryptoquant-mcp",
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "CryptoQuant MCP Server - On-chain analytics for Claude and AI coding agents",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"bin": {
|
|
9
|
+
"cryptoquant-mcp": "dist/index.js"
|
|
10
|
+
},
|
|
11
|
+
"files": [
|
|
12
|
+
"dist"
|
|
13
|
+
],
|
|
14
|
+
"scripts": {
|
|
15
|
+
"build": "tsc && cp -r src/data dist/",
|
|
16
|
+
"start": "node dist/index.js",
|
|
17
|
+
"dev": "tsx watch src/index.ts",
|
|
18
|
+
"lint": "eslint src/",
|
|
19
|
+
"test": "vitest",
|
|
20
|
+
"prepare": "husky",
|
|
21
|
+
"prepublishOnly": "npm run build"
|
|
22
|
+
},
|
|
23
|
+
"keywords": [
|
|
24
|
+
"cryptoquant",
|
|
25
|
+
"mcp",
|
|
26
|
+
"model-context-protocol",
|
|
27
|
+
"claude",
|
|
28
|
+
"claude-code",
|
|
29
|
+
"on-chain",
|
|
30
|
+
"bitcoin",
|
|
31
|
+
"ethereum",
|
|
32
|
+
"crypto",
|
|
33
|
+
"analytics",
|
|
34
|
+
"ai-agent"
|
|
35
|
+
],
|
|
36
|
+
"author": "CryptoQuant",
|
|
37
|
+
"license": "MIT",
|
|
38
|
+
"repository": {
|
|
39
|
+
"type": "git",
|
|
40
|
+
"url": "git+https://github.com/CryptoQuantOfficial/cryptoquant-mcp.git"
|
|
41
|
+
},
|
|
42
|
+
"homepage": "https://github.com/CryptoQuantOfficial/cryptoquant-mcp#readme",
|
|
43
|
+
"bugs": {
|
|
44
|
+
"url": "https://github.com/CryptoQuantOfficial/cryptoquant-mcp/issues"
|
|
45
|
+
},
|
|
46
|
+
"publishConfig": {
|
|
47
|
+
"access": "public"
|
|
48
|
+
},
|
|
49
|
+
"dependencies": {
|
|
50
|
+
"@modelcontextprotocol/sdk": "^1.0.0",
|
|
51
|
+
"zod": "^3.23.0"
|
|
52
|
+
},
|
|
53
|
+
"devDependencies": {
|
|
54
|
+
"@eslint/js": "^9.39.2",
|
|
55
|
+
"@types/node": "^20.0.0",
|
|
56
|
+
"eslint": "^9.0.0",
|
|
57
|
+
"husky": "^9.0.0",
|
|
58
|
+
"tsx": "^4.0.0",
|
|
59
|
+
"typescript": "^5.5.0",
|
|
60
|
+
"typescript-eslint": "^8.54.0",
|
|
61
|
+
"vitest": "^2.0.0"
|
|
62
|
+
},
|
|
63
|
+
"engines": {
|
|
64
|
+
"node": ">=18.0.0"
|
|
65
|
+
}
|
|
66
|
+
}
|