@quackai/q402-mcp 0.4.4 → 0.4.5
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 +8 -4
- package/dist/index.js +5 -5
- package/package.json +6 -2
package/README.md
CHANGED
|
@@ -76,7 +76,7 @@ command = "npx"
|
|
|
76
76
|
args = ["-y", "@quackai/q402-mcp"]
|
|
77
77
|
startup_timeout_sec = 20.0
|
|
78
78
|
env = {
|
|
79
|
-
# Two-key model (v0.4.
|
|
79
|
+
# Two-key model (v0.4.5+): set whichever applies — both is best.
|
|
80
80
|
# The server auto-routes by chain: BNB → trial key, else multichain key.
|
|
81
81
|
# Both keys use the same q402_live_ prefix — the env var name is what
|
|
82
82
|
# carries the scope, not the key string. Get the values from the
|
|
@@ -133,14 +133,14 @@ By default the MCP server operates in **sandbox mode**: `q402_pay` returns a det
|
|
|
133
133
|
To enable real on-chain transactions, the resolved API key must be live (`q402_live_*`), `Q402_PRIVATE_KEY` must be set, and `Q402_ENABLE_REAL_PAYMENTS=1`:
|
|
134
134
|
|
|
135
135
|
```bash
|
|
136
|
-
# Two-key model (v0.4.
|
|
136
|
+
# Two-key model (v0.4.5+) — set whichever applies. Both is best.
|
|
137
137
|
# Auto-routing: chain="bnb" → trial key (if set), otherwise multichain key.
|
|
138
138
|
# Override per call with keyScope: "auto" | "trial" | "multichain".
|
|
139
139
|
Q402_TRIAL_API_KEY=q402_live_... # BNB-only sponsored Trial key (from /event)
|
|
140
140
|
Q402_MULTICHAIN_API_KEY=q402_live_... # paid 8-chain key (per-chain Gas Tank)
|
|
141
141
|
|
|
142
142
|
# Legacy fallback. Used for both scopes when the two above are unset —
|
|
143
|
-
# pre-v0.4.
|
|
143
|
+
# pre-v0.4.5 users keep working without any config change.
|
|
144
144
|
Q402_API_KEY=q402_live_...
|
|
145
145
|
|
|
146
146
|
Q402_PRIVATE_KEY=0xabc... # signer for the payer EOA
|
|
@@ -149,6 +149,10 @@ Q402_ENABLE_REAL_PAYMENTS=1 # explicit opt-in
|
|
|
149
149
|
|
|
150
150
|
Anything missing for the resolved scope → automatic sandbox fallback with a hint pointing at what to set.
|
|
151
151
|
|
|
152
|
+
> ⚠️ **Sandbox returns a deterministic-looking fake `txHash` and a synthetic success result.** A user who *expected* a live transfer (e.g. forgot to set `Q402_ENABLE_REAL_PAYMENTS=1`, mis-typed a scoped env var, or hit an impossible chain×scope combination like `keyScope: "trial"` + `chain: "monad"`) gets a "success" back and may believe funds actually moved.
|
|
153
|
+
>
|
|
154
|
+
> Two-layer mitigation: every sandbox response carries a `setupHint` field on the tool result describing **exactly why** sandbox was selected, and the `q402_balance` tool's `apiKeyKind: "missing"` makes the same diagnosis explicit. Always check `setupHint` on the first call from a new install. The deterministic `txHash` pattern (`0x` + 64 hex derived from `keccak256(chain, to, amount, token, "sandbox")`) is intentional so the agent can recognise it post-hoc, but the safer habit is to inspect `setupHint` before showing the user a success message.
|
|
155
|
+
|
|
152
156
|
### Hard caps
|
|
153
157
|
|
|
154
158
|
Two additional guards run before every payment regardless of mode:
|
|
@@ -168,7 +172,7 @@ Combined with the `confirm: true` argument the tool requires, this means the mod
|
|
|
168
172
|
|---|---|---|
|
|
169
173
|
| `Q402_TRIAL_API_KEY` | live-pay (BNB) | BNB-only sponsored Trial key. Free at https://q402.quackai.ai/event. Used automatically for `chain="bnb"` when set. |
|
|
170
174
|
| `Q402_MULTICHAIN_API_KEY` | live-pay (8-chain) | Paid 8-chain key. Get one at https://q402.quackai.ai/payment. Used for all non-BNB chains and for BNB when no Trial key is set. |
|
|
171
|
-
| `Q402_API_KEY` | legacy fallback | Pre-v0.4.
|
|
175
|
+
| `Q402_API_KEY` | legacy fallback | Pre-v0.4.5 single-env path. Used for both scopes when the two above are unset. Keep set if you only have one key. |
|
|
172
176
|
| `Q402_PRIVATE_KEY` | live-pay | Signer for the payer EOA. **Never share. Never paste in chat.** |
|
|
173
177
|
| `Q402_ENABLE_REAL_PAYMENTS` | live-pay | Set to `1` to opt in. Any other value (or unset) → sandbox. |
|
|
174
178
|
| `Q402_MAX_AMOUNT_PER_CALL` | optional | USD-equivalent cap. Defaults to `5`. |
|
package/dist/index.js
CHANGED
|
@@ -230,7 +230,7 @@ var CHAIN_CONFIG = {
|
|
|
230
230
|
}
|
|
231
231
|
};
|
|
232
232
|
var BNB_FOCUS_MODE = false;
|
|
233
|
-
var BNB_FOCUS_REJECTION_MESSAGE = 'BNB-
|
|
233
|
+
var BNB_FOCUS_REJECTION_MESSAGE = 'BNB-only mode active: this chain/token is temporarily hidden. Full multi-chain support is the normal state. Pass chain: "bnb" with token "USDC" or "USDT".';
|
|
234
234
|
if (BNB_FOCUS_MODE) {
|
|
235
235
|
for (const key of CHAIN_KEYS) {
|
|
236
236
|
if (key !== "bnb") {
|
|
@@ -839,10 +839,10 @@ function maxAmountGuardBatch(recipients, cap) {
|
|
|
839
839
|
function recipientAllowlistGuardBatch(recipients, allow) {
|
|
840
840
|
if (allow.length === 0) return;
|
|
841
841
|
for (let i = 0; i < recipients.length; i++) {
|
|
842
|
-
const
|
|
843
|
-
if (!allow.includes(to)) {
|
|
842
|
+
const r = recipients[i];
|
|
843
|
+
if (!allow.includes(r.to.toLowerCase())) {
|
|
844
844
|
throw new Error(
|
|
845
|
-
`recipients[${i}]: ${
|
|
845
|
+
`recipients[${i}]: ${r.to} is not in Q402_ALLOWED_RECIPIENTS. Either add this address to the allowlist or unset the env var to disable the guard.`
|
|
846
846
|
);
|
|
847
847
|
}
|
|
848
848
|
}
|
|
@@ -1221,7 +1221,7 @@ var RECEIPT_TOOL = {
|
|
|
1221
1221
|
|
|
1222
1222
|
// src/index.ts
|
|
1223
1223
|
var PACKAGE_NAME = "@quackai/q402-mcp";
|
|
1224
|
-
var PACKAGE_VERSION = "0.4.
|
|
1224
|
+
var PACKAGE_VERSION = "0.4.5";
|
|
1225
1225
|
function jsonText(value) {
|
|
1226
1226
|
return { type: "text", text: JSON.stringify(value, null, 2) };
|
|
1227
1227
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quackai/q402-mcp",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.5",
|
|
4
4
|
"description": "MCP server for Q402 — gasless USDC, USDT, and RLUSD payments across 8 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": [
|
|
@@ -40,7 +40,8 @@
|
|
|
40
40
|
"scripts": {
|
|
41
41
|
"build": "tsup",
|
|
42
42
|
"dev": "tsup --watch",
|
|
43
|
-
"
|
|
43
|
+
"lint": "tsc --noEmit",
|
|
44
|
+
"prepublishOnly": "npm run lint && npm run build",
|
|
44
45
|
"start": "node dist/index.js"
|
|
45
46
|
},
|
|
46
47
|
"dependencies": {
|
|
@@ -65,5 +66,8 @@
|
|
|
65
66
|
"author": "David Lee <davidlee@quackai.ai>",
|
|
66
67
|
"publishConfig": {
|
|
67
68
|
"access": "public"
|
|
69
|
+
},
|
|
70
|
+
"overrides": {
|
|
71
|
+
"ws": "^8.20.1"
|
|
68
72
|
}
|
|
69
73
|
}
|