z-zero-mcp-server 1.3.4 → 1.4.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 -2
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -291,7 +291,11 @@ server.tool("get_merchant_hints", "Get merchant navigation flow for a domain or
291
291
  try {
292
292
  const resp = await fetch(`${ZZERO_API}/api/checkout-hints?domain=${encodeURIComponent(domain)}&fields=merchant`, {
293
293
  headers: {
294
- "x-internal-secret": INTERNAL_SECRET,
294
+ // Primary auth: Passport Key (same key as list_cards — hints are
295
+ // identity+rate-limit gated, not secret). Internal secret kept
296
+ // as fallback for self-hosted deployments that still use it.
297
+ "Authorization": `Bearer ${(0, key_store_js_1.getPassportKey)()}`,
298
+ ...(INTERNAL_SECRET ? { "x-internal-secret": INTERNAL_SECRET } : {}),
295
299
  "x-mcp-version": version_js_2.CURRENT_MCP_VERSION,
296
300
  },
297
301
  });
@@ -825,7 +829,8 @@ server.tool("report_checkout_fail", "Report a checkout URL that you could not co
825
829
  method: "POST",
826
830
  headers: {
827
831
  "Content-Type": "application/json",
828
- "x-internal-secret": INTERNAL_SECRET,
832
+ "Authorization": `Bearer ${(0, key_store_js_1.getPassportKey)()}`,
833
+ ...(INTERNAL_SECRET ? { "x-internal-secret": INTERNAL_SECRET } : {}),
829
834
  "x-mcp-version": version_js_2.CURRENT_MCP_VERSION,
830
835
  },
831
836
  body: JSON.stringify({ url, error_type, error_message, mcp_version: version_js_2.CURRENT_MCP_VERSION }),
@@ -971,6 +976,44 @@ TECHNICAL reason (field not found, bot-blocked, timeout, unknown form):
971
976
  };
972
977
  });
973
978
  // ============================================================
979
+ // PROMPTS: ready-made entry points users can invoke from their MCP client
980
+ // ============================================================
981
+ server.prompt("safe_checkout", "Guided zero-trust checkout: follows the Z-ZERO SOP, surfaces the final total and asks for human approval before any money moves.", {
982
+ checkout_url: zod_1.z.string().describe("URL of the product or checkout page to buy from"),
983
+ budget_usd: zod_1.z.string().optional().describe("Optional spending cap in USD, e.g. '25'"),
984
+ }, ({ checkout_url, budget_usd }) => ({
985
+ messages: [
986
+ {
987
+ role: "user",
988
+ content: {
989
+ type: "text",
990
+ text: [
991
+ `Buy this item for me: ${checkout_url}`,
992
+ budget_usd ? `My budget cap is $${budget_usd} — abort if the final total exceeds it.` : "",
993
+ "",
994
+ "Follow the Z-ZERO SOP strictly:",
995
+ "1. Read mcp://resources/sop before anything else.",
996
+ "2. Call get_merchant_hints for this platform and follow its pre_steps.",
997
+ "3. Proceed through shipping until the FINAL total (including shipping) is visible.",
998
+ "4. Call request_human_approval with the final total and wait for my confirmation BEFORE paying.",
999
+ "5. Only then complete the payment, and report the result status honestly.",
1000
+ ].filter(Boolean).join("\n"),
1001
+ },
1002
+ },
1003
+ ],
1004
+ }));
1005
+ server.prompt("wallet_status", "Summarize the Z-ZERO wallet: card aliases, spendable balances, and the Base USDC deposit address for top-ups.", {}, () => ({
1006
+ messages: [
1007
+ {
1008
+ role: "user",
1009
+ content: {
1010
+ type: "text",
1011
+ text: "Give me a status report of my Z-ZERO wallet: call list_cards, then check_balance for each alias, then get_deposit_addresses. Summarize how much I can spend and where to send USDC (on Base) to top up. Do not trigger any payment.",
1012
+ },
1013
+ },
1014
+ ],
1015
+ }));
1016
+ // ============================================================
974
1017
  // START SERVER
975
1018
  // ============================================================
976
1019
  async function main() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "z-zero-mcp-server",
3
- "version": "1.3.4",
3
+ "version": "1.4.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": {