crypto-market-data-mcp 0.1.0 → 0.1.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.
- package/README.md +12 -0
- package/index.js +9 -5
- package/package.json +44 -44
- package/server.json +47 -31
package/README.md
CHANGED
|
@@ -19,8 +19,20 @@ subscription, and a call that fails is never charged.
|
|
|
19
19
|
|
|
20
20
|
Data refreshes every minute from 24/7 monitoring of Binance spot and futures, Hyperliquid and 31 news sources.
|
|
21
21
|
|
|
22
|
+
## Connect without installing
|
|
23
|
+
|
|
24
|
+
Remote MCP server (Streamable HTTP, no sign-up): `https://crypto-market-data.zafermemon87.workers.dev/mcp`
|
|
25
|
+
|
|
26
|
+
Add it as a custom connector or remote server in Claude, ChatGPT, Cursor, VS Code or any MCP client. `prices_free`,
|
|
27
|
+
`sentiment_free` and `service_info` are free. The other tools are paid per call with x402 over MCP, and clients built
|
|
28
|
+
with [`@x402/mcp`](https://www.npmjs.com/package/@x402/mcp) pay automatically.
|
|
29
|
+
|
|
22
30
|
## Install
|
|
23
31
|
|
|
32
|
+
Claude Desktop, one click: download
|
|
33
|
+
[crypto-market-data.mcpb](https://github.com/zaffy18/crypto-market-data-mcp/releases/latest/download/crypto-market-data.mcpb)
|
|
34
|
+
and open it. The wallet key is optional and is stored in your system keychain.
|
|
35
|
+
|
|
24
36
|
Claude Code:
|
|
25
37
|
|
|
26
38
|
```
|
package/index.js
CHANGED
|
@@ -17,8 +17,12 @@ import { registerExactEvmScheme } from "@x402/evm/exact/client";
|
|
|
17
17
|
const API = (process.env.CMD_API_URL || "https://crypto-market-data.zafermemon87.workers.dev").replace(/\/$/, "");
|
|
18
18
|
const USDC_UNITS = 1e6;
|
|
19
19
|
const FREE = { "/v1/prices": "/free/prices", "/v1/sentiment": "/free/sentiment" }; // free, 15-minute copies
|
|
20
|
-
|
|
21
|
-
const
|
|
20
|
+
function cap(name, dflt) {
|
|
21
|
+
const v = Number((process.env[name] || "").trim() || dflt);
|
|
22
|
+
return Number.isFinite(v) && v >= 0 ? Math.round(v * USDC_UNITS) : 0; // an unreadable cap pays nothing, never "no limit"
|
|
23
|
+
}
|
|
24
|
+
const maxPerCall = cap("X402_MAX_PER_CALL_USD", "0.01");
|
|
25
|
+
const maxTotal = cap("X402_MAX_TOTAL_USD", "1.00");
|
|
22
26
|
let spent = 0;
|
|
23
27
|
|
|
24
28
|
let payer = null;
|
|
@@ -51,8 +55,8 @@ async function call(path, query) {
|
|
|
51
55
|
"holding a little USDC on Base (no ETH needed), or use the same data on Apify: https://apify.com/zaffy_93/crypto-market-data");
|
|
52
56
|
const required = pay.getPaymentRequiredResponse((n) => first.headers.get(n), await first.json().catch(() => undefined));
|
|
53
57
|
const amount = Number(required.accepts[0].amount);
|
|
54
|
-
if (amount > maxPerCall) return fail(`Price ${amount / USDC_UNITS} USDC is above X402_MAX_PER_CALL_USD; not paid.`);
|
|
55
|
-
if (spent + amount > maxTotal) return fail(`Session budget X402_MAX_TOTAL_USD reached (${spent / USDC_UNITS} USDC spent); not paid.`);
|
|
58
|
+
if (!(amount > 0) || amount > maxPerCall) return fail(`Price ${amount / USDC_UNITS} USDC is above X402_MAX_PER_CALL_USD (${maxPerCall / USDC_UNITS}); not paid.`);
|
|
59
|
+
if (spent + amount > maxTotal) return fail(`Session budget X402_MAX_TOTAL_USD (${maxTotal / USDC_UNITS}) reached (${spent / USDC_UNITS} USDC spent); not paid.`);
|
|
56
60
|
const payload = await pay.createPaymentPayload(required);
|
|
57
61
|
const paid = await fetch(url, { headers: pay.encodePaymentSignatureHeader(payload) });
|
|
58
62
|
const body = await paid.json().catch(() => ({}));
|
|
@@ -61,7 +65,7 @@ async function call(path, query) {
|
|
|
61
65
|
return paid.ok ? text(body) : fail(`Not answered (${paid.status}), not charged: ${body.error || JSON.stringify(body)}`);
|
|
62
66
|
}
|
|
63
67
|
|
|
64
|
-
const server = new McpServer({ name: "crypto-market-data", version: "0.1.
|
|
68
|
+
const server = new McpServer({ name: "crypto-market-data", version: "0.1.2" });
|
|
65
69
|
const tokens = z.string().optional().describe("Comma-separated tickers such as BTC,ETH,SOL (up to 50). Empty means the top 50 coins.");
|
|
66
70
|
const token = z.string().optional().describe("One ticker such as BTC");
|
|
67
71
|
const limit = z.number().int().min(1).max(200).optional().describe("How many rows");
|
package/package.json
CHANGED
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "crypto-market-data-mcp",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"type": "module",
|
|
5
|
-
"dependencies": {
|
|
6
|
-
"@modelcontextprotocol/sdk": "1.32.1",
|
|
7
|
-
"@x402/core": "2.28.0",
|
|
8
|
-
"@x402/evm": "2.28.0",
|
|
9
|
-
"viem": "2.57.4",
|
|
10
|
-
"zod": "4.6.5"
|
|
11
|
-
},
|
|
12
|
-
"description": "Live crypto market data and Hyperliquid wallet reports as MCP tools, paid per call with x402 (USDC on Base).",
|
|
13
|
-
"bin": {
|
|
14
|
-
"crypto-market-data-mcp": "index.js"
|
|
15
|
-
},
|
|
16
|
-
"files": [
|
|
17
|
-
"index.js",
|
|
18
|
-
"README.md",
|
|
19
|
-
"server.json",
|
|
20
|
-
"LICENSE"
|
|
21
|
-
],
|
|
22
|
-
"keywords": [
|
|
23
|
-
"mcp",
|
|
24
|
-
"mcp-server",
|
|
25
|
-
"x402",
|
|
26
|
-
"crypto",
|
|
27
|
-
"market-data",
|
|
28
|
-
"hyperliquid",
|
|
29
|
-
"binance",
|
|
30
|
-
"liquidations",
|
|
31
|
-
"whales",
|
|
32
|
-
"ai-agents"
|
|
33
|
-
],
|
|
34
|
-
"license": "MIT",
|
|
35
|
-
"engines": {
|
|
36
|
-
"node": "\u003e=18"
|
|
37
|
-
},
|
|
38
|
-
"mcpName": "io.github.zaffy18/crypto-market-data",
|
|
39
|
-
"repository": {
|
|
40
|
-
"type": "git",
|
|
41
|
-
"url": "git+https://github.com/zaffy18/crypto-market-data-mcp.git"
|
|
42
|
-
},
|
|
43
|
-
"homepage": "https://github.com/zaffy18/crypto-market-data-mcp#readme"
|
|
44
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "crypto-market-data-mcp",
|
|
3
|
+
"version": "0.1.2",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"dependencies": {
|
|
6
|
+
"@modelcontextprotocol/sdk": "1.32.1",
|
|
7
|
+
"@x402/core": "2.28.0",
|
|
8
|
+
"@x402/evm": "2.28.0",
|
|
9
|
+
"viem": "2.57.4",
|
|
10
|
+
"zod": "4.6.5"
|
|
11
|
+
},
|
|
12
|
+
"description": "Live crypto market data and Hyperliquid wallet reports as MCP tools, paid per call with x402 (USDC on Base).",
|
|
13
|
+
"bin": {
|
|
14
|
+
"crypto-market-data-mcp": "index.js"
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"index.js",
|
|
18
|
+
"README.md",
|
|
19
|
+
"server.json",
|
|
20
|
+
"LICENSE"
|
|
21
|
+
],
|
|
22
|
+
"keywords": [
|
|
23
|
+
"mcp",
|
|
24
|
+
"mcp-server",
|
|
25
|
+
"x402",
|
|
26
|
+
"crypto",
|
|
27
|
+
"market-data",
|
|
28
|
+
"hyperliquid",
|
|
29
|
+
"binance",
|
|
30
|
+
"liquidations",
|
|
31
|
+
"whales",
|
|
32
|
+
"ai-agents"
|
|
33
|
+
],
|
|
34
|
+
"license": "MIT",
|
|
35
|
+
"engines": {
|
|
36
|
+
"node": "\u003e=18"
|
|
37
|
+
},
|
|
38
|
+
"mcpName": "io.github.zaffy18/crypto-market-data",
|
|
39
|
+
"repository": {
|
|
40
|
+
"type": "git",
|
|
41
|
+
"url": "git+https://github.com/zaffy18/crypto-market-data-mcp.git"
|
|
42
|
+
},
|
|
43
|
+
"homepage": "https://github.com/zaffy18/crypto-market-data-mcp#readme"
|
|
44
|
+
}
|
package/server.json
CHANGED
|
@@ -1,31 +1,47 @@
|
|
|
1
|
-
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
"
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
|
|
3
|
+
"name": "io.github.zaffy18/crypto-market-data",
|
|
4
|
+
"title": "Crypto Market Data",
|
|
5
|
+
"description": "Live crypto market data and Hyperliquid wallet reports for AI agents, paid per call with x402.",
|
|
6
|
+
"repository": {
|
|
7
|
+
"url": "https://github.com/zaffy18/crypto-market-data-mcp",
|
|
8
|
+
"source": "github"
|
|
9
|
+
},
|
|
10
|
+
"version": "0.1.2",
|
|
11
|
+
"remotes": [
|
|
12
|
+
{
|
|
13
|
+
"type": "streamable-http",
|
|
14
|
+
"url": "https://crypto-market-data.zafermemon87.workers.dev/mcp"
|
|
15
|
+
}
|
|
16
|
+
],
|
|
17
|
+
"packages": [
|
|
18
|
+
{
|
|
19
|
+
"registryType": "npm",
|
|
20
|
+
"identifier": "crypto-market-data-mcp",
|
|
21
|
+
"version": "0.1.2",
|
|
22
|
+
"transport": {
|
|
23
|
+
"type": "stdio"
|
|
24
|
+
},
|
|
25
|
+
"environmentVariables": [
|
|
26
|
+
{
|
|
27
|
+
"name": "X402_PRIVATE_KEY",
|
|
28
|
+
"description": "Key of a wallet holding a little USDC on Base, used to pay per call",
|
|
29
|
+
"isRequired": false,
|
|
30
|
+
"isSecret": true
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"name": "X402_MAX_PER_CALL_USD",
|
|
34
|
+
"description": "No single payment above this (default 0.01)",
|
|
35
|
+
"isRequired": false,
|
|
36
|
+
"isSecret": false
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"name": "X402_MAX_TOTAL_USD",
|
|
40
|
+
"description": "Stop paying after this much per session (default 1.00)",
|
|
41
|
+
"isRequired": false,
|
|
42
|
+
"isSecret": false
|
|
43
|
+
}
|
|
44
|
+
]
|
|
45
|
+
}
|
|
46
|
+
]
|
|
47
|
+
}
|