@quackai/q402-mcp 0.7.1 → 0.7.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/README.md +49 -66
- package/dist/index.js +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -9,16 +9,14 @@
|
|
|
9
9
|
>
|
|
10
10
|
> **Trial-scope policy:** API keys minted under the free-trial program (`plan: "trial"`) are restricted to BNB Chain with USDC/USDT — server-side enforcement, returns `403 TRIAL_BNB_ONLY` otherwise. **Paid API keys see the full 9-chain matrix at all times.**
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
Quote → route → (optional) settle stablecoin payments across 9 EVM chains, from any MCP client. Recipient gets the full amount; sender pays $0 gas via [Q402](https://q402.quackai.ai)'s EIP-7702 relayer.
|
|
13
13
|
|
|
14
14
|
---
|
|
15
15
|
|
|
16
16
|
## Quick start
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
1. Register the MCP server with your client (one-line install per client).
|
|
21
|
-
2. Open your client and say: **"Set up Q402"**. The agent calls `q402_doctor` which walks you through creating a single secrets file at `~/.q402/mcp.env` and pasting in your API key + private key. Nothing else.
|
|
18
|
+
1. Register the server with your client (one-line per client).
|
|
19
|
+
2. Say **"Set up Q402"** to your agent. It runs `q402_doctor` → creates `~/.q402/mcp.env` → walks you through pasting keys.
|
|
22
20
|
|
|
23
21
|
### 1. Register the server
|
|
24
22
|
|
|
@@ -30,12 +28,12 @@ Two steps:
|
|
|
30
28
|
| **Cline** | Cline → Settings → MCP Servers → Edit JSON. Same shape as Cursor. |
|
|
31
29
|
| **Any other stdio MCP client** | Point it at `npx -y @quackai/q402-mcp`. No client-specific code. |
|
|
32
30
|
|
|
33
|
-
|
|
31
|
+
Secrets are NOT in this config. The server reads them from `~/.q402/mcp.env` (same pattern as AWS / Stripe / gh CLIs).
|
|
34
32
|
|
|
35
33
|
<details>
|
|
36
34
|
<summary>Windows: <code>codex mcp add</code> returns "Access is denied"</summary>
|
|
37
35
|
|
|
38
|
-
|
|
36
|
+
Some Windows setups block `codex.exe` from writing its own config. Add the stanza to `~/.codex/config.toml` by hand:
|
|
39
37
|
|
|
40
38
|
```toml
|
|
41
39
|
[mcp_servers.q402]
|
|
@@ -49,34 +47,30 @@ Then restart Codex. Same effect as `codex mcp add q402 -- npx -y @quackai/q402-m
|
|
|
49
47
|
|
|
50
48
|
### 2. First-time setup
|
|
51
49
|
|
|
52
|
-
Restart your client,
|
|
53
|
-
|
|
54
|
-
> *"Set up Q402"*
|
|
50
|
+
Restart your client, ask: > *"Set up Q402"*
|
|
55
51
|
|
|
56
|
-
The agent
|
|
52
|
+
The agent runs `q402_doctor`. On first install:
|
|
57
53
|
|
|
58
|
-
1.
|
|
59
|
-
2.
|
|
60
|
-
3.
|
|
61
|
-
4. Restart
|
|
54
|
+
1. Creates `~/.q402/mcp.env` (placeholders)
|
|
55
|
+
2. Opens it in your editor
|
|
56
|
+
3. Walks you through pasting an API key + a signing path **into the file, not into chat**
|
|
57
|
+
4. Restart + re-run `q402_doctor` to verify
|
|
62
58
|
|
|
63
|
-
🔒 **
|
|
59
|
+
🔒 **Keys never paste into chat.** Local modes sign on your machine; the key never leaves the device. Mode C (server-managed) needs no PK on the client.
|
|
64
60
|
|
|
65
61
|
### Pick a signing mode
|
|
66
62
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
| Mode | Env you set | Signer | Notes |
|
|
63
|
+
| Mode | Env | Signer | Notes |
|
|
70
64
|
|---|---|---|---|
|
|
71
|
-
| **A** | `Q402_PRIVATE_KEY` |
|
|
72
|
-
| **B** | `Q402_AGENTIC_PRIVATE_KEY` |
|
|
73
|
-
| **C** | (just an API key) |
|
|
65
|
+
| **A** | `Q402_PRIVATE_KEY` | MetaMask EOA, local | Simplest. Shows "Smart account" after first use (reversible via `q402_clear_delegation`). |
|
|
66
|
+
| **B** | `Q402_AGENTIC_PRIVATE_KEY` | Agent Wallet, local | Export PK from the [dashboard](https://q402.quackai.ai/dashboard) Agent tab. MetaMask untouched. |
|
|
67
|
+
| **C** | (just an API key) | Agent Wallet, server-managed | No PK on the client. One-shot pays accept Trial or Multichain keys; recurring needs Multichain on every chain (BNB included). |
|
|
74
68
|
|
|
75
|
-
When more than one
|
|
69
|
+
When more than one mode is set, `q402_pay` asks the user which to use. Picker: `walletMode = "agentic-server" \| "agentic-local" \| "eoa"`.
|
|
76
70
|
|
|
77
71
|
### Manual setup (no AI)
|
|
78
72
|
|
|
79
|
-
Create `~/.q402/mcp.env` yourself
|
|
73
|
+
Create `~/.q402/mcp.env` yourself with the template below. Live mode only flips when an API key + a signing path are populated, so saving the template as-is stays in sandbox. `Q402_ENABLE_REAL_PAYMENTS=0` forces sandbox even with real keys.
|
|
80
74
|
|
|
81
75
|
```bash
|
|
82
76
|
# ~/.q402/mcp.env
|
|
@@ -157,52 +151,43 @@ Then export the values in `~/.zshrc` / `~/.bashrc`. See the [Codex config refere
|
|
|
157
151
|
|
|
158
152
|
---
|
|
159
153
|
|
|
160
|
-
## Wallet modes — which signing path?
|
|
161
|
-
|
|
162
|
-
Three signing paths. Pick one when `q402_doctor` asks on first install. You can change later by editing `~/.q402/mcp.env` and restarting your client.
|
|
163
|
-
|
|
164
|
-
| Mode | Best for | Env to set | Private key in env? |
|
|
165
|
-
|---|---|---|---|
|
|
166
|
-
| **C — Server-managed** (recommended) | Most users. AI agents, automations, anyone who wants payments to "just work". Q402 holds an encrypted Agent Wallet for you; no MetaMask popup, no Smart-account marker. One-shot pays accept either key; **recurring schedules require the paid Multichain key on every chain (BNB included)**. | `Q402_MULTICHAIN_API_KEY` (paid, full surface) **or** `Q402_TRIAL_API_KEY` (free BNB, one-shot only) | **No** |
|
|
167
|
-
| **B — Local Agent Wallet PK** | You want Agent Wallet automation but prefer to hold the PK yourself. Export from the dashboard once. MCP signs locally — key never leaves your machine. Your MetaMask is never touched. | `Q402_AGENTIC_PRIVATE_KEY` + an API key | Yes (Agent Wallet's exported PK) |
|
|
168
|
-
| **A — Your own EOA** | Power users who want their existing MetaMask address to be the on-chain payer. Your EOA signs directly via EIP-7702; the "Smart account" marker after first use is normal + reversible with `q402_clear_delegation`. **Use a fresh wallet.** | `Q402_PRIVATE_KEY` + an API key | Yes (your EOA's PK) |
|
|
169
|
-
|
|
170
|
-
`q402_doctor` on first install reads your env and recommends one of these based on what's already configured. The default for an empty install is Mode C — simplest path. If multiple modes are configured at once (e.g. both `Q402_PRIVATE_KEY` and `Q402_AGENTIC_PRIVATE_KEY` set), `q402_pay` will ask which one to use before sending so the agent never silently picks the wrong wallet.
|
|
171
|
-
|
|
172
|
-
---
|
|
173
|
-
|
|
174
154
|
## Tools exposed
|
|
175
155
|
|
|
156
|
+
**16 tools** — read-only by default; live mode needs an API key + signing path + `Q402_ENABLE_REAL_PAYMENTS=1`.
|
|
157
|
+
|
|
176
158
|
| Tool | Auth | Purpose |
|
|
177
159
|
|---|---|---|
|
|
178
|
-
| `q402_doctor` | none |
|
|
179
|
-
| `q402_quote` | none | Compare gas
|
|
180
|
-
| `q402_balance` |
|
|
181
|
-
| `q402_pay` |
|
|
182
|
-
| `q402_batch_pay` |
|
|
183
|
-
| `q402_receipt` | none |
|
|
184
|
-
| `q402_wallet_status` | private key | Per-chain EIP-7702
|
|
185
|
-
| `
|
|
186
|
-
| `
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
`
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
>
|
|
160
|
+
| `q402_doctor` | none | First-install onboarding + ongoing health check (per-scope quota, EIP-7702 state, relay reachability, slot-mismatch warnings). |
|
|
161
|
+
| `q402_quote` | none | Compare gas + supported tokens across chains. |
|
|
162
|
+
| `q402_balance` | api key | Verify key + remaining quota. |
|
|
163
|
+
| `q402_pay` | live mode | Single-recipient gasless transfer. Sandbox by default. |
|
|
164
|
+
| `q402_batch_pay` | live mode | Up to 20 recipients per call (trial: 5). Same auto-routing as `q402_pay`. 6+ BNB batches with Trial set return `status="ambiguous"` so the agent asks how to split. xlayer + stable not batchable — use `q402_pay` in a loop. |
|
|
165
|
+
| `q402_receipt` | none | Fetch + locally verify a Trust Receipt (`rct_…` id, ECDSA against the relayer EOA). |
|
|
166
|
+
| `q402_wallet_status` | private key | Per-chain EIP-7702 state for the EOA derived from `Q402_PRIVATE_KEY`. |
|
|
167
|
+
| `q402_clear_delegation` | private key | Clear EIP-7702 delegation; Q402 sponsors the on-chain TX. |
|
|
168
|
+
| `q402_agentic_info` | api key | Agent Wallet info (addresses, per-wallet caps, daily-spend used, ERC-8004 id). Drives Mode C. |
|
|
169
|
+
| `q402_recurring_list` | api key | List scheduled rules. |
|
|
170
|
+
| `q402_recurring_create` | api key | Author a recurring rule. Paid Multichain on EVERY chain (BNB included). |
|
|
171
|
+
| `q402_recurring_fires` | api key | Last 50 fires per rule (timestamp + txHashes + amount). |
|
|
172
|
+
| `q402_recurring_pause` | api key | Pause a rule (reversible). |
|
|
173
|
+
| `q402_recurring_resume` | api key | Resume a paused / stopped rule. |
|
|
174
|
+
| `q402_recurring_skip_next` | api key | Skip only the next scheduled fire. |
|
|
175
|
+
| `q402_recurring_cancel` | api key | Permanently stop a rule. |
|
|
176
|
+
|
|
177
|
+
`q402_pay` + `q402_batch_pay` require explicit in-chat confirmation. Batch confirmation = full batch, not per-row.
|
|
178
|
+
|
|
179
|
+
> ℹ️ `q402_pay` expects a 0x address — ENS isn't resolved server-side. Resolve client-side first.
|
|
180
|
+
> Per-chain Gas Tank balances + full TX history live in the [dashboard](https://q402.quackai.ai/dashboard) (wallet-signature only).
|
|
198
181
|
|
|
199
182
|
---
|
|
200
183
|
|
|
201
184
|
## Sandbox vs live mode
|
|
202
185
|
|
|
203
|
-
|
|
186
|
+
**Sandbox default**: `q402_pay` returns a fake `txHash` with `success: false` and `sandbox: true`. No funds, no quota.
|
|
204
187
|
|
|
205
|
-
|
|
188
|
+
**Live** = (a) live API key (`q402_live_*`), (b) a signing path (A / B / C), (c) `Q402_ENABLE_REAL_PAYMENTS=1`. The live flag defaults to `1` — gate only flips when both other conditions are met. Set to `0` to force sandbox even with real keys.
|
|
189
|
+
|
|
190
|
+
Template `q402_doctor` writes to `~/.q402/mcp.env`:
|
|
206
191
|
|
|
207
192
|
```bash
|
|
208
193
|
# ── API key — fill ONE (or both for auto-routing) ──
|
|
@@ -233,18 +218,16 @@ Q402_ENABLE_REAL_PAYMENTS=1
|
|
|
233
218
|
|
|
234
219
|
Anything missing for the resolved scope → automatic sandbox fallback with a hint pointing at what to set.
|
|
235
220
|
|
|
236
|
-
> ⚠️
|
|
221
|
+
> ⚠️ Sandbox responses carry `success: false`, `sandbox: true`, `mode: "sandbox"`, `method: "sandbox"`, plus a `setupHint` explaining why — four signals so a downstream summary can't claim success.
|
|
237
222
|
|
|
238
223
|
### Hard caps
|
|
239
224
|
|
|
240
|
-
Two additional guards run before every payment regardless of mode:
|
|
241
|
-
|
|
242
225
|
| Env var | Default | Effect |
|
|
243
226
|
|---|---|---|
|
|
244
|
-
| `Q402_MAX_AMOUNT_PER_CALL` | `200` | Reject
|
|
245
|
-
| `Q402_ALLOWED_RECIPIENTS` |
|
|
227
|
+
| `Q402_MAX_AMOUNT_PER_CALL` | `200` | Reject calls with `amount > N` USD. |
|
|
228
|
+
| `Q402_ALLOWED_RECIPIENTS` | off | Comma-separated address allowlist. |
|
|
246
229
|
|
|
247
|
-
Combined with
|
|
230
|
+
Combined with `confirm: true` + live-mode env, a payment needs: chat OK + amount ≤ cap + recipient allowed + all 3 live envs.
|
|
248
231
|
|
|
249
232
|
---
|
|
250
233
|
|
package/dist/index.js
CHANGED
|
@@ -211,7 +211,7 @@ var isValidPrivateKey = (s) => typeof s === "string" && PRIVATE_KEY_RE.test(s);
|
|
|
211
211
|
|
|
212
212
|
// src/version.ts
|
|
213
213
|
var PACKAGE_NAME = "@quackai/q402-mcp";
|
|
214
|
-
var PACKAGE_VERSION = "0.7.
|
|
214
|
+
var PACKAGE_VERSION = "0.7.2";
|
|
215
215
|
|
|
216
216
|
// src/tools/quote.ts
|
|
217
217
|
import { z } from "zod";
|
|
@@ -2700,7 +2700,7 @@ var RECURRING_CREATE_TOOL = {
|
|
|
2700
2700
|
chain: {
|
|
2701
2701
|
type: "string",
|
|
2702
2702
|
enum: ["bnb", "eth", "avax", "xlayer", "mantle", "injective", "monad", "scroll", "stable"],
|
|
2703
|
-
description: "Default 'bnb'.
|
|
2703
|
+
description: "Default 'bnb'. Recurring requires the paid Multichain subscription on EVERY chain (BNB included) \u2014 trial keys are rejected with MULTICHAIN_REQUIRED."
|
|
2704
2704
|
},
|
|
2705
2705
|
token: {
|
|
2706
2706
|
type: "string",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quackai/q402-mcp",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.2",
|
|
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": [
|