@quackai/q402-mcp 0.6.0 → 0.6.1

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 +128 -20
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -121,7 +121,12 @@ function loadConfig() {
121
121
  const apiKeyKind = classifyApiKey(apiKey);
122
122
  const privateKey = ENV.Q402_PRIVATE_KEY ?? null;
123
123
  const agenticPrivateKey = ENV.Q402_AGENTIC_PRIVATE_KEY ?? null;
124
- const walletIdRaw = ENV.Q402_WALLET_ID;
124
+ const walletIdRaw = ENV.Q402_AGENT_WALLET_ADDRESS ?? ENV.Q402_WALLET_ID;
125
+ if (!ENV.Q402_AGENT_WALLET_ADDRESS && ENV.Q402_WALLET_ID) {
126
+ process.stderr.write(
127
+ "[q402-mcp] Q402_WALLET_ID is deprecated \u2014 rename to Q402_AGENT_WALLET_ADDRESS. Old name will be removed in v0.7.0.\n"
128
+ );
129
+ }
125
130
  const walletId = typeof walletIdRaw === "string" && walletIdRaw.length > 0 ? walletIdRaw.toLowerCase() : null;
126
131
  const realPaymentsRequested = ENV.Q402_ENABLE_REAL_PAYMENTS === "1";
127
132
  const anyLiveKey = classifyApiKey(trialApiKey) === "live" || classifyApiKey(multichainApiKey) === "live" || classifyApiKey(legacyApiKey) === "live";
@@ -206,7 +211,7 @@ var isValidPrivateKey = (s) => typeof s === "string" && PRIVATE_KEY_RE.test(s);
206
211
 
207
212
  // src/version.ts
208
213
  var PACKAGE_NAME = "@quackai/q402-mcp";
209
- var PACKAGE_VERSION = "0.6.0";
214
+ var PACKAGE_VERSION = "0.6.1";
210
215
 
211
216
  // src/tools/quote.ts
212
217
  import { z } from "zod";
@@ -1047,6 +1052,32 @@ async function runPay(input) {
1047
1052
  }
1048
1053
  const data = await resp.json().catch(() => ({}));
1049
1054
  const txHash = data.txHash ?? "";
1055
+ const isPending = resp.status === 202 || data.pending === true || data.status === "processing";
1056
+ if (isPending) {
1057
+ const retryAfter = typeof data.retryAfterSec === "number" ? data.retryAfterSec : 5;
1058
+ return {
1059
+ result: {
1060
+ success: false,
1061
+ sandbox: false,
1062
+ txHash: "",
1063
+ tokenAmount: input.amount,
1064
+ token: input.token,
1065
+ chain: chain.key,
1066
+ method: "eip7702",
1067
+ pending: true,
1068
+ retryAfterSec: retryAfter
1069
+ },
1070
+ guardsApplied: [
1071
+ ...guardsApplied,
1072
+ "wallet=agentic-server",
1073
+ "mode=live",
1074
+ "status=pending",
1075
+ `retry_after=${retryAfter}s`
1076
+ ],
1077
+ senderWallet,
1078
+ setupHint: `An identical send for this wallet is still in flight on the server. Wait ${retryAfter}s and retry \u2014 the cached result will come back, no double-spend.`
1079
+ };
1080
+ }
1050
1081
  const success = resp.ok && txHash.length > 0;
1051
1082
  const message = "message" in data ? data.message : "error" in data ? data.error : void 0;
1052
1083
  return {
@@ -1884,13 +1915,76 @@ Q402_MULTICHAIN_API_KEY=
1884
1915
 
1885
1916
 
1886
1917
  # \u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501
1887
- # WALLET \u2014 paste your private key on the right of \`=\`
1918
+ # SIGNING MODE \u2014 pick ONE of A / B / C below
1919
+ # \u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501
1920
+ # Q402 pays in three ways, depending on which keys you set. Pick the
1921
+ # row that matches your situation and fill ONLY that row's variable(s).
1922
+ # Setting multiple rows is allowed \u2014 q402_pay will ask you which one to
1923
+ # use per call (the AI surfaces the question; you don't pre-pick a
1924
+ # default here).
1925
+ #
1926
+ # A. Real EOA (your MetaMask wallet)
1927
+ # Set: Q402_PRIVATE_KEY = 0x... (your MetaMask account's private key)
1928
+ # Pros: simplest mental model \u2014 same wallet you already use
1929
+ # Cons: after first payment, MetaMask will show this account as
1930
+ # "Smart account" (EIP-7702 delegation, reversible via
1931
+ # q402_clear_delegation but visually alarming on first sight)
1932
+ #
1933
+ # B. Agent Wallet \u2014 local signing (recommended for AI agents)
1934
+ # Set: Q402_AGENTIC_PRIVATE_KEY = 0x... (Agent Wallet pk from dashboard export)
1935
+ # Pros: your MetaMask stays untouched; agent has its own purse with
1936
+ # per-tx + daily caps you set on the dashboard
1937
+ # Cons: requires creating an Agent Wallet on the dashboard first
1938
+ # (https://q402.quackai.ai/dashboard \u2192 Agent tab \u2192 Create)
1939
+ # then exporting its private key
1940
+ #
1941
+ # C. Agent Wallet \u2014 server-managed (no private key on your machine)
1942
+ # Set: (just the api key + optionally Q402_AGENT_WALLET_ADDRESS below)
1943
+ # Pros: zero private-key handling locally; the server holds the
1944
+ # encrypted Agent Wallet pk and signs on your behalf
1945
+ # Cons: requires a paid Multichain API key (Mode C is not available
1946
+ # on the free Trial). The server-side keystore is AES-256-GCM
1947
+ # encrypted but is a custodial path \u2014 pick A or B if that
1948
+ # posture doesn't fit your threat model.
1949
+ #
1950
+ # A user can have multiple wallets configured simultaneously (e.g. PK
1951
+ # for personal pays + apiKey-only for agent pays). When more than one
1952
+ # mode is set, q402_pay asks the user which to use rather than picking
1953
+ # silently.
1954
+
1955
+
1956
+ # \u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501
1957
+ # WALLET \u2014 Mode A: real EOA private key
1888
1958
  # \u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501
1889
1959
  # Hex EVM private key (0x + 64 hex chars). Signs payments LOCALLY on
1890
1960
  # your machine \u2014 never leaves your device, never sent to any server.
1961
+ # Leave blank if you're using Mode B or Mode C.
1891
1962
  Q402_PRIVATE_KEY=
1892
1963
 
1893
1964
 
1965
+ # \u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501
1966
+ # WALLET \u2014 Mode B: exported Agent Wallet private key
1967
+ # \u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501
1968
+ # Hex EVM private key (0x + 64 hex chars) exported from your Agent
1969
+ # Wallet on the dashboard. Signs payments LOCALLY just like Mode A,
1970
+ # but the wallet is your dedicated Agent Wallet \u2014 your MetaMask EOA
1971
+ # is never touched. Get the key at:
1972
+ # https://q402.quackai.ai/dashboard \u2192 Agent tab \u2192 Export
1973
+ # Leave blank if you're using Mode A or Mode C.
1974
+ Q402_AGENTIC_PRIVATE_KEY=
1975
+
1976
+
1977
+ # \u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501
1978
+ # WALLET \u2014 Mode C: server-managed Agent Wallet picker (optional)
1979
+ # \u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501
1980
+ # Only set this when you're running Mode C (api key only, no private
1981
+ # keys above) AND you have more than one Agent Wallet on the account
1982
+ # (max 10). Pin which one Q402 should spend from. Format: lowercase
1983
+ # 0x... address of the Agent Wallet (visible on the dashboard's Agent
1984
+ # tab). Omit entirely to use your default Agent Wallet.
1985
+ # Q402_AGENT_WALLET_ADDRESS=0x...
1986
+
1987
+
1894
1988
  # \u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501
1895
1989
  # Live mode switch (safe even at 1 \u2014 see SAFE-BY-DEFAULT note at top)
1896
1990
  # \u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501
@@ -1943,13 +2037,16 @@ function mask2(key) {
1943
2037
  function detectPhase() {
1944
2038
  const anyKey = !!(CONFIG.trialApiKey || CONFIG.multichainApiKey || CONFIG.legacyApiKey);
1945
2039
  const anyLiveKey = classifyApiKey(CONFIG.trialApiKey) === "live" || classifyApiKey(CONFIG.multichainApiKey) === "live" || classifyApiKey(CONFIG.legacyApiKey) === "live";
1946
- const hasValidPrivateKey = isValidPrivateKey(CONFIG.privateKey);
1947
- if (!Q402_ENV_FILE_PRESENT && !anyKey && !CONFIG.privateKey) {
2040
+ const modes = detectAgenticModes();
2041
+ const hasAnyValidSigningPath = modes.count > 0;
2042
+ if (!Q402_ENV_FILE_PRESENT && !anyKey && !CONFIG.privateKey && !CONFIG.agenticPrivateKey) {
1948
2043
  return "first-install";
1949
2044
  }
1950
- const allEssentials = anyKey && hasValidPrivateKey && CONFIG.realPaymentsRequested && anyLiveKey;
2045
+ const allEssentials = anyKey && hasAnyValidSigningPath && CONFIG.realPaymentsRequested && anyLiveKey;
1951
2046
  if (allEssentials) return "live-check";
1952
- if (anyKey || CONFIG.privateKey || Q402_ENV_FILE_PRESENT) return "needs-completion";
2047
+ if (anyKey || CONFIG.privateKey || CONFIG.agenticPrivateKey || Q402_ENV_FILE_PRESENT) {
2048
+ return "needs-completion";
2049
+ }
1953
2050
  return "first-install";
1954
2051
  }
1955
2052
  async function verifyOneKey(scope, envVar, apiKey) {
@@ -2070,23 +2167,33 @@ async function runDoctor() {
2070
2167
  "Must be '1' to allow real TX. Anything else = test response (fake hash)."
2071
2168
  )
2072
2169
  };
2170
+ const modes = detectAgenticModes();
2073
2171
  const missing = [];
2074
2172
  if (!CONFIG.trialApiKey && !CONFIG.multichainApiKey && !CONFIG.legacyApiKey) {
2075
2173
  missing.push(
2076
2174
  "An API key (Q402_TRIAL_API_KEY for free BNB OR Q402_MULTICHAIN_API_KEY for paid 9-chain)"
2077
2175
  );
2078
2176
  }
2079
- if (!CONFIG.privateKey) {
2080
- missing.push("Q402_PRIVATE_KEY");
2081
- } else if (!isValidPrivateKey(CONFIG.privateKey)) {
2082
- missing.push(
2083
- "Q402_PRIVATE_KEY is set but malformed (expected 0x + 64 hex chars). Looks like the placeholder '0x...' is still in ~/.q402/mcp.env \u2014 paste a real key in your editor."
2084
- );
2177
+ if (modes.count === 0) {
2178
+ const pkAPlaceholder = !!CONFIG.privateKey && !isValidPrivateKey(CONFIG.privateKey);
2179
+ const pkBPlaceholder = !!CONFIG.agenticPrivateKey && !isValidPrivateKey(CONFIG.agenticPrivateKey);
2180
+ if (pkAPlaceholder) {
2181
+ missing.push(
2182
+ "Q402_PRIVATE_KEY is set but malformed (expected 0x + 64 hex chars). Looks like the placeholder '0x...' is still in ~/.q402/mcp.env \u2014 paste a real key in your editor."
2183
+ );
2184
+ } else if (pkBPlaceholder) {
2185
+ missing.push(
2186
+ "Q402_AGENTIC_PRIVATE_KEY is set but malformed (expected 0x + 64 hex chars). Paste your exported Agent Wallet private key (https://q402.quackai.ai/dashboard \u2192 Agent tab \u2192 Export)."
2187
+ );
2188
+ } else {
2189
+ missing.push(
2190
+ "A signing path. Pick ONE: (A) Q402_PRIVATE_KEY = your MetaMask EOA's private key; (B) Q402_AGENTIC_PRIVATE_KEY = your exported Agent Wallet private key from the dashboard (Mode B keeps your MetaMask untouched); or (C) just use a live paid Q402_MULTICHAIN_API_KEY and let Q402 sign with your server-managed Agent Wallet (no PK on your machine)."
2191
+ );
2192
+ }
2085
2193
  }
2086
2194
  if (!CONFIG.realPaymentsRequested) {
2087
2195
  const haveAnyApi = !!(CONFIG.trialApiKey || CONFIG.multichainApiKey || CONFIG.legacyApiKey);
2088
- const havePk = isValidPrivateKey(CONFIG.privateKey);
2089
- if (haveAnyApi && havePk) {
2196
+ if (haveAnyApi && modes.count > 0) {
2090
2197
  missing.push(
2091
2198
  "Q402_ENABLE_REAL_PAYMENTS=1 \u2014 your other config looks fine, but your MCP client isn't passing the registry default through. Add the line Q402_ENABLE_REAL_PAYMENTS=1 to ~/.q402/mcp.env explicitly and restart."
2092
2199
  );
@@ -2141,12 +2248,13 @@ async function runDoctor() {
2141
2248
  recommendedActions,
2142
2249
  greeting: phase === "first-install" ? `Q402 MCP is installed (v${PACKAGE_VERSION}).` : `Q402 MCP is installed (v${PACKAGE_VERSION}) \u2014 partially configured.`,
2143
2250
  nextStep: phase === "first-install" ? "Show userInstructions verbatim to the user; do NOT show agentInstructions verbatim (it's prescription for you, the AI)." : "Tell the user which env vars are still missing (from the 'missing' list) and how to add them to ~/.q402/mcp.env. Show userInstructions for the human-readable steps.",
2144
- agentInstructions: phase === "first-install" ? "[AI-ONLY \u2014 do not show this paragraph to the user verbatim] Multi-turn flow: (1) Briefly tell the user MCP is installed. (2) Ask one yes/no question \u2014 'Want me to create your Q402 settings file?'. (3) On yes, execute recommendedActions IN ORDER: first `ensure-q402-dir` shell action (bash on macOS/Linux, PowerShell on Windows via shellWindows variant), then `create-env-file` write_file action. (4) Open the file in the user's editor \u2014 `code` works for VS Code / Cursor / Cline (e.g. `code ~/.q402/mcp.env`); `open` on macOS, `start` on Windows, `xdg-open` on Linux as fallback. (5) Walk through filling in the API key (from /event for free Trial or /payment for paid Multichain) and private key one at a time. (6) Do NOT accept key values via chat \u2014 direct the user to edit the file in their editor. BEFORE they paste a private key, surface the `advisories` array: fresh wallet, Smart-account-in-MetaMask heads-up, hardware wallets unsupported, MetaMask key-export path. (7) After they save, tell them to restart the MCP client \u2014 per-client restart verb: Claude Desktop \u2192 quit + relaunch; Codex \u2192 exit + relaunch; Cursor \u2192 Cmd/Ctrl+Shift+P \u2192 'Developer: Reload Window'; Cline \u2192 reload VS Code window. (8) Have them re-invoke 'Set up Q402' to confirm. Keep the conversation tight: one decision per turn, plain language, never echo this paragraph." : "[AI-ONLY \u2014 do not show this paragraph to the user verbatim] User has SOME env set. List the missing items (from `missing`) in plain language. Tell them to edit ~/.q402/mcp.env and uncomment / fill the relevant line, then restart the MCP client. Restart verb per client: Claude Desktop \u2192 quit + relaunch; Codex \u2192 exit + relaunch; Cursor \u2192 Cmd/Ctrl+Shift+P \u2192 'Developer: Reload Window'; Cline \u2192 reload VS Code window.",
2251
+ agentInstructions: phase === "first-install" ? "[AI-ONLY \u2014 do not show this paragraph to the user verbatim] Multi-turn flow: (1) Briefly tell the user MCP is installed. (2) Ask one yes/no question \u2014 'Want me to create your Q402 settings file?'. (3) On yes, execute recommendedActions IN ORDER: first `ensure-q402-dir` shell action (bash on macOS/Linux, PowerShell on Windows via shellWindows variant), then `create-env-file` write_file action. (4) Open the file in the user's editor \u2014 `code` works for VS Code / Cursor / Cline (e.g. `code ~/.q402/mcp.env`); `open` on macOS, `start` on Windows, `xdg-open` on Linux as fallback. (5) Help the user pick a wallet mode (A=Q402_PRIVATE_KEY real EOA, B=Q402_AGENTIC_PRIVATE_KEY exported Agent Wallet PK, C=API key only with server-managed Agent Wallet). If they're an AI agent / automation user, gently default to B or C; if they're a power user who wants their existing EOA to be the signer, A is fine. Walk through filling in the chosen mode's variable + the API key one at a time. (6) Do NOT accept key values via chat \u2014 direct the user to edit the file in their editor. BEFORE they paste any private key (Mode A OR Mode B), surface the `advisories` array: fresh wallet, Smart-account-in-MetaMask heads-up (Mode A only), hardware wallets unsupported, MetaMask key-export path (Mode A) or dashboard Export button (Mode B). (7) After they save, tell them to restart the MCP client \u2014 per-client restart verb: Claude Desktop \u2192 quit + relaunch; Codex \u2192 exit + relaunch; Cursor \u2192 Cmd/Ctrl+Shift+P \u2192 'Developer: Reload Window'; Cline \u2192 reload VS Code window. (8) Have them re-invoke 'Set up Q402' to confirm. Keep the conversation tight: one decision per turn, plain language, never echo this paragraph." : "[AI-ONLY \u2014 do not show this paragraph to the user verbatim] User has SOME env set. List the missing items (from `missing`) in plain language. Tell them to edit ~/.q402/mcp.env and uncomment / fill the relevant line, then restart the MCP client. Restart verb per client: Claude Desktop \u2192 quit + relaunch; Codex \u2192 exit + relaunch; Cursor \u2192 Cmd/Ctrl+Shift+P \u2192 'Developer: Reload Window'; Cline \u2192 reload VS Code window.",
2145
2252
  userInstructions: phase === "first-install" ? [
2146
- "Q402 is installed. To start sending payments you need an API key and a wallet.",
2253
+ "Q402 is installed. To start sending payments you need (1) an API key and (2) a wallet to sign with.",
2147
2254
  "I'll create a settings file for you \u2014 say yes and I'll set it up + open it in your editor.",
2148
2255
  "Get a free API key at https://q402.quackai.ai/event (BNB Chain only, 2,000 sponsored transactions).",
2149
- "Use a FRESH wallet for Q402 \u2014 don't use your main wallet. The wallet will be marked 'Smart account' in MetaMask after your first payment (that's normal \u2014 Q402 reverses it on demand).",
2256
+ "There are 3 wallet modes \u2014 pick one: (A) your MetaMask EOA's private key (simplest, but your account will be marked 'Smart account' after first payment); (B) export an Agent Wallet's private key from the dashboard (keeps your MetaMask untouched, recommended for AI agents); (C) on a paid plan, use the server-managed Agent Wallet \u2014 just set the API key, no private key needed.",
2257
+ "Use a FRESH wallet for Mode A \u2014 don't use the one holding your main funds. The 'Smart account' marker is normal (EIP-7702 delegation, reversible via q402_clear_delegation).",
2150
2258
  "Paste your key + wallet private key INTO THE FILE (in your editor) \u2014 never paste a private key into this chat.",
2151
2259
  "Save the file, restart your MCP client, then ask me 'Verify Q402' to confirm."
2152
2260
  ] : [
@@ -2268,7 +2376,7 @@ var DOCTOR_TOOL = {
2268
2376
  import { z as z9 } from "zod";
2269
2377
  var AgenticInfoInputSchema = z9.object({
2270
2378
  walletId: z9.string().optional().describe(
2271
- "Optional lowercased Agent Wallet address to introspect when the user holds multiple (max 10 per owner). Omit to use Q402_WALLET_ID env, then the owner's default wallet."
2379
+ "Optional lowercased Agent Wallet address to introspect when the user holds multiple (max 10 per owner). Omit to use Q402_AGENT_WALLET_ADDRESS env, then the owner's default wallet."
2272
2380
  )
2273
2381
  });
2274
2382
  var AGENTIC_INFO_TOOL = {
@@ -2279,7 +2387,7 @@ var AGENTIC_INFO_TOOL = {
2279
2387
  properties: {
2280
2388
  walletId: {
2281
2389
  type: "string",
2282
- description: "Optional. Lowercased Agent Wallet address when the user holds multiple wallets. Defaults to Q402_WALLET_ID env, then the owner's default wallet on the server."
2390
+ description: "Optional. Lowercased Agent Wallet address when the user holds multiple wallets. Defaults to Q402_AGENT_WALLET_ADDRESS env, then the owner's default wallet on the server."
2283
2391
  }
2284
2392
  },
2285
2393
  additionalProperties: false
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quackai/q402-mcp",
3
- "version": "0.6.0",
3
+ "version": "0.6.1",
4
4
  "description": "MCP server for Q402 — gasless USDC, USDT, and RLUSD payments across 9 EVM chains, callable from Claude (Desktop / Code), OpenAI Codex CLI, and any other Model Context Protocol client.",
5
5
  "mcpName": "io.github.bitgett/q402-mcp",
6
6
  "keywords": [