z-zero-mcp-server 1.5.0 → 1.6.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 +21 -6
- package/dist/index.js +14 -14
- package/dist/wdk_backend.js +10 -12
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -78,7 +78,7 @@ Z-ZERO is not a checkout bot — it's payment infrastructure for the agentic-com
|
|
|
78
78
|
- **An open standard for agent payments** — any agent platform plugs in via MCP; any rail (cards, USDC, x402) can be added.
|
|
79
79
|
- **KYA — Know Your Agent** — verifiable agent reputation. The question isn't "can this agent pay?" but "should you trust it to?"
|
|
80
80
|
|
|
81
|
-
📖 Full vision & architecture: [The Z-Zero Whitebook](https://
|
|
81
|
+
📖 Full vision & architecture: [The Z-Zero Whitebook](https://z-zero.xyz/whitebook)
|
|
82
82
|
|
|
83
83
|
---
|
|
84
84
|
|
|
@@ -104,7 +104,22 @@ Add to your Claude Desktop config (`~/Library/Application Support/Claude/claude_
|
|
|
104
104
|
}
|
|
105
105
|
```
|
|
106
106
|
|
|
107
|
-
Get your Passport Key at: **[
|
|
107
|
+
Get your Passport Key at: **[z-zero.xyz/dashboard/agents](https://z-zero.xyz/dashboard/agents)**
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
## Security: rotate-on-connect (v1.5.0+)
|
|
112
|
+
|
|
113
|
+
The key you copy from the dashboard (or paste into a chat) is only a **one-time bootstrap ticket**.
|
|
114
|
+
The moment your agent connects with it, the MCP server silently swaps it for a fresh key:
|
|
115
|
+
|
|
116
|
+
- The fresh key travels **server → MCP process → disk** and is stored in `~/.z-zero/credentials` (mode `0600`). It never appears in any LLM conversation, tool result, or config file.
|
|
117
|
+
- The pasted key is **dead within seconds** — a copy living in a chat transcript, clipboard, or screenshot can no longer be used by anyone.
|
|
118
|
+
- On startup the MCP loads the key from `~/.z-zero/credentials` first; the `Z_ZERO_API_KEY` env var is only a bootstrap fallback.
|
|
119
|
+
|
|
120
|
+
**One key = one machine.** All agents on the same machine (Claude Desktop, Claude Code, Cursor, …) share the same MCP install and the same credentials file — install once, every agent can pay. Connecting a *different* machine with a copied key rotates it, which instantly disconnects the original machine. That is deliberate: it blocks key sharing **and** doubles as an intrusion alarm — if your agent suddenly fails auth, someone else used your key; go to the dashboard and revoke.
|
|
121
|
+
|
|
122
|
+
Older self-hosted backends without the rotate endpoint keep working — the pasted key simply stays active as before.
|
|
108
123
|
|
|
109
124
|
---
|
|
110
125
|
|
|
@@ -150,14 +165,14 @@ Get your Passport Key at: **[clawcard.store/dashboard/agents](https://www.clawca
|
|
|
150
165
|
|
|
151
166
|
## REST API Reference
|
|
152
167
|
|
|
153
|
-
The Z-ZERO backend is hosted at `https://
|
|
168
|
+
The Z-ZERO backend is hosted at `https://z-zero.xyz`. All endpoints require a `Bearer` token using your Passport Key.
|
|
154
169
|
|
|
155
170
|
> ⚠️ **Use the MCP tools above instead of calling REST directly.** If you must call REST, use the exact paths below.
|
|
156
171
|
|
|
157
172
|
### `GET /api/tokens/cards`
|
|
158
173
|
Returns your card list, balance, and deposit addresses.
|
|
159
174
|
```bash
|
|
160
|
-
curl -X GET "https://
|
|
175
|
+
curl -X GET "https://z-zero.xyz/api/tokens/cards" \
|
|
161
176
|
-H "Authorization: Bearer zk_live_your_key"
|
|
162
177
|
```
|
|
163
178
|
|
|
@@ -181,7 +196,7 @@ Cancel an unused token (refunds balance).
|
|
|
181
196
|
## Troubleshooting
|
|
182
197
|
|
|
183
198
|
### "Z_ZERO_API_KEY is missing"
|
|
184
|
-
1. Go to [
|
|
199
|
+
1. Go to [z-zero.xyz/dashboard/agents](https://z-zero.xyz/dashboard/agents)
|
|
185
200
|
2. Copy your Passport Key (starts with `zk_live_`)
|
|
186
201
|
3. Add it to your config as `Z_ZERO_API_KEY`
|
|
187
202
|
4. **Restart** Claude Desktop / Cursor
|
|
@@ -195,4 +210,4 @@ Cancel an unused token (refunds balance).
|
|
|
195
210
|
|
|
196
211
|
---
|
|
197
212
|
|
|
198
|
-
*Security:
|
|
213
|
+
*Security: the key you paste is never kept — it rotates the moment your agent first connects, and the fresh key lives only in a local owner-only file (`~/.z-zero/credentials`, mode 0600), never in any LLM conversation. Card data exists only in volatile RAM during execution.*
|
package/dist/index.js
CHANGED
|
@@ -89,7 +89,7 @@ server.tool("list_cards", "List all available virtual card aliases and their bal
|
|
|
89
89
|
content: [{
|
|
90
90
|
type: "text",
|
|
91
91
|
text: "❌ AUTHENTICATION REQUIRED: Your Z_ZERO_API_KEY (Passport Key) is missing from the MCP configuration.\n\n" +
|
|
92
|
-
"👉 Please GET your key here: https://
|
|
92
|
+
"👉 Please GET your key here: https://z-zero.xyz/dashboard/agents\n" +
|
|
93
93
|
"👉 Then SET it as the 'Z_ZERO_API_KEY' environment variable in your AI tool (Claude Desktop/Cursor) and RESTART the tool."
|
|
94
94
|
}],
|
|
95
95
|
isError: true
|
|
@@ -135,7 +135,7 @@ server.tool("check_balance", "Check spendable USD balance for a card alias. For
|
|
|
135
135
|
content: [{
|
|
136
136
|
type: "text",
|
|
137
137
|
text: "❌ AUTHENTICATION REQUIRED: Your Z_ZERO_API_KEY (Passport Key) is missing from the MCP configuration.\n\n" +
|
|
138
|
-
"👉 Please GET your key here: https://
|
|
138
|
+
"👉 Please GET your key here: https://z-zero.xyz/dashboard/agents\n" +
|
|
139
139
|
"👉 Then SET it as the 'Z_ZERO_API_KEY' environment variable and RESTART."
|
|
140
140
|
}],
|
|
141
141
|
isError: true
|
|
@@ -171,7 +171,7 @@ server.tool("get_deposit_addresses", "Get your Base deposit address to top up yo
|
|
|
171
171
|
content: [{
|
|
172
172
|
type: "text",
|
|
173
173
|
text: "❌ AUTHENTICATION REQUIRED: Your Z_ZERO_API_KEY (Passport Key) is missing from the MCP configuration.\n\n" +
|
|
174
|
-
"👉 Please GET your key here: https://
|
|
174
|
+
"👉 Please GET your key here: https://z-zero.xyz/dashboard/agents\n" +
|
|
175
175
|
"👉 Then SET it as the 'Z_ZERO_API_KEY' environment variable and RESTART."
|
|
176
176
|
}],
|
|
177
177
|
isError: true
|
|
@@ -200,7 +200,7 @@ server.tool("get_deposit_addresses", "Get your Base deposit address to top up yo
|
|
|
200
200
|
return {
|
|
201
201
|
content: [{
|
|
202
202
|
type: "text",
|
|
203
|
-
text: "No Base wallet found. Please create one at https://
|
|
203
|
+
text: "No Base wallet found. Please create one at https://z-zero.xyz/dashboard/agent-wallet",
|
|
204
204
|
}],
|
|
205
205
|
isError: true,
|
|
206
206
|
};
|
|
@@ -227,7 +227,7 @@ server.tool("request_payment_token", "Request a single-use JIT virtual card ($1
|
|
|
227
227
|
content: [{
|
|
228
228
|
type: "text",
|
|
229
229
|
text: "❌ AUTHENTICATION REQUIRED: Your Z_ZERO_API_KEY (Passport Key) is missing from the MCP configuration.\n\n" +
|
|
230
|
-
"👉 Please GET your key here: https://
|
|
230
|
+
"👉 Please GET your key here: https://z-zero.xyz/dashboard/agents"
|
|
231
231
|
}],
|
|
232
232
|
isError: true
|
|
233
233
|
};
|
|
@@ -286,7 +286,7 @@ server.tool("get_merchant_hints", "Get merchant navigation flow for a domain or
|
|
|
286
286
|
.string()
|
|
287
287
|
.describe("The main domain of the checkout page, e.g. 'amazon.com' or 'shopify.com'. Strip 'www.' prefix."),
|
|
288
288
|
}, async ({ domain }) => {
|
|
289
|
-
const ZZERO_API = process.env.Z_ZERO_API_BASE_URL || process.env.Z_ZERO_API_BASE || "https://
|
|
289
|
+
const ZZERO_API = process.env.Z_ZERO_API_BASE_URL || process.env.Z_ZERO_API_BASE || "https://z-zero.xyz";
|
|
290
290
|
const INTERNAL_SECRET = process.env.Z_ZERO_INTERNAL_SECRET || "";
|
|
291
291
|
try {
|
|
292
292
|
const resp = await fetch(`${ZZERO_API}/api/checkout-hints?domain=${encodeURIComponent(domain)}&fields=merchant`, {
|
|
@@ -367,7 +367,7 @@ server.tool("execute_payment", "Execute a payment with a one-time token: Z-Zero
|
|
|
367
367
|
content: [{
|
|
368
368
|
type: "text",
|
|
369
369
|
text: "❌ AUTHENTICATION REQUIRED: Your Z_ZERO_API_KEY (Passport Key) is missing from the MCP configuration.\n\n" +
|
|
370
|
-
"👉 Please GET your key here: https://
|
|
370
|
+
"👉 Please GET your key here: https://z-zero.xyz/dashboard/agents"
|
|
371
371
|
}],
|
|
372
372
|
isError: true
|
|
373
373
|
};
|
|
@@ -476,7 +476,7 @@ server.tool("cancel_payment_token", "Cancel unused token and refund instantly. U
|
|
|
476
476
|
content: [{
|
|
477
477
|
type: "text",
|
|
478
478
|
text: "❌ AUTHENTICATION REQUIRED: Your Z_ZERO_API_KEY (Passport Key) is missing from the MCP configuration.\n\n" +
|
|
479
|
-
"👉 Please GET your key here: https://
|
|
479
|
+
"👉 Please GET your key here: https://z-zero.xyz/dashboard/agents"
|
|
480
480
|
}],
|
|
481
481
|
isError: true
|
|
482
482
|
};
|
|
@@ -555,7 +555,7 @@ server.tool("request_human_approval", "Pause and ask the user for approval befor
|
|
|
555
555
|
server.tool("set_api_key", "Activate a new Passport Key instantly, no restart needed. Only call when user explicitly provides a key.", {
|
|
556
556
|
api_key: zod_1.z
|
|
557
557
|
.string()
|
|
558
|
-
.describe("The new Passport Key to activate. Must start with 'zk_live_' or 'zk_test_'. Get from: https://
|
|
558
|
+
.describe("The new Passport Key to activate. Must start with 'zk_live_' or 'zk_test_'. Get from: https://z-zero.xyz/dashboard/agents"),
|
|
559
559
|
}, async ({ api_key }) => {
|
|
560
560
|
// Step 1: Format validation
|
|
561
561
|
const trimmed = api_key.trim();
|
|
@@ -566,7 +566,7 @@ server.tool("set_api_key", "Activate a new Passport Key instantly, no restart ne
|
|
|
566
566
|
};
|
|
567
567
|
}
|
|
568
568
|
// Step 2: Validate new key against Dashboard API before swapping
|
|
569
|
-
const ZZERO_API = process.env.Z_ZERO_API_BASE_URL || process.env.Z_ZERO_API_BASE || "https://
|
|
569
|
+
const ZZERO_API = process.env.Z_ZERO_API_BASE_URL || process.env.Z_ZERO_API_BASE || "https://z-zero.xyz";
|
|
570
570
|
try {
|
|
571
571
|
const resp = await fetch(`${ZZERO_API}/api/wdk/balance`, {
|
|
572
572
|
headers: {
|
|
@@ -577,7 +577,7 @@ server.tool("set_api_key", "Activate a new Passport Key instantly, no restart ne
|
|
|
577
577
|
});
|
|
578
578
|
if (resp.status === 401) {
|
|
579
579
|
return {
|
|
580
|
-
content: [{ type: "text", text: `❌ Key rejected by server — invalid or deactivated. Please check your key at https://
|
|
580
|
+
content: [{ type: "text", text: `❌ Key rejected by server — invalid or deactivated. Please check your key at https://z-zero.xyz/dashboard/agents` }],
|
|
581
581
|
isError: true,
|
|
582
582
|
};
|
|
583
583
|
}
|
|
@@ -669,7 +669,7 @@ server.tool("show_api_key_status", "Check if Passport Key is configured. Shows p
|
|
|
669
669
|
key_hint: hasKey ? maskKey(key) : null,
|
|
670
670
|
note: hasKey
|
|
671
671
|
? "Key is active. Call set_api_key to update it."
|
|
672
|
-
: "No key configured. Call set_api_key with your Passport Key from https://
|
|
672
|
+
: "No key configured. Call set_api_key with your Passport Key from https://z-zero.xyz/dashboard/agents",
|
|
673
673
|
}, null, 2),
|
|
674
674
|
}],
|
|
675
675
|
};
|
|
@@ -683,7 +683,7 @@ server.tool("auto_pay_checkout", "⚠️ MANDATORY: Read mcp://resources/sop fir
|
|
|
683
683
|
.string()
|
|
684
684
|
.describe("Card alias to charge for JIT Fiat fallback, e.g. 'Card_01'."),
|
|
685
685
|
}, async ({ checkout_url, card_alias }) => {
|
|
686
|
-
const ZZERO_API = process.env.Z_ZERO_API_BASE_URL || process.env.Z_ZERO_API_BASE || "https://
|
|
686
|
+
const ZZERO_API = process.env.Z_ZERO_API_BASE_URL || process.env.Z_ZERO_API_BASE || "https://z-zero.xyz";
|
|
687
687
|
const API_KEY = (0, key_store_js_1.getPassportKey)(); // ✅ FIX: use hot-swap key store, not process.env
|
|
688
688
|
// Spend guard for the autonomous path. auto_pay derives the amount itself
|
|
689
689
|
// (scraped fiat total OR on-chain amount from an EIP-681 link / calldata), so there is
|
|
@@ -861,7 +861,7 @@ server.tool("report_checkout_fail", "Report a checkout URL that you could not co
|
|
|
861
861
|
.optional()
|
|
862
862
|
.describe("Brief description of what went wrong, e.g. 'Could not find card number field' or 'Page redirected to CAPTCHA'."),
|
|
863
863
|
}, async ({ url, error_type, error_message }) => {
|
|
864
|
-
const ZZERO_API = process.env.Z_ZERO_API_BASE_URL || process.env.Z_ZERO_API_BASE || "https://
|
|
864
|
+
const ZZERO_API = process.env.Z_ZERO_API_BASE_URL || process.env.Z_ZERO_API_BASE || "https://z-zero.xyz";
|
|
865
865
|
const INTERNAL_SECRET = process.env.Z_ZERO_INTERNAL_SECRET || "";
|
|
866
866
|
try {
|
|
867
867
|
await fetch(`${ZZERO_API}/api/checkout-hints`, {
|
package/dist/wdk_backend.js
CHANGED
|
@@ -18,13 +18,13 @@ exports.burnTokenRemote = burnTokenRemote;
|
|
|
18
18
|
exports.cancelTokenRemote = cancelTokenRemote;
|
|
19
19
|
exports.refundUnderspendRemote = refundUnderspendRemote;
|
|
20
20
|
const key_store_js_1 = require("./lib/key-store.js");
|
|
21
|
-
const API_BASE_URL = process.env.Z_ZERO_API_BASE_URL || "https://
|
|
21
|
+
const API_BASE_URL = process.env.Z_ZERO_API_BASE_URL || "https://z-zero.xyz";
|
|
22
22
|
const INTERNAL_SECRET = process.env.Z_ZERO_INTERNAL_SECRET || "";
|
|
23
23
|
// Injected at build time — always reflects the actual running version
|
|
24
24
|
const version_js_1 = require("./version.js");
|
|
25
25
|
if (!(0, key_store_js_1.hasPassportKey)()) {
|
|
26
26
|
console.error("❌ ERROR: Z_ZERO_API_KEY (Passport Key) is missing!");
|
|
27
|
-
console.error("🔐 Get your key: https://
|
|
27
|
+
console.error("🔐 Get your key: https://z-zero.xyz/dashboard/agents");
|
|
28
28
|
console.error("🛠️ Or call the set_api_key MCP tool to set it without restarting.");
|
|
29
29
|
}
|
|
30
30
|
// ──────────────────────────────────────────────────────────────────────────────
|
|
@@ -57,19 +57,17 @@ async function apiRequest(endpoint, method = 'GET', body = null) {
|
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
async function internalApiRequest(endpoint, method, body) {
|
|
60
|
-
//
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
60
|
+
// Auth is the Bearer Passport Key — the server dropped the x-internal-secret
|
|
61
|
+
// gate on /resolve and /burn (redundant to per-user token ownership, Jul 2026).
|
|
62
|
+
// The old client-side CONFIG_ERROR check here broke execute_payment for every
|
|
63
|
+
// install configured per the current docs (key only). Secret is now attached
|
|
64
|
+
// only if present, as back-compat for self-hosted deployments that still gate on it.
|
|
64
65
|
const url = `${API_BASE_URL.replace(/\/$/, '')}${endpoint}`;
|
|
65
66
|
try {
|
|
66
|
-
// Two independent factors on these PAN/burn endpoints:
|
|
67
|
-
// - x-internal-secret: coarse platform gate (shared deploy secret)
|
|
68
|
-
// - Authorization: Bearer <Passport Key>: per-user identity → server enforces token ownership
|
|
69
67
|
const res = await fetch(url, {
|
|
70
68
|
method,
|
|
71
69
|
headers: {
|
|
72
|
-
"x-internal-secret": INTERNAL_SECRET,
|
|
70
|
+
...(INTERNAL_SECRET ? { "x-internal-secret": INTERNAL_SECRET } : {}),
|
|
73
71
|
"Authorization": `Bearer ${(0, key_store_js_1.getPassportKey)()}`,
|
|
74
72
|
"Content-Type": "application/json",
|
|
75
73
|
"X-MCP-Version": version_js_1.CURRENT_MCP_VERSION,
|
|
@@ -105,7 +103,7 @@ async function getBalanceRemote(cardAlias) {
|
|
|
105
103
|
if (data?.error) {
|
|
106
104
|
return {
|
|
107
105
|
error: true,
|
|
108
|
-
message: 'Base wallet not connected. Create one at https://
|
|
106
|
+
message: 'Base wallet not connected. Create one at https://z-zero.xyz/dashboard/agent-wallet'
|
|
109
107
|
};
|
|
110
108
|
}
|
|
111
109
|
return {
|
|
@@ -125,7 +123,7 @@ async function getDepositAddressesRemote() {
|
|
|
125
123
|
if (data?.error) {
|
|
126
124
|
return {
|
|
127
125
|
error: true,
|
|
128
|
-
message: 'Base wallet not connected. Create one at https://
|
|
126
|
+
message: 'Base wallet not connected. Create one at https://z-zero.xyz/dashboard/agent-wallet'
|
|
129
127
|
};
|
|
130
128
|
}
|
|
131
129
|
const balance = data.base_usdc_balance ?? data.balance_usdt;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "z-zero-mcp-server",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.0",
|
|
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
6
|
"bin": {
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"type": "git",
|
|
31
31
|
"url": "git+https://github.com/Dempty-glitch/Z-Zero-mcp.git"
|
|
32
32
|
},
|
|
33
|
-
"homepage": "https://
|
|
33
|
+
"homepage": "https://z-zero.xyz/docs/agent",
|
|
34
34
|
"bugs": {
|
|
35
35
|
"url": "https://github.com/Dempty-glitch/Z-Zero-mcp/issues"
|
|
36
36
|
},
|