z-zero-mcp-server 1.1.2 → 1.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/README.md +4 -0
- package/dist/index.js +55 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# OpenClaw: Z-ZERO AI Agent MCP Server
|
|
2
2
|
|
|
3
|
+
[](https://www.npmjs.com/package/z-zero-mcp-server)
|
|
4
|
+
[](../../LICENSE)
|
|
5
|
+
[](https://wdk.tether.to)
|
|
6
|
+
|
|
3
7
|
A Zero-Trust Payment Protocol built specifically for AI Agents using the [Model Context Protocol (MCP)](https://modelcontextprotocol.io). Give your local agents (Claude, Cursor, AntiGravity) the ability to make real-world purchases — securely, without ever seeing a real card number.
|
|
4
8
|
|
|
5
9
|
## How It Works
|
package/dist/index.js
CHANGED
|
@@ -304,6 +304,60 @@ server.tool("get_merchant_hints", "Fetch checkout hints for a specific domain fr
|
|
|
304
304
|
}
|
|
305
305
|
});
|
|
306
306
|
// ============================================================
|
|
307
|
+
// TOOL 4b: Report Checkout Fail (Self-Healing Feedback Loop)
|
|
308
|
+
// Agent calls this when a purchase task could not be completed.
|
|
309
|
+
// Logs the checkout URL for admin review → future hints creation.
|
|
310
|
+
// ============================================================
|
|
311
|
+
server.tool("report_checkout_fail", "Report a checkout URL that you could not complete. Call this when you failed to finish a purchase — for any reason (field not found, bot blocked, timeout, unknown form). The URL will be logged for admin review to improve future checkout success rates. This is part of Z-ZERO's self-healing loop.", {
|
|
312
|
+
url: zod_1.z
|
|
313
|
+
.string()
|
|
314
|
+
.url()
|
|
315
|
+
.describe("The checkout/payment page URL where the purchase failed."),
|
|
316
|
+
error_type: zod_1.z
|
|
317
|
+
.string()
|
|
318
|
+
.optional()
|
|
319
|
+
.describe("Short error category: 'field_not_found', 'timeout', 'bot_blocked', 'unknown_form', 'price_mismatch', or 'other'."),
|
|
320
|
+
error_message: zod_1.z
|
|
321
|
+
.string()
|
|
322
|
+
.optional()
|
|
323
|
+
.describe("Brief description of what went wrong, e.g. 'Could not find card number field' or 'Page redirected to CAPTCHA'."),
|
|
324
|
+
}, async ({ url, error_type, error_message }) => {
|
|
325
|
+
const ZZERO_API = process.env.Z_ZERO_API_BASE || "https://www.clawcard.store";
|
|
326
|
+
const INTERNAL_SECRET = process.env.Z_ZERO_INTERNAL_SECRET || "";
|
|
327
|
+
try {
|
|
328
|
+
const resp = await fetch(`${ZZERO_API}/api/checkout-hints`, {
|
|
329
|
+
method: "POST",
|
|
330
|
+
headers: {
|
|
331
|
+
"Content-Type": "application/json",
|
|
332
|
+
"x-internal-secret": INTERNAL_SECRET,
|
|
333
|
+
"x-mcp-version": version_js_2.CURRENT_MCP_VERSION,
|
|
334
|
+
},
|
|
335
|
+
body: JSON.stringify({
|
|
336
|
+
url,
|
|
337
|
+
error_type: error_type || "other",
|
|
338
|
+
error_message: error_message || null,
|
|
339
|
+
mcp_version: version_js_2.CURRENT_MCP_VERSION,
|
|
340
|
+
}),
|
|
341
|
+
});
|
|
342
|
+
const data = await resp.json();
|
|
343
|
+
return {
|
|
344
|
+
content: [{ type: "text", text: JSON.stringify({
|
|
345
|
+
reported: true,
|
|
346
|
+
message: "Checkout failure logged. An admin will review this URL to create or update hints for future agents. Thank you for contributing to the self-healing loop.",
|
|
347
|
+
...data,
|
|
348
|
+
}, null, 2) }],
|
|
349
|
+
};
|
|
350
|
+
}
|
|
351
|
+
catch (err) {
|
|
352
|
+
return {
|
|
353
|
+
content: [{ type: "text", text: JSON.stringify({
|
|
354
|
+
reported: false,
|
|
355
|
+
message: `Could not reach fail-report API: ${err?.message || "unknown error"}. Please inform the user manually.`,
|
|
356
|
+
}, null, 2) }],
|
|
357
|
+
};
|
|
358
|
+
}
|
|
359
|
+
});
|
|
360
|
+
// ============================================================
|
|
307
361
|
// TOOL 4b: Execute payment (The "Invisible Hand")
|
|
308
362
|
// ============================================================
|
|
309
363
|
server.tool("execute_payment", "Execute a payment using a temporary token. This tool will securely fill the checkout form on the target website. You will NEVER see the real card number - it is handled securely in the background.", {
|
|
@@ -400,6 +454,7 @@ server.tool("execute_payment", "Execute a payment using a temporary token. This
|
|
|
400
454
|
message: result.message || "Payment was declined by merchant.",
|
|
401
455
|
token_status: "ACTIVE",
|
|
402
456
|
note: "Token NOT burned. Funds will be refunded automatically via webhook within minutes.",
|
|
457
|
+
self_heal_hint: "If this failure was caused by the checkout form (wrong selector, unknown iframe, CAPTCHA, etc.), call report_checkout_fail(checkout_url) to help improve future checkouts. Do NOT report if the user cancelled or had insufficient balance.",
|
|
403
458
|
}, null, 2),
|
|
404
459
|
},
|
|
405
460
|
],
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const CURRENT_MCP_VERSION = "1.
|
|
1
|
+
export declare const CURRENT_MCP_VERSION = "1.2.0";
|
package/dist/version.js
CHANGED
|
@@ -3,4 +3,4 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.CURRENT_MCP_VERSION = void 0;
|
|
4
4
|
// Single source of truth for MCP version
|
|
5
5
|
// Imported by both index.ts and wdk_backend.ts to avoid circular dependency
|
|
6
|
-
exports.CURRENT_MCP_VERSION = "1.
|
|
6
|
+
exports.CURRENT_MCP_VERSION = "1.2.0";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "z-zero-mcp-server",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.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",
|