z-zero-mcp-server 1.0.9 → 1.1.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.
Files changed (2) hide show
  1. package/dist/index.js +45 -0
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -38,6 +38,8 @@ var __importStar = (this && this.__importStar) || (function () {
38
38
  };
39
39
  })();
40
40
  Object.defineProperty(exports, "__esModule", { value: true });
41
+ const CURRENT_MCP_VERSION = "1.1.0"; // ← bump this on every release
42
+ const ZZERO_VERSION_API = "https://www.clawcard.store/api/version";
41
43
  const mcp_js_1 = require("@modelcontextprotocol/sdk/server/mcp.js");
42
44
  const stdio_js_1 = require("@modelcontextprotocol/sdk/server/stdio.js");
43
45
  const zod_1 = require("zod");
@@ -493,6 +495,49 @@ server.tool("request_human_approval", "Request human approval before proceeding
493
495
  };
494
496
  });
495
497
  // ============================================================
498
+ // TOOL 6.4: Check for Updates (polls clawcard.store, not npm)
499
+ // ============================================================
500
+ server.tool("check_for_updates", "Check if a newer version of this MCP server is available. Polls clawcard.store/api/version — independent of npm so works even if distribution changes. Call this when: (1) user asks if MCP is up to date, (2) a payment fails and you want to rule out a stale MCP version.", {}, async () => {
501
+ try {
502
+ const res = await fetch(ZZERO_VERSION_API, {
503
+ headers: { "User-Agent": `z-zero-mcp/${CURRENT_MCP_VERSION}` },
504
+ signal: AbortSignal.timeout(8_000),
505
+ });
506
+ if (!res.ok)
507
+ throw new Error(`HTTP ${res.status}`);
508
+ const data = await res.json();
509
+ const latest = data.latest_version;
510
+ const isUpToDate = CURRENT_MCP_VERSION === latest;
511
+ return {
512
+ content: [{
513
+ type: "text",
514
+ text: JSON.stringify({
515
+ current_version: CURRENT_MCP_VERSION,
516
+ latest_version: latest,
517
+ up_to_date: isUpToDate,
518
+ status: isUpToDate ? "✅ You are on the latest version." : `⚠️ Update available: ${CURRENT_MCP_VERSION} → ${latest}`,
519
+ release_notes: isUpToDate ? null : data.release_notes,
520
+ how_to_update: isUpToDate ? null : data.update_instructions,
521
+ }, null, 2),
522
+ }],
523
+ };
524
+ }
525
+ catch (err) {
526
+ return {
527
+ content: [{
528
+ type: "text",
529
+ text: JSON.stringify({
530
+ current_version: CURRENT_MCP_VERSION,
531
+ status: "⚠️ Could not reach version server. Check your internet connection.",
532
+ error: err.message,
533
+ fallback_check: `Visit https://www.clawcard.store to see latest version.`,
534
+ }, null, 2),
535
+ }],
536
+ isError: true,
537
+ };
538
+ }
539
+ });
540
+ // ============================================================
496
541
  // TOOL 6.5: Set API Key (Hot-Swap Passport Key — NO restart needed)
497
542
  // ============================================================
498
543
  server.tool("set_api_key", "Update the Z-ZERO Passport Key immediately WITHOUT restarting the AI tool. Call this when the human provides a new key (e.g. 'zk_live_xxxxx'). The key is validated and activated instantly for all subsequent API calls. IMPORTANT: Never ask for the key proactively — only call this when the human explicitly provides it.", {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "z-zero-mcp-server",
3
- "version": "1.0.9",
3
+ "version": "1.1.0",
4
4
  "description": "Z-ZERO MCP Server — Secure JIT Virtual Card Payment tools for AI Agents (Claude, Cursor, AutoGPT) — Real Single-Use Visa Cards",
5
5
  "main": "dist/index.js",
6
6
  "bin": "dist/index.js",