z-zero-mcp-server 1.3.1 → 1.3.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Z-Zero
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,12 +1,30 @@
1
- # OpenClaw: Z-ZERO AI Agent MCP Server
1
+ # Z-ZERO MCP — Payment Infrastructure for Agentic Commerce (USDC on Base, gasless)
2
2
 
3
- A Zero-Trust Payment Protocol built for AI Agents using the [Model Context Protocol (MCP)](https://modelcontextprotocol.io). Give your agents (Claude, Cursor, Antigravity) the ability to make real-world purchases — securely, without ever seeing a real card number.
3
+ [![MCP Badge](https://lobehub.com/badge/mcp/dempty-glitch-z-zero-mcp)](https://lobehub.com/mcp/dempty-glitch-z-zero-mcp)
4
+ [![npm](https://img.shields.io/npm/v/z-zero-mcp-server)](https://www.npmjs.com/package/z-zero-mcp-server)
5
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
6
+
7
+ **AI Agents today can plan, reason, and code — but they are financially blind.** They cannot hold money, make payments, or prove their trustworthiness. Every purchase still requires a human to copy-paste a credit card number.
8
+
9
+ Z-ZERO fixes that. One MCP server gives your agent (Claude, Cursor, any MCP-compatible client) two payment rails — **gasless USDC on Base** for crypto-native checkouts, and **JIT single-use virtual cards** for the 99% of the web that only takes cards — while the model **never sees a real card number**.
10
+
11
+ ```bash
12
+ npx z-zero-mcp-server
13
+ ```
4
14
 
5
15
  **What makes it different:**
6
- - 🔐 **Zero-trust** — AI never sees PAN, CVV, or expiry. Card data exists only in RAM, injected via Playwright, then wiped.
7
- - 🌐 **Web3 + Fiat** — Auto-detects crypto checkout (EIP-681) and routes to a gasless USDC transfer on Base (Coinbase Paymaster). Falls back to JIT Visa for fiat.
8
- - 🧠 **Smart Routing** — Cloud Knowledge Base (`get_merchant_hints`) provides platform-specific checkout playbooks for Shopify, Etsy, WooCommerce, and more.
9
- - 🔄 **Self-Healing** — Failed checkouts are logged via `report_checkout_fail` for admin review, improving future success rates.
16
+ - 🔐 **Zero-trust by design** — the AI never sees PAN, CVV, or expiry. Card data exists only in RAM, injected via Playwright at the last step, then wiped.
17
+ - ⛽ **Gasless USDC on Base** — auto-detects crypto checkout (EIP-681) and settles as a gasless USDC transfer sponsored by Coinbase Paymaster. The agent holds only USDC — no ETH, no gas UX.
18
+ - 💳 **JIT single-use virtual cards** — amount-locked, 1-hour TTL, burned after a single use. Fiat fallback for the rest of the web.
19
+ - 🧠 **Smart Routing + checkout intelligence** — `get_merchant_hints` serves platform-specific checkout playbooks (Shopify, Etsy, WooCommerce…).
20
+ - 🔄 **Self-healing network** — every failed checkout is logged via `report_checkout_fail` and feeds back into the hints database. The system doesn't just retry; it evolves.
21
+
22
+ ---
23
+
24
+ ## Live on Base Mainnet
25
+
26
+ - ✅ Proof — real gasless USDC transfer on Base mainnet: [`0xdfd1f2f8…5d7a`](https://basescan.org/tx/0xdfd1f2f824e1232c3e03c52485332570ff01fbb0340c5571f699ed1218735d7a)
27
+ - Onboarding is just "deposit USDC" — no seed phrases in the agent, no native gas token, no exchange account.
10
28
 
11
29
  ---
12
30
 
@@ -46,6 +64,22 @@ A Zero-Trust Payment Protocol built for AI Agents using the [Model Context Proto
46
64
 
47
65
  *The AI agent never touches card data — it only handles single-use tokens. Real card details are injected by Playwright at the last step and wiped from RAM.*
48
66
 
67
+ > **Crypto checkout branch:** when `auto_pay_checkout` detects a crypto-native checkout (EIP-681), it skips the card flow entirely and settles as a **gasless USDC transfer on Base** — see above.
68
+
69
+ ---
70
+
71
+ ## Why Z-ZERO
72
+
73
+ Z-ZERO is not a checkout bot — it's payment infrastructure for the agentic-commerce era (agentic transactions are projected to reach **$1.5T by 2030** — Juniper Research).
74
+
75
+ **Today**, the web is built for humans: agents must fill forms and click buttons, and every purchase still needs a human's card. Z-ZERO solves that now — JIT single-use virtual cards + gasless USDC on Base, with card data isolated from the model. **Tomorrow**, agent payments become a standardized protocol — and what we build along the way is the long-term value:
76
+
77
+ - **Shared checkout intelligence** — every transaction (and every failure) makes the network smarter.
78
+ - **An open standard for agent payments** — any agent platform plugs in via MCP; any rail (cards, USDC, x402) can be added.
79
+ - **KYA — Know Your Agent** — verifiable agent reputation. The question isn't "can this agent pay?" but "should you trust it to?"
80
+
81
+ 📖 Full vision & architecture: [The Z-Zero Whitebook](https://www.clawcard.store/whitebook)
82
+
49
83
  ---
50
84
 
51
85
  ## Quick Install (Recommended)
@@ -59,7 +93,7 @@ Add to your Claude Desktop config (`~/Library/Application Support/Claude/claude_
59
93
  ```json
60
94
  {
61
95
  "mcpServers": {
62
- "openclaw": {
96
+ "z-zero": {
63
97
  "command": "npx",
64
98
  "args": ["-y", "z-zero-mcp-server@latest"],
65
99
  "env": {
@@ -97,7 +131,7 @@ Get your Passport Key at: **[clawcard.store/dashboard/agents](https://www.clawca
97
131
 
98
132
  | Tool | Description |
99
133
  |------|-------------|
100
- | `request_payment_token` | Issue a JIT single-use Visa token for a specific amount (1hr TTL) |
134
+ | `request_payment_token` | Issue a JIT single-use virtual-card token for a specific amount (1hr TTL) |
101
135
  | `execute_payment` | Auto-fill checkout form using a payment token via Playwright |
102
136
  | `cancel_payment_token` | Cancel an unused token and refund to wallet |
103
137
  | `request_human_approval` | Pause and request human confirmation before proceeding |
@@ -161,4 +195,4 @@ Cancel an unused token (refunds balance).
161
195
 
162
196
  ---
163
197
 
164
- *Security: OpenClaw never stores your Passport Key. It is passed via environment variables and card data exists only in volatile RAM during execution.*
198
+ *Security: Z-Zero never stores your Passport Key. It is passed via environment variables and card data exists only in volatile RAM during execution.*
package/dist/index.js CHANGED
@@ -736,8 +736,19 @@ server.tool("auto_pay_checkout", "⚠️ MANDATORY: Read mcp://resources/sop fir
736
736
  isError: true,
737
737
  };
738
738
  }
739
- // Issue Token
740
- const token = await issueTokenRemote(card_alias, totalPrice, checkout_url);
739
+ // FX buffer: over-provision the JIT card limit so a non-USD checkout
740
+ // (FX-converted + fee on our USD card) doesn't drift over the limit and
741
+ // get declined. USD totals are final → tiny rounding buffer only. Any
742
+ // unspent buffer is auto-refunded on-chain when the charge settles.
743
+ const currency = await (0, extract_total_price_js_1.detectCheckoutCurrency)(page);
744
+ const bufferPct = currency === 'NON_USD' ? 0.05 : 0.02;
745
+ let issueAmount = Math.round(totalPrice * (1 + bufferPct) * 100) / 100;
746
+ // Never exceed the per-tx cap; merchant charges <= totalPrice <= cap anyway.
747
+ if (issueAmount > AUTO_PAY_MAX_USD)
748
+ issueAmount = AUTO_PAY_MAX_USD;
749
+ console.error(`[SMART ROUTE] FX buffer: ${currency}, limit $${totalPrice} → $${issueAmount} (+${Math.round(bufferPct * 100)}%)`);
750
+ // Issue Token (card limit = buffered amount)
751
+ const token = await issueTokenRemote(card_alias, issueAmount, checkout_url);
741
752
  if (!token || token.error)
742
753
  throw new Error(token?.message || "Token issue failed");
743
754
  // Resolve Card Data
@@ -762,8 +773,12 @@ server.tool("auto_pay_checkout", "⚠️ MANDATORY: Read mcp://resources/sop fir
762
773
  route: "FIAT",
763
774
  status: fillResult.success ? "SUCCESS" : (fillResult.status || "FILL_FAILED").toUpperCase(),
764
775
  detected_price: totalPrice,
776
+ authorized_amount: issueAmount,
777
+ fx_buffer: issueAmount > totalPrice
778
+ ? `Locked $${issueAmount} = $${totalPrice} + ${Math.round(bufferPct * 100)}% ${currency === 'NON_USD' ? 'FX' : 'rounding'} buffer; unspent buffer auto-refunds after the charge settles.`
779
+ : undefined,
765
780
  message: fillResult.success
766
- ? `✅ Confirmed: JIT card issued for $${totalPrice} and order confirmed by merchant.`
781
+ ? `✅ Confirmed: JIT card issued (limit $${issueAmount}) and order confirmed by merchant for ~$${totalPrice}.`
767
782
  : `❌ Not confirmed (${fillResult.status}): ${fillResult.message} Token released.`,
768
783
  receipt_id: fillResult.receipt_id || null,
769
784
  }, null, 2) }],
@@ -7,3 +7,16 @@ import type { Page } from "playwright";
7
7
  * 3. Text heuristic: find largest $ amount near keywords "total", "amount due"
8
8
  */
9
9
  export declare function extractTotalPrice(page: Page): Promise<number | null>;
10
+ /**
11
+ * Detect whether the checkout charges in USD or a non-USD currency.
12
+ * Purpose: size the FX buffer on the JIT card. A USD checkout total is final —
13
+ * our USD card pays it 1:1, no conversion. A non-USD total gets FX-converted +
14
+ * a conversion fee on our USD card and can drift OVER the authorized limit →
15
+ * issuer decline. So non-USD orders need a slightly larger card limit.
16
+ *
17
+ * Conservative by design: defaults to 'USD' unless a CLEAR non-USD signal is
18
+ * present. Both error directions are non-catastrophic (over-buffer → refunded
19
+ * at settlement; under-buffer → a decline the agent can retry), so we avoid
20
+ * false positives from random uppercase text via a currency-code whitelist.
21
+ */
22
+ export declare function detectCheckoutCurrency(page: Page): Promise<'USD' | 'NON_USD'>;
@@ -5,6 +5,7 @@
5
5
  // Returns null if no price can be confidently found.
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.extractTotalPrice = extractTotalPrice;
8
+ exports.detectCheckoutCurrency = detectCheckoutCurrency;
8
9
  /**
9
10
  * Multi-strategy total price extractor.
10
11
  * Strategy order (most reliable → least reliable):
@@ -116,6 +117,41 @@ async function extractTotalPrice(page) {
116
117
  console.error('[PRICE] ❌ Could not detect total price on this page.');
117
118
  return null;
118
119
  }
120
+ /**
121
+ * Detect whether the checkout charges in USD or a non-USD currency.
122
+ * Purpose: size the FX buffer on the JIT card. A USD checkout total is final —
123
+ * our USD card pays it 1:1, no conversion. A non-USD total gets FX-converted +
124
+ * a conversion fee on our USD card and can drift OVER the authorized limit →
125
+ * issuer decline. So non-USD orders need a slightly larger card limit.
126
+ *
127
+ * Conservative by design: defaults to 'USD' unless a CLEAR non-USD signal is
128
+ * present. Both error directions are non-catastrophic (over-buffer → refunded
129
+ * at settlement; under-buffer → a decline the agent can retry), so we avoid
130
+ * false positives from random uppercase text via a currency-code whitelist.
131
+ */
132
+ async function detectCheckoutCurrency(page) {
133
+ try {
134
+ return await page.evaluate(() => {
135
+ const body = document.body.innerText || '';
136
+ // 1. Non-USD currency symbols
137
+ if (/[€£¥₹₩₺₽฿₴]/.test(body))
138
+ return 'NON_USD';
139
+ // 2. Ambiguous "$" with a non-US region prefix (CA$, A$, NZ$, HK$, R$, S$)
140
+ if (/\b(?:CA|A|NZ|HK|R|S)\$/.test(body))
141
+ return 'NON_USD';
142
+ // 3. Explicit 3-letter ISO codes — whitelist of common non-USD only
143
+ const NON_USD = ['EUR', 'GBP', 'JPY', 'CNY', 'INR', 'AUD', 'CAD', 'CHF', 'SGD', 'HKD', 'NZD', 'SEK', 'NOK', 'DKK', 'KRW', 'MXN', 'BRL', 'ZAR', 'AED', 'THB', 'MYR', 'PHP', 'VND', 'IDR', 'PLN', 'TRY'];
144
+ for (const code of NON_USD) {
145
+ if (new RegExp(`\\b${code}\\b`).test(body))
146
+ return 'NON_USD';
147
+ }
148
+ return 'USD';
149
+ });
150
+ }
151
+ catch {
152
+ return 'USD'; // fail safe → smallest buffer, never blocks a payment
153
+ }
154
+ }
119
155
  // ─── Utility ─────────────────────────────────────────────────────────────────
120
156
  function parseMoneyString(text) {
121
157
  // Handles: "$49.99", "USD 49.99", "49,99 $", "49.99 USD"
package/package.json CHANGED
@@ -1,9 +1,11 @@
1
1
  {
2
2
  "name": "z-zero-mcp-server",
3
- "version": "1.3.1",
3
+ "version": "1.3.2",
4
4
  "description": "Z-ZERO MCP Server — Secure JIT Virtual Card Payment tools for AI Agents (Claude, Cursor, AutoGPT) — Real Single-Use Virtual Cards, settled in USDC on Base",
5
5
  "main": "dist/index.js",
6
- "bin": "dist/index.js",
6
+ "bin": {
7
+ "z-zero-mcp-server": "dist/index.js"
8
+ },
7
9
  "scripts": {
8
10
  "build": "tsc",
9
11
  "start": "node dist/index.js",
@@ -24,6 +26,14 @@
24
26
  ],
25
27
  "author": "Z-ZERO",
26
28
  "license": "MIT",
29
+ "repository": {
30
+ "type": "git",
31
+ "url": "git+https://github.com/Dempty-glitch/Z-Zero-mcp.git"
32
+ },
33
+ "homepage": "https://www.clawcard.store/docs/agent",
34
+ "bugs": {
35
+ "url": "https://github.com/Dempty-glitch/Z-Zero-mcp/issues"
36
+ },
27
37
  "files": [
28
38
  "dist/",
29
39
  "README.md"