
Q402 Mcp
io.github.quackai-org由 GitHub 帳號 quackai-org 發布v0.11.34更新於 Nov 3, 2026
Q402 - 在12條EVM鏈上提供無gas支付、收益、託管、跨鏈橋和NAV觸發器。預設沙盒。
AI 翻譯由 AI 模型根據下方的原文描述翻譯,可能有誤。
原文描述
Q402 - gasless payments, yield, escrow, bridge & NAV triggers on 12 EVM chains. Sandbox-default.
概覽
Q402 的本機 MCP 服務;無需登入;STDIO。
暫無 AI 概覽:以下資訊來自註冊中心條目和服務本身。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Q402 Mcp,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
@quackai/q402-mcp
MCP server for Q402 - gasless USDC, USDT, RLUSD, and USDG payments across 12 EVM chains (USDG on Robinhood Chain), callable from Claude (Desktop / Code), OpenAI Codex CLI, and any other Model Context Protocol client.
Free trial available. 500 gasless transactions on BNB Chain + Base (USDC + USDT), no card. One wallet signature: https://q402.quackai.ai. Limited-time bonus: Mantle (USDC + USDT) is also covered by trial keys during 2026-08-21~08-28 UTC+9.
Trial-scope policy: API keys minted under the free-trial program (
plan: "trial") settle on BNB Chain (USDC/USDT gasless) and Base (USDC/USDT gasless) as permanent chains. Avalanche trial has ended — use a Multichain key for avax. Mantle (USDC/USDT gasless) is covered during the limited-time window 2026-08-21~08-28 UTC+9 — server-side time enforcement, returnsTRIAL_BNB_ONLYoutside the window. Paid API keys see the full 12-chain matrix at all times.
Quote → route → (optional) settle stablecoin payments across 12 EVM chains, from any MCP client. Recipient gets the full amount; sender pays $0 gas via Q402's EIP-7702 relayer.
Quick start
- Register the server with your client (one-line per client).
- Say "Set up Q402" to your agent. It runs
q402_doctor→ creates~/.q402/mcp.env→ walks you through pasting keys.
1. Register the server
Hermes Agent - YAML config (~/.hermes/config.yaml)
Hermes reads MCP servers from ~/.hermes/config.yaml under mcp_servers (YAML, not JSON):
After editing, run /reload-mcp in Hermes to load the tools. Or use the CLI: hermes mcp add q402 --command npx --args -y @quackai/q402-mcp.
Claude Code (the CLI,
claudebinary) and Claude Desktop (the macOS / Windows app) are different products. Theclaude mcp addcommand only exists in the CLI; the Desktop app needs the JSON config above.
Secrets are NOT in this config. The server reads them from ~/.q402/mcp.env (same pattern as AWS / Stripe / gh CLIs).
Windows: codex mcp add returns "Access is denied"
Some Windows setups block codex.exe from writing its own config. Add the stanza to ~/.codex/config.toml by hand:
Then restart Codex. Same effect as codex mcp add q402 -- npx -y @quackai/q402-mcp.
2. First-time setup
Restart your client, ask: > "Set up Q402"
The agent runs q402_doctor. On first install:
- Creates
~/.q402/mcp.env(placeholders) - Opens it in your editor
- Walks you through pasting an API key + a signing path into the file, not into chat
- Restart + re-run
q402_doctorto verify
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.
Pick a signing mode
When more than one mode is set, q402_pay asks the user which to use. Picker: walletMode = "agentic-server" \| "agentic-local" \| "eoa".
Manual setup (no AI)
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.
Then chmod 600 ~/.q402/mcp.env (Unix) and restart your client. That's the full configuration. Heads up on the EIP-7702 side effect: after your first live payment on a chain, your wallet will show 'Smart account' in MetaMask / OKX - that's the delegation Q402 uses for gasless settlement, reversible anytime via q402_clear_delegation. Important for x402 users: if EIP-7702 delegation is active on an older implementation, q402_x402_fetch cannot sign x402 payments until you call q402_clear_delegation (gasless on Base, reversible — the next q402_pay re-delegates automatically). Wallets delegated to the current ERC-1271-capable implementation work normally.
Advanced - explicit env injection
If you'd rather skip the file and inject env vars yourself (e.g. via Codex env_vars allow-list, a secrets manager, or shell exports), the server falls through to process.env - and process.env wins over file values on conflicts. So existing shell-export setups keep working unchanged.
Codex env_vars allow-list example
Then export the values in ~/.zshrc / ~/.bashrc. See the Codex config reference for the full schema.
Try it without any setup
q402_quote works with zero configuration - no API key, no private key, no env file. Ask:
"Compare gas costs to send 50 USDC to vitalik.eth across all 12 Q402 chains."
Q402_RELAY_BASE_URLoverrides the relay endpoint. Set it explicitly when running against a self-hosted Q402 deployment or a non-canonical environment.
Tools exposed
52 tools, grouped by capability. Read-only by default; live mode needs a live API key, a signing path, and Q402_ENABLE_REAL_PAYMENTS=1. Rows marked live mode move funds and need an explicit in-chat confirmation.
q402_pay + q402_batch_pay + q402_bridge_send + q402_yield_deposit + q402_yield_withdraw + q402_yield_cancel + q402_stake + q402_unstake + q402_request_pay + q402_token_launch + q402_token_trade require explicit in-chat confirmation. Batch confirmation = full batch, not per-row.
Note:
q402_payexpects a 0x address; ENS is not resolved server-side, so resolve it client-side first. Per-chain Gas Tank balances + full TX history live in the dashboard (wallet-signature only).
x402 outbound payments (q402_x402_fetch)
q402_x402_fetch is a general-purpose x402 client. It fetches any URL and handles HTTP 402 payment-required responses automatically. When the server returns a non-402 status, the response passes through unchanged, so it also works as a regular fetch tool.
What it solves. Some APIs and content endpoints use the x402 protocol to charge per-request. An agent hitting such a URL receives an HTTP 402 response with machine-readable payment requirements. q402_x402_fetch reads those requirements, validates the payment option, signs an EIP-3009 TransferWithAuthorization against Base USDC, encodes it as a base64 JSON payload, and retries the request — using PAYMENT-SIGNATURE for x402 v2 servers and X-PAYMENT for legacy v1 servers — all in one call.
Supported. scheme=exact + network=base (CAIP-2 eip155:8453; also accepted: base-mainnet) + Base USDC only. Any other scheme, network, or asset returns an explicit rejection and no signature is produced.
Guards (three layers).
Two-phase consent flow: the first call (without consentToken) returns needs_confirmation with a preview quoting the exact amount and recipient plus a consentToken. Present the quote to the user verbatim and wait for their next independent message confirming payment. Only then re-call with the same arguments plus the consentToken. The token is single-use, expires in ~120 seconds, and is rejected if consumed within 2 seconds of issuance (same-round double-call protection: a timing threshold, not a proof of human confirmation). Never re-call in the same conversation turn without a separate user confirmation message.
Result outcomes — read before summarizing to users.
Audit. Every 402 attempt — settled, settled_no_delivery, settled_status_unknown, or blocked — is written to the local audit log at ~/.q402/x402-audit.json and surfaced in q402_agent_spend_report. Both settled_no_delivery and settled_status_unknown outcomes count as spend in the report.
Minimum working example.
If the endpoint returns 402, the tool responds with needs_confirmation and a consentToken. Present the quote to the user verbatim and wait for their next independent message. Re-call with those same arguments plus the consentToken to authorize payment. The token is single-use and expires in ~120 seconds.
Requirements. Q402_ENABLE_REAL_PAYMENTS=1 plus a local signing key (Q402_AGENTIC_PRIVATE_KEY or Q402_PRIVATE_KEY). The signed authorization goes directly to the seller's facilitator endpoint; the Q402 relay is not involved in this path.
Prerequisite — delegation check. If you have previously called q402_pay on this wallet, it may be EIP-7702-delegated (shown as 'Smart account' in MetaMask / OKX). If delegated to an older implementation, q402_x402_fetch will fail. Wallets delegated to the current ERC-1271-capable implementation work normally. Recovery: call q402_clear_delegation (gasless on Base, reversible). After clearing, q402_x402_fetch works again. The next q402_pay re-delegates automatically.
Governance analysis (q402_governance_analyze)
q402_governance_analyze analyzes a Snapshot governance proposal and returns a vote recommendation, five dimension scores, and the reasoning. $0.05 USDC per call on Base via x402.
Input parameters.
Language-aware results. When language: "zh" is set, the vote recommendation, dimension names, ratings, and reasoning text are all presented in Chinese, with no English enum values shown to the user.
Sandbox vs live mode
Sandbox default: q402_pay returns a fake txHash with success: false and sandbox: true. No funds, no quota.
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.
Template q402_doctor writes to ~/.q402/mcp.env:
Anything missing for the resolved scope → automatic sandbox fallback with a hint pointing at what to set.
Sandbox responses carry
success: false,sandbox: true,mode: "sandbox",method: "sandbox", plus asetupHintexplaining why - four signals so a downstream summary can't claim success.
Hard caps
Combined with the two-phase consentToken + live-mode env, a stablecoin payment needs: a preview the user approved in a separate message + amount ≤ cap + recipient allowed + all 3 live envs. The consent token is single-use and expires in ~120 seconds; consuming it within 2 seconds of issuance triggers the same-round double-call gate (threshold, not a guarantee of human confirmation). Q (QuackAI) is exempt from the cap (your own token); the preview, recipient allowlist, and live-mode env still apply to it.
Configuration reference
Migrating from legacy single-key setups
If you set up Q402 before v0.5.0 you may have a single Q402_API_KEY env var. The server still resolves that silently - your existing integration won't break. New installs should use the two-key model above (Q402_TRIAL_API_KEY and/or Q402_MULTICHAIN_API_KEY); q402_doctor and the rest of the docs only guide users to those two. To migrate, rename your existing var to Q402_MULTICHAIN_API_KEY in ~/.q402/mcp.env and restart your MCP client.
Supported chains
Why this exists
AI agents are becoming the default interface for software, but the moment they need to move money the stack breaks: holding gas tokens, signing every transaction, managing wallets across many chains. None of that scales when the agent is supposed to act on its own.
Q402 is the payment layer for that gap. A single signing primitive (EIP-712 + EIP-7702) settles gasless stablecoin payments across 12 EVM chains, with an ECDSA-signed Trust Receipt for every transaction. The MCP package exposes that surface inside Claude, Codex, Cursor, and Cline - your agent can quote, send, batch, and audit payments from a natural-language prompt.
Single transfers and multi-recipient batches ship today. The next layer - recurring payouts, conditional execution, and policy-gated treasury automation - is the same primitive composed differently. We're building toward agents that operate real budgets, settle among themselves, and move value through workflows no human triggers manually.
Hooks - programmable payment policies
Q402 Hooks 1.0 is a policy engine that attaches rules to the payment lifecycle: OFAC compliance screening, spend caps + recipient allowlists, ERC-8004 reputation gating, Chainlink-oracle conditional settlement ("only when BTC ≥ $80k"), and automatic multi-payee splits - plus an approval-required soft block for large payments (returns 202 approval_required; the caller re-submits out of band, no stored hold in v1). Uniswap v4 brought programmable hooks to DEX liquidity; Q402 brings them to AI-agent payments.
Developer reference: docs/HOOKS.md - lifecycle, the Hook contract, every shipped hook with config + examples.
Escrow on Base: docs/ESCROW-VS-INSTANT.md - instant vs. escrowed payment decision guide for agents. docs/ESCROW-BASE-DEPLOY-RUNBOOK.md - engineering runbook for Base mainnet vault deploy (hands-only, not for agents).
Repository
Source code: https://github.com/quackai-org/q402-mcp Issues / requests: https://github.com/quackai-org/q402-mcp/issues
License
Apache-2.0 - see LICENSE.
來源:README.md,提交 96297a2
工具
0版本歷史
3- v0.11.34最新Nov 3, 2026
- v0.11.33Oct 29, 2026
- v0.11.23Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分