q402 无 Gas 支付 MCP配置与使用教程
io.github.quackai-org/q402-mcp · v0.11.33
Q402——在 12 条 EVM 链上提供无 Gas 支付、收益、托管、跨链与 NAV 触发,默认使用沙箱。
原文名称:q402-mcp
原文描述:Q402 - gasless payments, yield, escrow, bridge & NAV triggers on 12 EVM chains. Sandbox-default.
建议先在本页复制安装配置,再到上游核对文档与权限。
产品介绍
Q402——在 12 条 EVM 链上提供无 Gas 支付、收益、托管、跨链与 NAV 触发,默认使用沙箱。 q402 无 Gas 支付 是一个MCP Server,收录自 官方 MCP Registry。支持 stdio 传输。本页提供产品介绍、配置教程、安装命令与适用场景,支持 Trae、通义灵码、Cursor、Claude Code、VS Code 等。
适用场景
AgentHub Verified 可用性验证技术测试通过
自动化测试流水线已校验安装命令、传输协议与客户端兼容性
按平台快速复制
选择你的平台查看安装方式
- 打开项目根目录下的 .cursor/mcp.json(没有就新建)
- 点击「复制配置」粘贴进去;若已有其他 MCP,只合并 mcpServers 里的本条目
- 将 env 中的 <占位符> 替换为真实密钥(见下方「环境变量」)
- 保存后按 Cmd+Shift+P(Windows:Ctrl+Shift+P)→ 输入 Reload Window 并执行
预填环境变量与密钥(可选)
{
"mcpServers": {
"q402-mcp": {
"command": "npx",
"args": [
"-y",
"@quackai/q402-mcp"
]
}
}
}配置教程
- 打开 q402 无 Gas 支付 详情页,确认这是你需要的 MCP Server(来源 官方 MCP Registry)。
- 按客户端选择 Trae、通义灵码、Cursor、Claude Code 或 VS Code,复制 JSON 配置或 CLI 命令。
- 将配置合并进 mcpServers,并把环境变量占位符替换为真实密钥。
- 重载窗口后,在 Agent 对话中调用该 MCP 提供的工具。
安装命令
以下安装命令与配置步骤已写入页面 HTML,搜索引擎与未启用 JavaScript 的浏览器均可直接读取。
Claude Code(本地)
- 确保已安装 Claude Code CLI
- 复制下方命令,将 <占位符> 替换为真实环境变量值后,在终端执行
- 若下方列出了环境变量,请对照填写
claude mcp add q402-mcp -- npx -y @quackai/q402-mcpCursor — .cursor/mcp.json(本地)
- 打开项目根目录下的 .cursor/mcp.json(没有就新建)
- 点击「复制配置」粘贴进去;若已有其他 MCP,只合并 mcpServers 里的本条目
- 将 env 中的 <占位符> 替换为真实密钥(见下方「环境变量」)
- 保存后按 Cmd+Shift+P(Windows:Ctrl+Shift+P)→ 输入 Reload Window 并执行
{
"mcpServers": {
"q402-mcp": {
"command": "npx",
"args": [
"-y",
"@quackai/q402-mcp"
]
}
}
}VS Code — .vscode/mcp.json(本地)
- 确保 VS Code 已安装 GitHub Copilot 扩展并支持 MCP
- 打开项目根目录下的 .vscode/mcp.json(没有就新建)
- 点击「复制配置」粘贴;若已有其他 MCP,只合并 mcpServers 里的本条目
- 将 env 中的 <占位符> 替换为真实密钥(见下方「环境变量」)
- 保存后重新加载 VS Code 窗口
{
"mcpServers": {
"q402-mcp": {
"command": "npx",
"args": [
"-y",
"@quackai/q402-mcp"
]
}
}
}Claude Desktop — claude_desktop_config.json(本地)
- 打开 Claude Desktop 的 claude_desktop_config.json(路径见远程指引)
- 点击「复制配置」合并到 mcpServers
- 将 env 中的 <占位符> 替换为真实密钥
- 完全退出并重启 Claude Desktop
{
"mcpServers": {
"q402-mcp": {
"command": "npx",
"args": [
"-y",
"@quackai/q402-mcp"
]
}
}
}Trae — .trae/mcp.json(本地)
- 打开 Trae → 设置 → MCP,或编辑 .trae/mcp.json / 全局 mcp.json
- 点击「复制配置」粘贴并合并 mcpServers
- 将 env 中的 <占位符> 替换为真实密钥
- 保存后重载 Trae 窗口
{
"mcpServers": {
"q402-mcp": {
"command": "npx",
"args": [
"-y",
"@quackai/q402-mcp"
]
}
}
}Cherry Studio — MCP 设置(本地)
- 打开 Cherry Studio → 设置 → MCP 服务器 → 添加(STDIO)
- 也可直接导入下方 JSON:点击「复制配置」合并到 mcpServers
- 将 env 中的 <占位符> 替换为真实密钥,并确保本机已安装 Node.js / uv(npx、uvx)
- 启用服务并查看工具列表是否加载成功
{
"mcpServers": {
"q402-mcp": {
"command": "npx",
"args": [
"-y",
"@quackai/q402-mcp"
]
}
}
}通义灵码 — MCP 配置(本地)
- 通义灵码:个人设置 → MCP 服务 → 「+」→ 手工添加(STDIO)或配置文件添加
- 点击「复制配置」合并 mcpServers;命令/参数/环境变量与 JSON 一致
- 将 env 中的 <占位符> 替换为真实密钥;本机需 Node.js 18+(npx)或已安装 uv(uvx)
- 确认服务状态为已连接后再在智能体对话中调用
{
"mcpServers": {
"q402-mcp": {
"command": "npx",
"args": [
"-y",
"@quackai/q402-mcp"
]
}
}
}Windsurf — mcp_config.json(本地)
- 编辑 ~/.codeium/windsurf/mcp_config.json
- 点击「复制配置」合并 mcpServers(本地 stdio 与 Cursor 格式相同)
- 将 env 中的 <占位符> 替换为真实密钥后保存并刷新 Cascade
{
"mcpServers": {
"q402-mcp": {
"command": "npx",
"args": [
"-y",
"@quackai/q402-mcp"
]
}
}
}Cline — MCP Servers(本地)
- Cline 面板 → 设置 → MCP Servers
- 点击「复制配置」粘贴并合并
- 将 env 中的 <占位符> 替换为真实密钥后保存
{
"mcpServers": {
"q402-mcp": {
"command": "npx",
"args": [
"-y",
"@quackai/q402-mcp"
]
}
}
}WorkBuddy — .workbuddy/mcp.json(本地)
- 编辑 ~/.workbuddy/mcp.json(用户级)或项目目录 .workbuddy/mcp.json
- 也可在界面:插件 → MCP 服务器 → 配置 MCP,粘贴下方 JSON
- 将 env 中的 <占位符> 替换为真实密钥;Windows 下 command/脚本路径建议用绝对路径
- 保存并重启 WorkBuddy,确认连接器状态为绿色
{
"mcpServers": {
"q402-mcp": {
"command": "npx",
"args": [
"-y",
"@quackai/q402-mcp"
]
}
}
}常见报错排查与运行避坑 (Troubleshooting)FAQ
针对 q402 无 Gas 支付 在 Cursor、Claude Code 中的常见连接错误与解决办法
在 Cursor / Claude Code 中配置 q402-mcp 提示 connection closed 或 exit code 1?
通常由本地运行时环境缺失或命令路径未被 IDE 继承引起。排查步骤: 1. 确认已安装 Node.js 18+(支持 npx)或 Python 3.10+(支持 uvx); 2. 尝试在终端运行 which npx 或 which uvx,把配置文件中的 "command" 字段改为完整绝对路径; 3. 修改 mcp.json 后,必须完全重载或重启客户端窗口。
# 终端测试命令是否存在: which npx node -v
提示 spawn npx ENOENT 或 command not found?
这是因为编辑器后台进程未加载完整的终端环境变量(PATH)。解决方案:在全局安装该包(如 npm install -g 包名),或在配置文件中将 command 设置为系统的实际路径(如 Windows 下的 C:\Program Files\nodejs\npx.cmd,Mac 下的 /usr/local/bin/npx)。
提示 Missing required environment variable 或 API 认证失败?
q402-mcp 依赖环境变量(如 Q402_TRIAL_API_KEY、Q402_MULTICHAIN_API_KEY、Q402_PRIVATE_KEY、Q402_AGENTIC_PRIVATE_KEY、Q402_ENABLE_REAL_PAYMENTS、Q402_MAX_AMOUNT_PER_CALL、Q402_ALLOWED_RECIPIENTS、Q402_RELAY_BASE_URL、Q402_AGENT_WALLET_ADDRESS、Q402_API_KEY、Q402_WALLET_ID、Q402_BUILDER_CODE)。请在客户端配置文件的 "env" 对象中填入有效密钥,注意不要包含多余空格或未闭合的双引号。
// .cursor/mcp.json 或 claude_desktop_config.json
{
"env": {
"API_KEY": "your_actual_key_here"
}
}免安装模拟调用 (Playground)
仿真环境q402-mcp 核心接口调用仿真 · 无需配置本地环境,直接预览调用参数与返回格式
{
"target": "q402-mcp",
"action": "execute",
"options": {
"mode": "standard",
"timeoutMs": 5000
}
}点击上方「模拟运行」按钮
查看该工具在 Agent 内部的返回数据格式
选型与决策建议(为什么选它?)
帮助你快速判断该资源是否契合当前项目,避免盲目折腾
- PR 自动审查
- 生成 changelog
- 跨仓库 Issue 检索
- 替代人工安全审计
- 在无授权仓库上操作
q402-mcp + 对应场景 Prompt → 组成标准 Agent 自动化任务
MCP 实战教程:从安装到看见效果
按完整实例走一遍(含期望效果与对比验收)。装完本页资源后,用教程里的提示词核对是否真正生效。
相关资源
CoinVello
v0.1.1
io.github.CoinVello/coinvello
Non-custodial crypto payments: checkout sessions, invoices, webhooks and test payments. No KYC.
OwnSearch
v0.11.0
io.github.devops-infinity/ownsearch
Quality-ranked SearXNG search over MCP with local fleet state, scoring, and merged results.
mcp
v0.1.1
dev.x402check/mcp
Preflight x402 sellers before pay: ok|caution|avoid + history. Paid per tool.
Excel MCP Server
v2.2.5
io.github.haris-musa/excel-mcp-server
Create and edit Excel files with AI: charts, PivotTables, formulas. No Excel needed.
Табуля
v1.0.1
ru.tabulya/tabulya
Таблица с ИИ, Python и подключениями к базам данных и сервисам
LetsBot
v1.0.0
net.letsbot/mcp
WhatsApp Business messaging, live chat, chatbots, campaigns and CRM for a LetsBot workspace.
常搭配使用
中文公文写作
v2.0.46
io.clawhub.gongyu0918-debug/chinese-official-writing
用于中文公文、事务性材料和新闻稿件的起草、改写、压缩、润色、审校、文种核对、去口语化、降 AI 味及 Word 格式处理,适用于机关、企事业单位、学校和新闻机构。涵盖申请、请示、报告、通知、通告、意见、决定、决议、议案、公报、命令、函、复函、批复、说明、方案、纪要、公告、公示、通报、制度、规定、办法、细则、操作规程、工作要点、总结、调研、讲话、致辞、主持词、述职、可研、审查材料、技术需求、新闻消息、编者按、新闻评论,以及采购、整改、反馈和 AI 算力等场景。
ShieldCortex 记忆防护
v5.15.3
io.clawhub.jarvis-drakon/shieldcortex
AI Agent 的记忆与防御系统:语义回忆、知识图谱与记忆衰减,外加记忆防火墙——扫描并拦截提示注入、凭据泄露与记忆投毒。
Network-AI 本地编排
v5.17.1
io.clawhub.jovancoding/network-ai
本地 Python 编排技能:通过共享黑板文件实现多智能体工作流,附带权限门控、token 预算脚本与持久项目上下文。自带 Python 脚本不发起网络调用、零第三方依赖。父仓库另含一个 TypeScript 引擎(不包含在本技能包中)。
GitLab 智能体自我改进
v1.122.2
io.clawhub.xrowgmbh/xrowgmbh-self-improvement
一项用于个人成长与自我提升的技能。
继续逛 AgentHub
大多数人安装前还会对比同类工具或看场景方案——下面这些能帮你少走弯路。
收录徽章:把 AgentHub 挂到你的官网
复制下面任意一段代码到项目主页、官网或 GitHub README。徽章是 SVG 热链,无需上传文件,链接指向本页,访客可由此直接找到安装方式。
<a href="https://myagenthub.cn/p/io.github.quackai-org/q402-mcp" title="AgentHub 已收录:q402 无 Gas 支付" target="_blank" rel="noopener">
<img src="https://myagenthub.cn/badge/io.github.quackai-org/q402-mcp" alt="AgentHub 已收录:q402 无 Gas 支付" height="20" style="border:0"/>
</a>[](https://myagenthub.cn/p/io.github.quackai-org/q402-mcp)徽章由 /badge/<资源ID> 动态生成,名称与收录状态变化后自动更新;请保留链接指向,它是收录来源的判定依据。
统一 Manifest
{
"id": "io.github.quackai-org/q402-mcp",
"type": "mcp-server",
"version": "0.11.33",
"displayName": "q402-mcp",
"description": "Q402 - gasless payments, yield, escrow, bridge & NAV triggers on 12 EVM chains. Sandbox-default.",
"repository": {
"url": "https://github.com/quackai-org/q402-mcp",
"source": "github"
},
"distribution": {
"packages": [
{
"registryType": "npm",
"identifier": "@quackai/q402-mcp",
"version": "0.11.33",
"transport": "stdio",
"environmentVariables": [
{
"name": "Q402_TRIAL_API_KEY",
"description": "Recommended path: skip this UI and run `q402_doctor` after install - it stores secrets in ~/.q402/mcp.env, which the server auto-loads. Fill this field directly ONLY if your MCP client manages secrets for you. Value is a Free Trial API key from https://q402.quackai.ai/event - BNB Chain (permanent) + Base (permanent) + Mantle limited-time (2026-08-21~08-28 UTC+9), 500 sponsored TXs, gas covered by Q402. Avalanche trial has ended. BNB and Base payments auto-route to this key when set (same rule for q402_pay and q402_batch_pay up to 5 recipients).",
"isSecret": true
},
{
"name": "Q402_MULTICHAIN_API_KEY",
"description": "Recommended path: skip this UI and run `q402_doctor` after install - it stores secrets in ~/.q402/mcp.env, which the server auto-loads. Fill this field directly ONLY if your MCP client manages secrets for you. Value is a Paid Multichain API key from https://q402.quackai.ai/payment - full 12-chain support with per-chain Gas Tank. Auto-routed for non-BNB payments and whenever keyScope='multichain' is chosen.",
"isSecret": true
},
{
"name": "Q402_PRIVATE_KEY",
"description": "Mode A - real EOA signing. Hex-encoded EVM private key (0x + 64 hex chars) of YOUR MetaMask wallet, used to sign payment authorizations LOCALLY on your machine. After your first payment that wallet shows as 'Smart account' in MetaMask (EIP-7702 delegation, reversible via q402_clear_delegation). Use a fresh wallet, not your main one. Skip this and pick Mode B (Q402_AGENTIC_PRIVATE_KEY) or Mode C (server-managed Agent Wallet) if you'd rather keep your MetaMask untouched. Recommended path: run q402_doctor after install - it stores secrets in ~/.q402/mcp.env, which the server auto-loads.",
"isSecret": true
},
{
"name": "Q402_AGENTIC_PRIVATE_KEY",
"description": "Mode B - local Agent Wallet signing. Hex-encoded EVM private key (0x + 64 hex chars) exported from your Agent Wallet at https://q402.quackai.ai/dashboard -> Agent tab -> Export. Signs LOCALLY just like Mode A, but the signer is your dedicated Agent Wallet - your MetaMask EOA is never touched. Pick this for AI-agent automation when you want a dedicated purse with per-tx + daily caps you set on the dashboard.",
"isSecret": true
},
{
"name": "Q402_ENABLE_REAL_PAYMENTS",
"description": "Live-mode switch. 0 = sandbox (test mode, no funds move - every q402_pay returns a fake hash). 1 = real on-chain payments. Default 1 since v0.5.11: safe because mode only flips to live when a live API key (q402_live_*) is set AND one of (a) a valid 32-byte private key for local signing modes, OR (b) walletMode=\"agentic-server\" with Q402_MULTICHAIN_API_KEY for the server-managed Agent Wallet path. Without either combination, the server stays in sandbox regardless of this flag."
},
{
"name": "Q402_MAX_AMOUNT_PER_CALL",
"description": "Per-call USD-equivalent cap for USDC/USDT/RLUSD. Any such q402_pay request with amount above this is rejected before signing. Q (QuackAI) is exempt by design (your own token; recipient allowlist + confirmation still apply). Lower this for a tighter agent blast-radius; raise for treasury-grade transfers."
},
{
"name": "Q402_ALLOWED_RECIPIENTS",
"description": "Optional comma-separated lowercase EVM addresses. When set, q402_pay rejects any recipient not on this allowlist."
},
{
"name": "Q402_RELAY_BASE_URL",
"description": "Override for the Q402 relay endpoint. Defaults to https://q402.quackai.ai/api. Set explicitly when running against a self-hosted Q402 deployment or a non-canonical environment."
},
{
"name": "Q402_AGENT_WALLET_ADDRESS",
"description": "Server-managed Agent Wallet picker (walletMode='agentic-server' only). Lowercased agent wallet address (the hex 0x... shown on the Agent tab of your dashboard) selecting which of your Agent Wallets to spend from when you hold more than one (max 10 per owner). Omit to use the default wallet. Ignored for the local-signing modes that carry their own private key."
},
{
"name": "Q402_API_KEY",
"description": "DEPRECATED legacy single-key env from pre-v0.5.0 installs. The server still reads it as a silent fallback so existing setups keep working, but new users should pick a scoped variant instead. Q402_TRIAL_API_KEY (Free Trial, BNB Chain + Base) and Q402_MULTICHAIN_API_KEY (full 12-chain surface) are designed to coexist - BNB and Base payments auto-route to the trial key, other chains use multichain. Only set Q402_API_KEY if you are migrating an existing pre-v0.5.0 install; do NOT set it alongside the scoped variants on a fresh install.",
"isSecret": true
},
{
"name": "Q402_WALLET_ID",
"description": "DEPRECATED soft-migration alias for Q402_AGENT_WALLET_ADDRESS (one release of overlap from v0.6.0). The server still accepts it but logs a deprecation notice. New installs should set Q402_AGENT_WALLET_ADDRESS directly."
},
{
"name": "Q402_BUILDER_CODE",
"description": "Optional Base Builder Code for onchain attribution (ERC-8021 / Base Builder Codes). When set, every q402_x402_fetch payment includes your code as the client/intermediary in the x402 payment extension so payments are attributed onchain. Format: 1-32 lowercase letters, numbers, or underscores. Leave unset to disable attribution."
}
]
}
],
"remotes": []
},
"dependencies": [],
"installTargets": [
"claude-code",
"claude-desktop",
"cursor",
"vscode",
"trae",
"cherry-studio",
"lingma",
"windsurf",
"cline",
"workbuddy"
],
"keywords": [],
"provenance": {
"origin": "official-mcp-registry",
"originalId": "io.github.quackai-org/q402-mcp",
"originalUrl": "https://registry.modelcontextprotocol.io/v0.1/servers/io.github.quackai-org%2Fq402-mcp/versions/latest",
"isOfficial": true,
"status": "active"
}
}