crypto-market-data-mcp 0.1.0 → 0.1.1

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 CHANGED
@@ -21,6 +21,10 @@ Data refreshes every minute from 24/7 monitoring of Binance spot and futures, Hy
21
21
 
22
22
  ## Install
23
23
 
24
+ Claude Desktop, one click: download
25
+ [crypto-market-data.mcpb](https://github.com/zaffy18/crypto-market-data-mcp/releases/latest/download/crypto-market-data.mcpb)
26
+ and open it. The wallet key is optional and is stored in your system keychain.
27
+
24
28
  Claude Code:
25
29
 
26
30
  ```
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
- const maxPerCall = Math.round(Number(process.env.X402_MAX_PER_CALL_USD || "0.01") * USDC_UNITS);
21
- const maxTotal = Math.round(Number(process.env.X402_MAX_TOTAL_USD || "1.00") * USDC_UNITS);
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.0" });
68
+ const server = new McpServer({ name: "crypto-market-data", version: "0.1.1" });
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.0",
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.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
+ }
package/server.json CHANGED
@@ -1,31 +1,41 @@
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
- "version": "0.1.0",
7
- "packages": [
8
- {
9
- "registryType": "npm",
10
- "identifier": "crypto-market-data-mcp",
11
- "version": "0.1.0",
12
- "transport": {
13
- "type": "stdio"
14
- },
15
- "environmentVariables": [
16
- {
17
- "name": "X402_PRIVATE_KEY",
18
- "description": "Key of a wallet holding a little USDC on Base, used to pay per call",
19
- "isRequired": false,
20
- "isSecret": true
21
- },
22
- {
23
- "name": "X402_MAX_TOTAL_USD",
24
- "description": "Stop paying after this much per session (default 1.00)",
25
- "isRequired": false,
26
- "isSecret": false
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.1",
11
+ "packages": [
12
+ {
13
+ "registryType": "npm",
14
+ "identifier": "crypto-market-data-mcp",
15
+ "version": "0.1.1",
16
+ "transport": {
17
+ "type": "stdio"
18
+ },
19
+ "environmentVariables": [
20
+ {
21
+ "name": "X402_PRIVATE_KEY",
22
+ "description": "Key of a wallet holding a little USDC on Base, used to pay per call",
23
+ "isRequired": false,
24
+ "isSecret": true
25
+ },
26
+ {
27
+ "name": "X402_MAX_PER_CALL_USD",
28
+ "description": "No single payment above this (default 0.01)",
29
+ "isRequired": false,
30
+ "isSecret": false
31
+ },
32
+ {
33
+ "name": "X402_MAX_TOTAL_USD",
34
+ "description": "Stop paying after this much per session (default 1.00)",
35
+ "isRequired": false,
36
+ "isSecret": false
37
+ }
38
+ ]
39
+ }
40
+ ]
41
+ }