gate-pay-x402
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseGate Pay x402 (gate-pay-x402)
Gate Pay x402 (gate-pay-x402)
General Rules
通用规则
⚠️ STOP — Follow any shared runtime rules your host applies before this skill (if the host provides them). Do NOT select or call tools until those rules are satisfied.
- Only call MCP tools explicitly listed in this skill. Tools not documented here must NOT be called, even if they exist in the MCP server.
Allowlisted Gate Pay MCP tool names (exact names as exposed by the live server; skip tools the server does not list):
- Read / orchestration (no on-chain debit by themselves; may perform HTTP or session setup per schema): .
x402_place_order: only when the connected server lists it (some alternate single-tool builds); use for merchant HTTP, 402 handling, or MCP Wallet login per that tool’sx402_request.inputSchema - Session / auth: (MCP Wallet /
x402_quick_wallet_auth).quick_wallet(Gate Pay OAuth for centralized_payment when listed—see that tool’s description andx402_gate_pay_auth).inputSchema - Write / sign / pay (irreversible or security-sensitive—require explicit user confirmation after a clear price for payment steps): ,
x402_sign_payment,x402_create_signature,x402_submit_payment(if listed by the server).x402_centralized_payment - Merchant discovery (read-only): May live on a separate MCP server from (e.g. remote HTTP MCP). When any connected server lists it, call the catalog tool by its exact live name (often
gatepay-local-mcp; if the name differs, use the live name only). No payment from discovery. If no server lists it, use user URLs / context only—never invent tool names.discoveryResource
Do not use Gate Exchange MCP to substitute Gate Pay wallet binding or to finish a Gate Pay / same-server 402 flow on a third-party x402 MCP. When the user chose the rail, use only Gate Exchange MCP tools per Gate Exchange path.
x402_place_ordergate_exchangeNo write without consent: Do not invoke any tool whose performs signing, fund movement, or centralized settlement—including , + , , and (if listed) pay steps inside —until the user has seen a clear price (quote or 402 summary) and given explicit confirmation. One confirmation must cover all write steps in the current pay flow.
inputSchemax402_sign_paymentx402_create_signaturex402_submit_paymentx402_centralized_paymentx402_requestGate Pay x402 layer — Merchant discovery (resource list only), wallet/env setup, and payment routing. Payment and wallettools normally run on localx402_*(stdio). Discovery may run on the same server or on a second MCP (e.g. remote URL)—use the host’s tool list to see which server exposes which tool. Tool argument names, types, required fields, and enums come from each tool’sgatepay-local-mcp. If anything in this skill disagrees withinputSchema, followinputSchemafor that invocation.inputSchema
User-facing language: Write all user-visible replies in the same language the user is using in the current conversation (e.g. Chinese if they write Chinese, English if they write English).
Trigger Scenarios: Use when the user wants to pay via x402, discover or pick a paid service, configure or add Gate Pay wallets, or choose a payment rail:
- Wallet setup / add / switch: configure / set up / add / bind / change default payment method, , and semantically equivalent phrasing in any language
PAYMENT_METHOD_PRIORITY - By rail (MCP Wallet / ): MCP Wallet, Quick Wallet, and the same product under localized or colloquial names in the user’s language, plugin wallet (including extension plus Open-API-token style setup), bind private key, local private key, private-key payment,
quick_wallet,EVM_PRIVATE_KEYPLUGIN_WALLET_TOKEN - Pay / buy: 402, payment required, help me pay / purchase, place order, sign payment, — and equivalent phrasing in any language
x402_sign_payment - Paid service intent (examples, not literal only): book flights, order food, buy an API, “help me buy X”, which merchants exist, list of billable or paid services — and equivalent phrasing in any language the user writes
- Exchange: Gate Exchange payment, pay via exchange
Recognize intents from meaning, not only exact English strings; users often mix languages or use vendor-specific terms.
NOT this skill (common misroutes):
- Generic market/trade-only requests with no Gate Pay MCP, no x402, no merchant discovery for this product, no wallet/env setup for this product
- Pure consultation or trade decisions with no Gate Pay / x402 / this MCP path
- Payments that must be completed only on a non-Gate third-party x402 MCP for the same order as from Gate Pay MCP (violates same-server rule below)
x402_place_order
⚠️ 停止操作 — 在执行本技能前,请遵循宿主应用的所有共享运行时规则(如果宿主提供了这些规则)。在满足这些规则之前,请勿选择或调用工具。
- 仅调用本技能中明确列出的MCP工具。即使MCP服务器中存在未在此处记录的工具,也不得调用。
允许调用的Gate Pay MCP工具名称(需与服务器实际暴露的名称完全一致;跳过服务器未列出的工具):
- 读取/编排类(本身不会触发链上扣款;可能根据Schema执行HTTP或会话设置): 。
x402_place_order: 仅当已连接的服务器列出该工具时使用(部分单工具构建版本会包含);用于商户HTTP请求、402处理或MCP Wallet登录,需遵循该工具的x402_request。inputSchema - 会话/认证类: (MCP Wallet /
x402_quick_wallet_auth)。quick_wallet(当服务器列出该工具时,用于centralized_payment的Gate Pay OAuth认证——请查看该工具的描述和x402_gate_pay_auth)。inputSchema - 写入/签名/支付类(操作不可逆或涉及安全敏感内容——在执行支付步骤前,需向用户展示明确价格并获得用户明确确认): 、
x402_sign_payment、x402_create_signature、x402_submit_payment(若服务器列出该工具)。x402_centralized_payment - 商户发现类(只读): 可能部署在与**分离的独立MCP服务器上(例如远程HTTP MCP)。当任意已连接服务器列出该工具时,需按其实际名称调用目录工具(通常为
gatepay-local-mcp;若名称不同,仅使用服务器实际列出的名称)。该工具不涉及支付操作。若无**服务器列出该工具,则仅使用用户提供的URL/上下文——绝对不能自行编造工具名称。discoveryResource
请勿使用Gate Exchange MCP替代Gate Pay钱包绑定,也请勿在第三方x402 MCP上完成Gate Pay的订单或同服务器的402流程。当用户选择**支付通道时,仅使用Gate Exchange路径**下的Gate Exchange MCP工具。
x402_place_ordergate_exchange无用户同意不得执行写入操作: 在用户看到明确价格(报价或402摘要)并给出明确确认前,不得调用任何涉及签名、资金转移或中心化结算的工具——包括、 + 、,以及(若列出)中的支付步骤。一次确认需覆盖当前支付流程中的所有写入步骤。
inputSchemax402_sign_paymentx402_create_signaturex402_submit_paymentx402_centralized_paymentx402_requestGate Pay x402层 — 商户发现(仅返回资源列表)、钱包/环境设置及支付路由。支付和钱包相关的工具通常运行在本地的**x402_*(标准输入输出)上。商户发现功能可能运行在同一服务器或另一台MCP服务器(例如远程URL)上——请通过宿主的工具列表查看哪个服务器暴露了哪个工具。工具的参数名称、类型、必填字段和枚举值均来自各工具的gatepay-local-mcp**。若本技能中的内容与inputSchema存在冲突,以该工具调用时的inputSchema为准。inputSchema
用户可见语言: 所有用户可见的回复需使用用户当前对话中使用的语言(例如用户用中文则回复中文,用户用英文则回复英文)。
触发场景:当用户想要通过x402支付、发现或选择付费服务、配置或添加Gate Pay钱包,或选择支付通道时使用:
- 钱包设置/添加/切换: 配置/设置/添加/绑定/更改默认支付方式、,以及任何语言中的语义等价表述
PAYMENT_METHOD_PRIORITY - 按支付通道(MCP Wallet / ): MCP Wallet、Quick Wallet,以及用户语言中的本地化或口语化名称,插件钱包(包括扩展程序+Open-API-token式设置)、绑定私钥、本地私钥、私钥支付、
quick_wallet、EVM_PRIVATE_KEYPLUGIN_WALLET_TOKEN - 支付/购买: 402、支付要求、帮我支付/购买、下单、签名支付、——以及任何语言中的等价表述
x402_sign_payment - 付费服务意图(示例,非仅字面表述): 预订机票、点餐、购买API、“帮我买X”、有哪些商户、可付费服务列表——以及用户使用的任何语言中的等价表述
- 交易所: Gate Exchange支付、通过交易所支付
需根据语义识别用户意图,而非仅匹配英文字符串;用户经常混合使用多种语言或使用供应商特定术语。
不属于本技能的场景(常见误判):
- 仅涉及通用市场/交易的请求,且无Gate Pay MCP、无x402、无针对本产品的商户发现、无针对本产品的钱包/环境设置
- 仅涉及咨询或交易决策,且无Gate Pay/x402/本MCP路径
- 必须在非Gate第三方x402 MCP上完成的支付,且该订单与Gate Pay MCP的为同一订单(违反下文的同服务器规则)
x402_place_order
Domain Knowledge
领域知识
- Product scope: Gate Pay x402: merchant HTTP and 402 handling via (
gatepay-local-mcptools); optional merchant discovery on the same or another MCP when a catalog tool is listed (see GatePay merchant discovery); wallet rails (x402_*,quick_wallet,plugin_wallet); optional Gate Exchange MCP when the user choselocal_private_key.gate_exchange - Schema-first: Build every MCP object from the target tool’s
arguments; on conflict with this file,inputSchemawins (see Gate Pay x402 Module (MCP Tools)).inputSchema - Consent: No signing, fund movement, or settlement tools until the user sees a clear price and gives explicit confirmation (GatePay merchant discovery & agent orchestration, Workflow).
- Rails and env: and MCP
PAYMENT_METHOD_PRIORITYare covered in Wallet configuration procedure and Authentication State.env
- 产品范围: Gate Pay x402:通过**(
gatepay-local-mcp工具)处理商户HTTP请求和402**;当列出目录工具时,可在同一或另一台MCP服务器上进行可选的商户发现(请查看GatePay商户发现);钱包通道(x402_*、quick_wallet、plugin_wallet);当用户选择**local_private_key时,可使用可选的Gate Exchange** MCP。gate_exchange - Schema优先: 每个MCP的对象需根据目标工具的**
arguments构建;若与本文档存在冲突,inputSchema优先**(请查看Gate Pay x402模块(MCP工具))。inputSchema - 用户同意: 在用户看到明确价格并给出明确确认前,不得调用签名、资金转移或结算工具(GatePay商户发现与Agent编排、工作流)。
- 通道与环境: 和MCP
PAYMENT_METHOD_PRIORITY的相关内容请查看钱包配置流程和认证状态。env
Routing Rules
路由规则
Route by user intent (procedural sections live in this file — wallet, discovery, workflow, Exchange; no procedural split to other files. QA scenarios are in ; that file is not a runtime routing submodule):
references/scenarios.md| User Intent | Keywords / signals | Target |
|---|---|---|
| Wallet / env configuration | Wallet setup, add rail, MCP Wallet, Quick Wallet, 快捷钱包, gate/Gate钱包, localized names, plugin wallet / 插件钱包, private key, | This file — Wallet configuration procedure then Authentication State |
| Merchant discovery / selection / quote | Which merchants, 有哪些商户, paid service list, 能付费的服务列表, pick a service, quote / dynamic price, discovery before pay — and non-English equivalents | This file — GatePay merchant discovery & agent orchestration then Workflow |
| x402 payment (Gate Pay MCP) | pay, 402, place order, | This file — Workflow |
| Gate Exchange payment | exchange, Gate Exchange — and non-English equivalents | This file — Gate Exchange path |
| MCP connectivity | MCP missing, tools not found, need to add discovery or local pay server | This file — MCP host setup (discovery + payment) then MCP Server Connection Detection |
根据用户意图进行路由(流程部分位于本文档中——钱包、发现、工作流、交易所路径;无需拆分到其他文件)。QA场景位于**;该文件不是**运行时路由子模块:
references/scenarios.md| 用户意图 | 关键词/信号 | 目标 |
|---|---|---|
| 钱包/环境配置 | 钱包设置、添加支付通道、MCP Wallet、Quick Wallet、快捷钱包、gate/Gate钱包、本地化名称、插件钱包/插件钱包、私钥、 | 本文档——钱包配置流程,然后是认证状态 |
| 商户发现/选择/报价 | 有哪些商户、有哪些商户、付费服务列表、能付费的服务列表、选择服务、报价/动态价格、支付前发现——以及非英文等价表述 | 本文档——GatePay商户发现与Agent编排,然后是工作流 |
| x402支付(Gate Pay MCP) | 支付、402、下单、 | 本文档——工作流 |
| Gate Exchange支付 | 交易所、Gate Exchange——以及非英文等价表述 | 本文档——Gate Exchange路径 |
| MCP连接性 | MCP缺失、工具未找到、需要添加发现或本地支付服务器 | 本文档——MCP宿主设置(发现+支付),然后是MCP服务器连接检测 |
GatePay merchant discovery & agent orchestration
GatePay商户发现与Agent编排
One-line intent: When the user states what paid service they want in natural language, the agent discovers merchants → selects a resource by rules → quotes when the merchant supports it → fills required call parameters → invokes the service → after a clear price is visible, asks for explicit pay consent → only then runs signing / payment tools. Wallet rails (, , , ) follow Wallet configuration procedure and Authentication State.
quick_walletplugin_walletlocal_private_keygate_exchange核心意图: 当用户用自然语言表述想要的付费服务时,Agent需发现商户 → 按规则选择资源 → 若商户支持则报价 → 填充所需调用参数 → 调用服务 → 在用户看到明确价格后,请求明确的支付同意 → 仅在获得同意后运行签名/支付工具。钱包通道(、、、)需遵循钱包配置流程和认证状态。
quick_walletplugin_walletlocal_private_keygate_exchangeScope and boundaries
范围与边界
- Merchant discovery layer returns an invokable resource list only. It does not take payment, does not place orders, and does not settle on-chain.
- Order / HTTP / 402 use and/or
x402_place_order(and relatedx402_request) on the payment MCP — typicallyx402_*. Every argument comes from that tool’sgatepay-local-mcp.inputSchema - Two MCPs (common): (1) Discovery MCP — remote or separate process exposing the catalog tool only. (2) Payment MCP — (stdio) exposing
npx -y gatepay-local-mcp. The agent must invoke each tool on the server that lists it; do not assume discovery and pay share one connection.x402_* - Registry / Discovery HTTP API (if present behind MCP) is implementation detail: use MCP tools and responses; do not duplicate discovery payload field tables here — treat list item shape as whatever the MCP returns, validated against .
inputSchema
- 商户发现层仅返回可调用的资源列表。该层不处理支付、不下单、不进行链上结算。
- 订单/HTTP/402处理需使用支付MCP上的**和/或
x402_place_order(及相关x402_request工具)——通常为x402_*。所有参数需来自该工具的gatepay-local-mcp**。inputSchema - 双MCP架构(常见): (1) 发现MCP — 仅暴露目录工具的远程或独立进程。(2) 支付MCP — (标准输入输出),暴露**
npx -y gatepay-local-mcp工具。Agent必须**在工具所在的服务器上调用该工具;不得假设发现和支付服务共享同一连接。x402_* - 注册/发现HTTP API(若在MCP后方存在)属于实现细节:需使用MCP工具和响应;不得在此处复制发现负载字段表——需将列表项结构视为MCP返回的任意结构,并根据****进行验证。
inputSchema
Merchant discovery MCP tool (when listed)
商户发现MCP工具(当服务器列出时)
- Which server: Scan all configured MCP servers. The catalog tool may appear only on the discovery server (not on ).
gatepay-local-mcp - Tool name (expected): — must match the live tool list on the server that exposes discovery. If the shipped name differs, use the live name only.
discoveryResource - Behavior: Returns a paginated invokable resource list only (HTTP and/or MCP-type entries with , optional quote metadata). No payment, no order placement from this tool.
accepts - Arguments (logical field names — assemble values per live ; on any mismatch,
inputSchemawins):inputSchemaField Required Notes resourceDesYes User intent / service description for fuzzy catalog match (natural language or keywords). resourceTypeYes orhttp(design defaultmcp).mcppageNumNo Page index; design default .1pageSizeNo Page size; design default .10tenantIdNo Tenant id; design default ; omit if schema does not expose it.GATE_PAY - Response mapping: Items typically include endpoint identity and (with
accepts/outputSchemafor HTTP method, headers, body, or MCPinput+tool+inputSchema). Optionaltransport:metadata,quote_endpoint,quote_method,pricing_mode/quote_inputSchemafor dynamic pricing — use for Quote vs main call order above. Field names may appear asinputSchemaorresourceUrldepending on layer; always follow the actual tool response and map intoresource/x402_place_orderper theirx402_request.inputSchema - If the tool is not listed: Skip discovery calls; rely on user-provided URLs and conversation context.
- 所在服务器: 扫描所有已配置的MCP服务器。目录工具可能仅出现在发现服务器上(而非)。
gatepay-local-mcp - 工具名称(预期): — 必须与暴露发现功能的服务器上的实际工具列表匹配。若实际名称不同,仅使用实际名称。
discoveryResource - 行为: 仅返回分页的可调用资源列表(包含的HTTP和/或MCP类型条目,可选报价元数据)。该工具不处理支付、不下单。
accepts - 参数(逻辑字段名称——需根据实际组装值;若存在任何不一致,以
inputSchema为准):inputSchema字段 必填 说明 resourceDes是 用于模糊目录匹配的用户意图/服务描述(自然语言或关键词)。 resourceType是 或http(默认值为**mcp**)。mcppageNum否 页码;默认值为** **。1pageSize否 每页数量;默认值为** **。10tenantId否 租户ID;默认值为** **;若Schema未暴露该字段则省略。GATE_PAY - 响应映射: 条目通常包含端点标识和**(包含HTTP方法、头部、Body或MCP
accepts+tool+inputSchema的transport/outputSchema)。可选input:metadata、quote_endpoint、quote_method、用于动态定价的pricing_mode/quote_inputSchema——用于上述报价与主调用顺序**。字段名称可能为inputSchema或resourceUrl,具体取决于层级;始终遵循工具的实际响应,并根据**resource**将其映射到inputSchema/x402_place_order。x402_request - 若工具未列出: 跳过发现调用;依赖用户提供的URL和对话上下文。
When discoveryResource
is mandatory (before merchant HTTP)
discoveryResource强制调用discoveryResource
的场景(商户HTTP请求前)
discoveryResourceWhen some connected MCP server lists the discovery catalog tool (often — use the exact name from that server’s tool list), and all of the following hold:
discoveryResource- The user expresses purchase or order intent for a good or service in natural language (e.g. “帮我买一双鞋”, “订一杯咖啡”, “买一个查天气的 API”) — including the same intent in other languages or colloquial phrasing.
- The user message plus conversation context do not supply enough information to satisfy the merchant HTTP tool’s on the payment MCP for
inputSchemaorx402_place_order(typically missing or incompletex402_request/url/methodor equivalent required fields) without inventing endpoints or parameters.body
Then the agent MUST call the discovery tool first on the server that lists it — build only from that tool’s (commonly map the user’s wording into , set per schema, e.g. design default ). Then apply Selection rules, then continue Workflow from Step 3–4 on the payment MCP with the chosen resource. Do not skip discovery by guessing merchant URLs or calling / with empty, placeholder, or hallucinated merchant targets.
argumentsinputSchemaresourceDesresourceTypemcpx402_place_orderx402_requestDo not apply this mandatory catalog step when: no connected server lists a discovery tool (use user URLs/context only); the user already provides a concrete merchant endpoint and parameters adequate for the HTTP tool’s schema; the session is wallet / rail setup only with no purchase flow; or the user chose only (Gate Exchange path).
gate_exchange当部分已连接的MCP服务器列出发现目录工具(通常为**——需使用该服务器工具列表中的准确**名称),且同时满足以下所有条件时:
discoveryResource- 用户用自然语言表达了购买或订购商品或服务的意图(例如“帮我买一双鞋”、“订一杯咖啡”、“买一个查天气的API”)——包括其他语言或口语化表述的相同意图。
- 用户消息加上对话上下文无法提供足够信息,以满足支付MCP上商户HTTP工具(或
x402_place_order)的**x402_request要求(通常缺少或不完整的inputSchema/url/method或等价必填字段),且无法**自行编造端点或参数。body
此时Agent必须先在工具所在的服务器上调用发现工具——仅根据该工具的构建**(通常将用户表述映射到,根据Schema设置,例如默认值)。然后应用选择规则**,接着在支付MCP上从步骤3-4开始继续执行工作流。不得通过猜测商户URL或使用空值、占位符或虚构商户目标调用**/**来跳过发现步骤。
inputSchemaargumentsresourceDesresourceTypemcpx402_place_orderx402_request当以下情况时,无需执行该强制目录步骤:无已连接服务器列出发现工具(仅使用用户URL/上下文);用户已提供足够的商户端点和参数以满足HTTP工具的Schema要求;会话仅涉及钱包/支付通道设置,无购买流程;或用户仅选择****(Gate Exchange路径)。
gate_exchangeSelection rules (filter → rank → tie-break)
选择规则(过滤→排序→平局处理)
Apply in order; filter first, then sort what remains; if several options remain close, ask the user — do not silently choose.
- Intent match: , type, and capabilities align with the user goal (e.g. flights vs food vs API).
description - Constraints: Network, currency, , user-stated budget — drop resources that violate them.
maxPrice - Callability: Current environment can satisfy required MCP transport and/or HTTP; if not, drop or explain limitation.
- Parameter feasibility: Given what the user already said, can required inputs (per merchant ) be filled? If a resource needs unknown critical fields and there is no safe default, do not select it or pick the easiest-to-complete option and ask for missing fields.
inputSchema - Price path: If the user insists on knowing price before deciding, prefer resources that expose quote / dynamic metadata; otherwise, among equally good options, prefer fixed-price or simpler paths.
- Tie-break: If multiple resources remain similarly suitable, present differences (price band, latency, limits) and ask the user to pick (e.g. by number). Never auto-pick without user choice.
按顺序应用规则;先过滤,然后对剩余选项排序;若多个选项相似度较高,询问用户——不得自行静默选择。
- 意图匹配: 、类型和能力与用户目标一致(例如机票、餐饮、API)。
description - 约束条件: 网络、货币、、用户声明的预算——排除违反这些约束的资源。
maxPrice - 可调用性: 当前环境可满足所需的MCP传输和/或HTTP要求;若不能,则排除或说明限制。
- 参数可行性: 根据用户已提供的信息,是否能填充商户**要求的必填输入?若某资源需要未知的关键字段且无安全默认值,不得选择该资源,或选择最易完成的选项并询问**用户补充缺失字段。
inputSchema - 价格路径: 若用户坚持在决定前了解价格,优先选择暴露报价/动态元数据的资源;否则,在同等条件下优先选择固定价格或流程更简单的路径。
- 平局处理: 若多个资源仍同样合适,展示差异(价格区间、延迟、限额)并让用户选择(例如按编号选择)。绝对不能在无用户选择的情况下自动选择。
Quote vs main call order
报价与主调用顺序
- If the discovery item or schema/metadata indicates quote / dynamic pricing (e.g. ,
dynamic, or equivalent per MCP docs): quote first → show the user currency, amount, and conditions → ask whether to continue with that merchant → after yes, call the main service with parameters.quote_endpoint - If there is no quote path: do not invent a separate quote step; call the main service per contract. If cost appears only in 402, parse 402 then run mandatory pay confirmation below.
- No quote path does not mean skipping pay confirmation.
- 若发现条目或Schema/元数据表明存在报价/动态定价(例如、
dynamic或MCP文档中的等价表述):先报价→向用户展示货币、金额和条件→询问用户是否继续使用该商户→获得同意后,调用带参数的主服务。quote_endpoint - 若无报价路径:不得自行添加单独的报价步骤;按合约调用主服务。若成本仅出现在402响应中,则解析402响应后执行强制支付确认步骤。
- 无报价路径不代表可以跳过支付确认。
Parameters, price visibility, and mandatory pay confirmation
参数、价格可见性与强制支付确认
- Parameters: Before any merchant / call (or
x402_place_orderif that is the tool the payment MCP lists for HTTP/402), list required fields from the relevantx402_request. If the user has not provided them, complete via dialogue. Do not call with empty or guessed values to “probe” the API.inputSchema - Price visibility: On a quote path, show currency, amount, and applicability. Without quote, after 402 or an explicit price from the merchant, summarize the payment requirement in the user’s language.
- Pay confirmation (mandatory): The user must see a clear price (quote result or 402 summary) first. Then the agent must ask again; the message should cover how much, which asset/chain (if known), and which payment method (if known). Only after explicit consent (e.g. “confirm pay”, “go ahead and pay”) invoke , split signature tools, or further steps in
x402_sign_paymentonly if that tool is listed on the payment MCP. If the user refuses or is unsure, stop payment; offer another merchant or end.x402_request - Step 1 (Workflow) “balance / intent” checks may be merged with this see-price-then-confirm step to avoid double-asking; prefer one clear confirmation after price is visible.
- 参数: 在调用任何商户/(或**
x402_place_order,若支付MCP列出该工具用于HTTP/402处理)之前,列出相关x402_request**中的必填字段。若用户未提供这些字段,通过对话补充完整。不得使用空值或猜测值调用工具以“探测”API。inputSchema - 价格可见性: 在报价路径中,展示货币、金额和适用条件。若无报价,则在402响应或商户明确给出价格后,用用户的语言总结支付要求。
- 支付确认(强制): 用户必须先看到明确价格(报价结果或402摘要)。然后Agent必须再次询问;消息需涵盖金额、资产/链(若已知)和支付方式(若已知)。仅在获得明确同意(例如“确认支付”、“继续支付”)后,才调用、拆分签名工具,或仅当支付MCP列出该工具时调用
x402_sign_payment中的后续步骤。若用户拒绝或不确定,停止支付;提供其他商户选项或结束流程。x402_request - 工作流步骤1的“余额/意图”检查可与该“先看价格再确认”步骤合并,以避免重复询问;优先在价格可见并获得同意后进行一次明确确认。
Mapping discovery to Step 4
发现结果到步骤4的映射
- /
url/methodforbody(orx402_place_orderwhen that is the HTTP tool on the server) come from the user message, conversation context, or upstream discovery (resource identity,x402_request, or equivalent in the MCP response). Map field names to whatever the tooloutputSchemarequires.inputSchema
- (或服务器上用于HTTP处理的**
x402_place_order)的x402_request/url/method来自用户消息**、对话上下文或上游发现结果(资源标识、body或MCP响应中的等价内容)。需将字段名称映射到工具outputSchema要求的名称。inputSchema
Alignment with Workflow
与工作流的对齐
- Step 4 remains merchant HTTP + 402 handling via or, when listed,
x402_place_order(per server).x402_request - Steps 5–6 (MCP Wallet login if needed, sign / pay tools): run only after mandatory pay confirmation above (or immediately before first charge/sign, if merged with confirmation — not before the user has a clear price and agrees).
- Same-server rule (payment): For one merchant order / one 402 challenge, all steps (place order, sign, submit, auth for pay) use the same payment MCP server id (typically
x402_*). Discovery may be invoked on a different server id; that does not break this rule—onlygatepay-local-mcpmust stay on one pay server for the order.x402_*
- 步骤4仍通过或(当服务器列出时)
x402_place_order(根据服务器情况)处理商户HTTP + 402请求。x402_request - 步骤5-6(必要时进行MCP Wallet登录、签名/支付工具):仅在上述强制支付确认之后运行(或在首次扣费/签名前立即运行,若与确认步骤合并——不得在用户看到明确价格并同意之前运行)。
- 同服务器规则(支付): 对于一个商户订单/一个402挑战,所有**步骤(下单、签名、提交、支付认证)需使用同一支付MCP服务器ID**(通常为**
x402_*)。发现功能可在不同服务器ID上调用;这不违反该规则——仅gatepay-local-mcp**工具需在同一支付服务器上完成整个订单流程。x402_*
Wallet and rails (product rules)
钱包与通道(产品规则)
These override older wording elsewhere in this file where they conflict, except where a tool’s requires a field (e.g. a URL argument): then wins — supply values per schema and vendor docs.
inputSchemainputSchema- : User configures
plugin_walletin MCPPLUGIN_WALLET_TOKENonly (full token never in chat). Do not requireenvin user env as a default rule; implementation may use a built-in endpoint. IfPLUGIN_WALLET_SERVER_URLstill requires a URL (or similar) for a call, fill it per schema/docs — not by contradicting required fields.inputSchema - (MCP Wallet): Do not require
quick_wallet,MCP_WALLET_API_KEY, or similar “quick wallet API URL” env vars. Session comes from tool-driven login (MCP_WALLET_URL, orx402_quick_wallet_authwhen that build uses it for login, per schema); after success, updatex402_requestas in Section 1 (MCP Wallet).PAYMENT_METHOD_PRIORITY - Payment failure and rail switching: Use only rails that are actually configured and available (+ env + login state). If only
PAYMENT_METHOD_PRIORITYis configured and it fails: do not startplugin_walletlogin/auth unlessquick_walletis already configured and the user explicitly agrees to switch. If there is no next rail, explain the failure, suggest checking token/plugin setup, and do not invent other payment methods. With multiple rails, you may try the next configured rail on failure; prefer a brief user check before switching rails (unless product defines a pure technical retry exception).quick_wallet
若以下规则与本文档其他内容存在冲突,优先遵循以下规则,除非工具的**要求特定字段(例如URL参数):此时优先**——需根据Schema和供应商文档提供值。
inputSchemainputSchema- : 用户仅需在MCP
plugin_wallet中配置env(完整令牌绝对不能出现在聊天中)。不得要求用户在环境中配置**PLUGIN_WALLET_TOKEN作为默认规则;实现可使用内置端点。若PLUGIN_WALLET_SERVER_URL**仍要求调用时提供URL(或类似字段),需根据Schema/文档填充——不得违反必填字段要求。inputSchema - (MCP Wallet): 不得要求用户提供
quick_wallet、MCP_WALLET_API_KEY或类似的“快速钱包API URL”环境变量。会话通过工具驱动的登录(MCP_WALLET_URL,或当构建版本使用该工具登录时的**x402_quick_wallet_auth,需遵循Schema)建立;登录成功后,按第1节**(MCP Wallet)更新**x402_request**。PAYMENT_METHOD_PRIORITY - 支付失败与通道切换: 仅使用已实际配置且可用的支付通道(+ 环境 + 登录状态)。若仅配置了
PAYMENT_METHOD_PRIORITY且支付失败:不得启动未配置的plugin_wallet登录/认证,除非quick_wallet已配置且用户明确同意切换。若无下一个可用通道,需说明失败原因,建议用户检查令牌/插件设置,不得自行创建其他支付方式。若存在多个通道,可在失败时尝试下一个已配置的通道;优先在切换通道前向用户简要确认(除非产品定义了纯技术重试例外)。quick_wallet
Hard stops (non-exhaustive)
强制终止场景(非 exhaustive)
- Discovery returns nothing usable and constraints cannot be relaxed → stop or relax and retry; do not fake merchants.
- Required parameters missing → do not call the merchant or pay tools.
- User has not explicitly agreed to pay after seeing price → do not call signature or payment tools.
- Plugin-only config and plugin call failed → do not auto-launch unconfigured .
quick_wallet
- 发现结果无可用资源且无法放宽约束→停止或放宽约束后重试;不得虚构商户。
- 必填参数缺失→不得调用商户或支付工具。
- 用户在看到价格后未明确同意支付→不得调用签名或支付工具。
- 仅配置插件通道且插件调用失败→不得自动启动未配置的。
quick_wallet
MCP host setup (discovery + payment)
MCP宿主设置(发现+支付)
Many deployments use two MCP entries:
| Role | Typical transport | Purpose |
|---|---|---|
| Payment MCP | stdio — | |
| Discovery MCP (optional) | HTTP remote URL (host-specific) | Payable-merchant catalog only (often tool name |
Merge both into the host’s MCP server map without removing unrelated MCPs. Reload MCP or restart the app after edits.
许多部署使用两个MCP条目:
| 角色 | 典型传输方式 | 用途 |
|---|---|---|
| 支付MCP | 标准输入输出 — | |
| 发现MCP(可选) | HTTP远程URL(宿主特定) | 仅用于可付费商户的目录(通常工具名称为** |
将两者合并到宿主的MCP服务器映射中,不得移除无关的MCP。编辑后需重新加载MCP或重启应用。
Example: mcp.json
fragment (Cursor-style hosts)
mcp.json示例:mcp.json
片段(Cursor风格宿主)
mcp.jsonProject: . User-wide: . Under :
<project>/.cursor/mcp.json~/.cursor/mcp.jsonmcpServersjson
{
"gatepay-merchant-discovery": {
"url": "https://openplatform.gateapi.io/pay-mcp-server/mcp"
},
"gatepay-local-mcp": {
"command": "npx",
"args": ["-y", "gatepay-local-mcp"],
"env": {}
}
}- Keys (,
gatepay-merchant-discovery) may be renamed; keep them stable for the session so the agent targets the correct server for each tool.gatepay-local-mcp - If your host requires a different shape for remote MCP (headers, , SSE), follow current host docs—the important part is registering both endpoints when your product uses split discovery + local pay.
transport - Secrets belong only in ’s
gatepay-local-mcp(never in chat).env
项目级:。用户级:。在下:
<project>/.cursor/mcp.json~/.cursor/mcp.jsonmcpServersjson
{
"gatepay-merchant-discovery": {
"url": "https://openplatform.gateapi.io/pay-mcp-server/mcp"
},
"gatepay-local-mcp": {
"command": "npx",
"args": ["-y", "gatepay-local-mcp"],
"env": {}
}
}- 键名(、
gatepay-merchant-discovery)可重命名;需在会话中保持稳定,以便Agent针对正确的服务器调用工具。gatepay-local-mcp - 若宿主对远程MCP要求不同的结构(头部、、SSE),需遵循当前宿主文档——重要的是当产品使用分离的发现+本地支付架构时,注册两个端点。
transport - 机密信息仅能放在**的
gatepay-local-mcp**中(绝对不能出现在聊天中)。env
MCP Server Connection Detection
MCP服务器连接检测
Before the first Gate Pay tool call for payment or MCP Wallet auth, and before mandatory merchant discovery when the flow needs a catalog, run the probes below (skip when the user has only received Section 0.A and has not yet chosen a rail).
x402_*在首次调用Gate Pay 工具(用于支付或MCP Wallet认证)之前,以及当流程需要目录服务时的强制商户发现之前,需运行以下探测步骤(当用户仅查看第0.A节且尚未选择支付通道时,可跳过)。
x402_*A. Payment MCP (required for x402 pay / wallet auth)
A. 支付MCP(x402支付/钱包认证必需)
- Scan configured servers for at least one tool whose name starts with (e.g.
x402_,x402_place_order,x402_sign_payment). Some builds exposex402_quick_wallet_authas the main HTTP/login tool instead of or alongsidex402_request.x402_place_order - Record that host’s server key as the payment server id (e.g. ).
gatepay-local-mcp - Verify the tool list includes or
x402_place_orderor another documentedx402_requestentry for merchant HTTP/402.x402_*
| Result | Action |
|---|---|
| Success | Use this payment server id for all |
| Failure | Show Setup guide — payment MCP below; do not guess pay parameters. |
- 扫描已配置的服务器,查找至少一个名称以**开头的工具(例如
x402_、x402_place_order、x402_sign_payment)。部分构建版本会暴露x402_quick_wallet_auth**作为主要的HTTP/登录工具,替代或配合x402_request使用。x402_place_order - 记录该宿主的服务器键作为支付服务器ID(例如)。
gatepay-local-mcp - 验证工具列表包含**** 或
x402_place_order或其他已记录的用于商户HTTP/402处理的**x402_request**条目。x402_*
| 结果 | 操作 |
|---|---|
| 成功 | 本次会话中,所有** |
| 失败 | 展示下方的设置指南——支付MCP;不得猜测支付参数。 |
B. Discovery MCP (required only if mandatory discovery applies)
B. 发现MCP(仅当强制发现适用时必需)
- Scan all configured servers (including not the payment server) for the catalog tool — often ; use the exact name from the live list.
discoveryResource - Record that server key as the discovery server id (e.g. ) when present.
gatepay-merchant-discovery - If the user’s buy flow needs a catalog (When is mandatory) and no server lists a discovery tool → show Setup guide — discovery MCP below.
discoveryResource
| Result | Action |
|---|---|
| Catalog tool found | Call discovery only on discovery server id; map results into |
| Catalog missing but mandatory | User must add discovery MCP or supply merchant URL/params manually. |
| Catalog not needed | Skip; user gave sufficient merchant fields or session is wallet-only / Exchange-only. |
Setup guide — payment MCP (show at most once per session when A fails):
Payment MCP (gatepay-local-mcp)
- Add a stdio server: command "npx", args ["-y", "gatepay-local-mcp"], env { } (add PAYMENT_METHOD_PRIORITY / EVM_PRIVATE_KEY / PLUGIN_WALLET_TOKEN only when that rail is used — full secrets never in chat).
- Cursor-style: merge into .cursor/mcp.json under mcpServers; reload MCP or restart the IDE.
- Other hosts: register the same stdio command per product docs (VS Code MCP, Claude Code, OpenClaw, etc.).Setup guide — discovery MCP (show at most once per session when B is required but missing):
Discovery MCP (example id: gatepay-merchant-discovery)
- Add a remote MCP entry with your vendor URL, e.g. "url": "https://openplatform.gateapi.io/pay-mcp-server/mcp" (confirm exact URL and transport with your deployment).
- Merge into the same mcpServers object as the payment MCP; reload MCP.
- After reload, confirm the catalog tool appears (name may be discoveryResource or differ — use the live tool list).- 扫描所有已配置的服务器(包括非支付服务器),查找目录工具——通常为**;需使用实际列表中的准确**名称。
discoveryResource - 当存在该工具时,记录服务器键作为发现服务器ID(例如)。
gatepay-merchant-discovery - 若用户的购买流程需要目录服务(强制调用的场景)且无服务器列出发现工具→展示下方的设置指南——发现MCP。
discoveryResource
| 结果 | 操作 |
|---|---|
| 找到目录工具 | 仅在发现服务器ID上调用发现工具;将结果映射到支付服务器ID上的** |
| 需要目录服务但未找到 | 用户必须添加发现MCP或手动提供商户URL/参数。 |
| 无需目录服务 | 跳过;用户已提供足够的商户字段或会话仅涉及钱包/交易所支付。 |
设置指南——支付MCP(当A失败时,每个会话最多展示一次):
支付MCP(gatepay-local-mcp)
- 添加标准输入输出服务器:命令为"npx",参数为["-y", "gatepay-local-mcp"],env为{}(仅当使用该通道时添加PAYMENT_METHOD_PRIORITY/EVM_PRIVATE_KEY/PLUGIN_WALLET_TOKEN——完整机密信息绝不能出现在聊天中)。
- Cursor风格:合并到.cursor/mcp.json的mcpServers下;重新加载MCP或重启IDE。
- 其他宿主:根据产品文档注册相同的标准输入输出命令(VS Code MCP、Claude Code、OpenClaw等)。设置指南——发现MCP(当B需要但未找到时,每个会话最多展示一次):
发现MCP(示例ID:gatepay-merchant-discovery)
- 添加远程MCP条目,使用供应商URL,例如"url": "https://openplatform.gateapi.io/pay-mcp-server/mcp"(请确认部署的准确URL和传输方式)。
- 合并到与支付MCP相同的mcpServers对象中;重新加载MCP。
- 重新加载后,确认目录工具已出现(名称可能为discoveryResource或其他——需使用实际工具列表中的名称)。Wallet configuration procedure
钱包配置流程
When the user wants to configure, add, or change a payment wallet for Gate Pay MCP, follow this flow. Arguments for any MCP tool come from that tool’s .
inputSchema当用户想要为Gate Pay MCP配置、添加或更改支付钱包时,遵循以下流程。任何MCP工具的参数均来自该工具的****。
inputSchema0. Entry
0. 入口
0.A Vague intent — first reply only (user-facing)
0.A 模糊意图 — 仅首次回复(面向用户)
If the user only asks to configure or add a wallet (e.g. “help me set up my wallet”, “configure wallet”) without naming a specific rail, this turn must be short and plain-language. Use the same language as the user (see User-facing language above).
-
Give three options — for each, in plain language: what it is, who it suits, roughly what they will do — one or two sentences total per option. Contrast the three clearly (browser/device login vs extension/Open API style vs holding a key on the machine):
- MCP Wallet (localized: Quick Wallet, 快捷钱包, gate钱包 / Gate钱包): Sign in with Gate in a browser or device flow (like logging into an app); best for users who want no extension install and are fine with hosted login. After they pick, you’ll drive MCP tools to complete login and then payment order.
- Plugin wallet: Uses the Gate browser extension and an Open API–style token you keep in local app settings — good for users who already use the Gate extension and want payments authorized from the plugin. After they pick, you’ll point them to get a token from the plugin side and paste it only into local config, not into random sites.
- Private key (local signing): They put their own EVM private key in local config and the MCP signs on this machine — for advanced users who fully control a key and accept handling raw key material. After they pick, you’ll tell them to fill only local config, never type the key into chat.
-
In this first message, do not include:key names (e.g.
env,EVM_PRIVATE_KEY,PLUGIN_WALLET_*), MCP tool names (e.g.PAYMENT_METHOD_PRIORITY,x402_quick_wallet_auth), enum tokens (x402_place_order,quick_wallet), how to editplugin_wallet(or other paths), or step-by-step technical procedures. Defer all of that until after they choose (Section 0.B → Sections 1–3).mcp.json -
Tone: No long checklist, no env audit, no long security lecture. At most one short line, e.g. “After you choose, I’ll walk you through the next steps step by step.”
-
Optionally one line for Gate Exchange pay if that MCP applies.
-
Close by asking them to pick one (name or number). Wait for their choice (unless they already named a rail in the same first message).
若用户仅询问配置或添加钱包(例如“帮我设置钱包”、“配置钱包”)且未指定具体支付通道,本次回复必须简短且使用通俗语言。需使用与用户相同的语言(请查看上文的用户可见语言)。
-
提供三个选项——每个选项需用通俗语言说明是什么、适合谁、大致操作步骤——每个选项最多1-2句话。需清晰区分三个选项(浏览器/设备登录 vs 扩展程序/Open API风格 vs 本地密钥存储):
- MCP Wallet(本地化名称:Quick Wallet、快捷钱包、gate钱包/Gate钱包):通过浏览器或设备流程使用Gate登录(类似登录应用);最适合不想安装扩展程序且接受托管登录的用户。用户选择后,将引导其使用MCP工具完成登录和支付订单。
- 插件钱包: 使用Gate浏览器扩展程序和存储在本地应用设置中的Open API风格令牌——适合已在使用Gate扩展程序且希望通过插件授权支付的用户。用户选择后,将指导其从插件端获取令牌并仅粘贴到本地配置中,而非随意网站。
- 私钥(本地签名): 用户将自己的EVM私钥放入本地配置,MCP在本机完成签名——适合完全控制密钥且接受处理原始密钥材料的高级用户。用户选择后,将指导其仅在本地配置中填写密钥,绝对不能在聊天中输入密钥。
-
首次回复中不得包含:键名(例如
env、EVM_PRIVATE_KEY、PLUGIN_WALLET_*)、MCP工具名称(例如PAYMENT_METHOD_PRIORITY、x402_quick_wallet_auth)、枚举令牌(x402_place_order、quick_wallet)、编辑**plugin_wallet的方法(或其他路径),或分步技术流程。所有这些内容需推迟到用户选择后**(第0.B节→第1-3节)再提供。mcp.json -
语气: 不要使用冗长的清单、不要进行环境审计、不要进行冗长的安全说教。最多添加一句简短说明,例如“你选择后,我会一步步引导你完成后续操作。”
-
若适用,可添加一行关于Gate Exchange支付的说明。
-
结尾请用户选择一个选项(名称或编号)。等待用户选择(除非用户在同一条首次消息中已指定支付通道)。
0.B After the user chooses (or already named a rail)
0.B 用户选择后(或已指定支付通道)
Continue with Sections 1–3 / Section 5 — here you may use env keys, tool names, , and file edits per those sections. For MCP Wallet, run MCP Server Connection Detection and record the server identifier.
PAYMENT_METHOD_PRIORITY继续执行第1-3节/第5节——此处可使用环境键、工具名称、和文件编辑操作。对于MCP Wallet,需运行MCP服务器连接检测并记录服务器标识符。
PAYMENT_METHOD_PRIORITY1. MCP Wallet (quick_wallet
)
quick_wallet1. MCP Wallet(quick_wallet
)
quick_walletMCP Wallet is one product channel; localized names (e.g. “Quick Wallet”) refer to the same rail. The MCP enum / env token remains — use that value in and in (or equivalent fields) per .
quick_walletPAYMENT_METHOD_PRIORITYsign_modeinputSchemaNo user API key for this rail: MCP Wallet does not use , does not ask users to apply for or paste a “quick wallet API key”, and is not the same as the plugin wallet’s Open API token. Credentials come from the tool-driven login (device / OAuth flow); the implementation may persist session data locally (e.g. under ) — follow the tool response, not chat guesses.
MCP_WALLET_API_KEY~/.gate-pay/Order: tool auth first, then only on success. Do not write or merge until MCP Wallet login has succeeded per the tool you actually have (see below).
PAYMENT_METHOD_PRIORITYPAYMENT_METHOD_PRIORITYWrong flows (MCP Wallet): Do not instruct users to set , as a prerequisite, generic API keys, or for this rail. Do not conflate MCP Wallet with plugin_wallet token setup.
MCP_WALLET_API_KEYMCP_WALLET_URLEVM_PRIVATE_KEYWhich tool to call (read the live MCP tool list):
- If exists → use it first;
x402_quick_wallet_authfromarguments(e.g. optionalinputSchema:wallet_login_provider|gate).google - If is absent but
x402_quick_wallet_authis listed and itsx402_requestsupports MCP Wallet login → trigger login viainputSchemausing fields forx402_request(e.g.quick_wallet:sign_mode, and any requiredquick_wallet/ URL params). Still no user API key — same auth-first rule; then updatewallet_login_provideronly after success. (Common npmPAYMENT_METHOD_PRIORITYsingle-tool builds often list onlygatepay-local-mcpfor both HTTP and MCP Wallet login—still only if listed.)x402_request - If the user chose centralized_payment and is listed → follow that tool’s description and
x402_gate_pay_authfor Gate Pay OAuth (separate from MCP Wallet login).inputSchema
Definition — configured: MCP Wallet is fully configured only after login / device flow completes successfully (tool response success / ready). Failed or abandoned login → do not update .
PAYMENT_METHOD_PRIORITY- First — MCP tool: Per Which tool to call above, invoke , or
x402_quick_wallet_authwhen listed and used forx402_requestlogin per schema, on the payment MCP (see MCP Server Connection Detection §A). Guide the user through MCP Wallet login until the tool indicates success / ready.quick_wallet - If login succeeds (session established per tool response): then edit MCP :
env- Add to
quick_wallet(merge with existing list if any).PAYMENT_METHOD_PRIORITY - If no other rail was in before, you may set
PAYMENT_METHOD_PRIORITYas the only or first entry per user’s stated intent at Section 0.B.quick_wallet - If one or more other rails were already in , ask the user explicitly: whether to make
PAYMENT_METHOD_PRIORITYthe new default (move to front). Only if the user says yes move it to the first position; if no, appendquick_walletwithout changing the current first token (do not reorder without confirmation — see Section 4).quick_wallet
- Add
- If auth / login fails (error, timeout, user cancelled, non-ready): do not change or add
PAYMENT_METHOD_PRIORITY. Explain next steps; user may retry.quick_wallet - After successful config writes, remind reload MCP / restart the host if needed.
- Disclose tool output after MCP Wallet login:
- Private key / seed / exported signing secret: Never paste the full value in chat. Print it to the integrated terminal (stdout) so it works on macOS, Windows, and Linux: prefer /
node -eornode -pto print a JSON-safe or plain-text line; if neither runtime is onpython -c, write a temporary file under the project (gitignored path) and run a command that prints its path or contents to the terminal, then tell the user in chat (in their language) to open the Terminal panel and copy from there — still do not put the secret in chat.PATH - Public deposit / wallet addresses (non-secret identifiers): may show in chat in full or summarized, in the user’s language, plus any short context the user needs.
- Other bulky or mixed responses: Strip or redact secrets for chat; put full private material only in terminal/temp file as above; addresses stay chat-eligible.
- Private key / seed / exported signing secret: Never paste the full value in chat. Print it to the integrated terminal (stdout) so it works on macOS, Windows, and Linux: prefer
- Apply Safety Rules.
MCP Wallet是产品的一个通道;本地化名称(例如“Quick Wallet”)指同一通道。MCP枚举/环境令牌仍为**——需在和(或等价字段)中使用该值,需遵循**。
quick_walletPAYMENT_METHOD_PRIORITYsign_modeinputSchema该通道无需用户API密钥: MCP Wallet不使用**,不要求用户申请或粘贴“快速钱包API密钥”,且与插件钱包的Open API令牌不同**。凭证来自工具驱动的登录(设备/OAuth流程);实现可能在本地存储会话数据(例如****下)——需遵循工具响应,而非聊天猜测。
MCP_WALLET_API_KEY~/.gate-pay/顺序: 先进行工具认证,仅在成功后更新。不得在MCP Wallet登录成功前写入或合并****(需根据实际使用的工具判断,见下文)。
PAYMENT_METHOD_PRIORITYPAYMENT_METHOD_PRIORITY错误流程(MCP Wallet): 不得指示用户设置**、作为前提条件,不得使用通用API密钥或用于该通道。不得混淆MCP Wallet与plugin_wallet**令牌设置。
MCP_WALLET_API_KEYMCP_WALLET_URLEVM_PRIVATE_KEY需调用的工具(查看实际MCP工具列表):
- 若存在**→优先使用该工具;
x402_quick_wallet_auth来自arguments**(例如可选的inputSchema:wallet_login_provider|gate)。google - 若**不存在但
x402_quick_wallet_auth已列出且其x402_request支持MCP Wallet登录→通过inputSchema使用x402_request相关字段触发登录(例如quick_wallet:sign_mode,以及任何必填的quick_wallet/URL参数)。仍无需用户API密钥——遵循相同的先认证规则;仅在成功后更新wallet_login_provider**。(常见的npmPAYMENT_METHOD_PRIORITY单工具构建版本通常仅列出gatepay-local-mcp用于HTTP和MCP Wallet登录——仍需仅当列出时**使用。)x402_request - 若用户选择centralized_payment且**已列出→遵循该工具的描述和
x402_gate_pay_auth**进行Gate Pay OAuth认证(与MCP Wallet登录分离)。inputSchema
已配置定义: 仅当登录/设备流程成功完成(工具响应为success/ready)时,MCP Wallet才被视为完全配置。登录失败或中断→不得更新****。
PAYMENT_METHOD_PRIORITY- 第一步——MCP工具: 根据上述需调用的工具说明,在支付MCP上调用**,或当
x402_quick_wallet_auth已列出且用于x402_request登录时调用该工具(请查看MCP服务器连接检测**§A)。引导用户完成MCP Wallet登录,直到工具指示success/ready。quick_wallet - 若登录成功(根据工具响应已建立会话):然后编辑MCP :
env- 将**添加到
quick_wallet**(若已有列表则合并)。PAYMENT_METHOD_PRIORITY - 若之前中无其他通道,可根据用户在第0.B节中表述的意图将**
PAYMENT_METHOD_PRIORITY**设置为唯一或第一个条目。quick_wallet - 若已有一个或多个其他通道在中,需明确询问用户:是否将**
PAYMENT_METHOD_PRIORITY设为新默认**(移至列表首位)。仅当用户同意时将其移至首位;若用户不同意,则将**quick_wallet追加到列表末尾,不得更改当前首位令牌(不得未经确认重新排序——请查看第4节**)。quick_wallet
- 将**
- 若认证/登录失败(错误、超时、用户取消、未就绪):不得更改**或添加
PAYMENT_METHOD_PRIORITY**。说明后续步骤;用户可重试。quick_wallet - 成功写入配置后,提醒用户重新加载MCP/重启宿主应用(若需要)。
- MCP Wallet登录后披露工具输出:
- 私钥/助记词/导出的签名机密: 绝对不能在聊天中粘贴完整值。需打印到集成终端(标准输出),以确保在macOS、Windows和Linux上均可使用:优先使用**/
node -e或node -p打印JSON安全或纯文本内容;若PATH中无上述运行时,可在项目下创建临时文件**(已加入git忽略的路径),并运行命令将文件路径或内容打印到终端,然后在聊天中用用户的语言告知用户打开终端面板并从那里复制——仍不得将机密信息放入聊天。python -c - 公开存款/钱包地址(非机密标识符):可完整或摘要展示在聊天中,使用用户的语言,并添加用户所需的简短上下文。
- 其他 bulky 或混合响应: 在聊天中剥离或编辑机密信息;仅将完整私密内容放入终端/临时文件(如上所述);地址可在聊天中展示。
- 私钥/助记词/导出的签名机密: 绝对不能在聊天中粘贴完整值。需打印到集成终端(标准输出),以确保在macOS、Windows和Linux上均可使用:优先使用**
- 遵循安全规则。
2. Plugin wallet (plugin_wallet
)
plugin_wallet2. 插件钱包(plugin_wallet
)
plugin_wallet- : Same
PLUGIN_WALLET_TOKENrules as Wallet and rails in GatePay merchant discovery & agent orchestration (token inplugin_walletonly, never full token in chat).env: optional per product defaults; ifPLUGIN_WALLET_SERVER_URLrequires a URL for a tool call, set it per schema/vendor docs.inputSchema - : Add
PAYMENT_METHOD_PRIORITY. If this is the second or later rail, ask whetherplugin_walletshould become the default (first in list). Only reorder to put it first if the user confirms yes; otherwise append without changing the current default.plugin_wallet - No for this rail.
x402_quick_wallet_auth - Remind reload MCP after changes.
env
- : 遵循GatePay商户发现与Agent编排中钱包与通道的**
PLUGIN_WALLET_TOKEN规则(令牌仅存于plugin_wallet中,完整令牌绝不能出现在聊天中)。env:** 根据产品默认值可选;若**PLUGIN_WALLET_SERVER_URL**要求工具调用时提供URL,需根据Schema/供应商文档设置。inputSchema - : 添加**
PAYMENT_METHOD_PRIORITY。若这是第二个或后续通道,询问用户是否将plugin_wallet设为默认**(列表首位)。仅当用户确认同意时将其移至首位;否则追加到列表末尾,不得更改当前默认通道。plugin_wallet - 该通道无需调用****。
x402_quick_wallet_auth - 提醒用户在更改后重新加载MCP。
env
3. Private key / local signing (local_private_key
)
local_private_key3. 私钥/本地签名(local_private_key
)
local_private_key- In , ensure
envexists for local signing. Use a placeholder in shared repos; the user fills the real value only in their local MCP config. Never collect or repeat a private key in chat.EVM_PRIVATE_KEY - Add any (or equivalent) variables required by the MCP package docs.
RPC_URL - : Add
PAYMENT_METHOD_PRIORITY. If this is the second or later rail, ask whetherlocal_private_keyshould become the default. Only move it first if the user confirms yes.local_private_key - No for this rail unless the user also uses MCP Wallet (
x402_quick_wallet_auth).quick_wallet - Remind reload MCP after changes.
env
- 在**中,确保
env已配置用于本地签名。在共享仓库中使用占位符**;用户仅需在本地MCP配置中填写真实值。绝对不能在聊天中收集或重复私钥。EVM_PRIVATE_KEY - 添加MCP包文档要求的任何****(或等价)变量。
RPC_URL - : 添加**
PAYMENT_METHOD_PRIORITY。若这是第二个或后续通道,询问用户是否将local_private_key设为默认**。仅当用户确认同意时将其移至首位。local_private_key - 该通道无需调用**,除非用户同时使用MCP Wallet**(
x402_quick_wallet_auth)。quick_wallet - 提醒用户在更改后重新加载MCP。
env
4. Adding a second rail or changing default
4. 添加第二个通道或更改默认通道
- When the user binds a second or additional payment rail, never change the first token of (the current default) without an explicit user choice.
PAYMENT_METHOD_PRIORITY - Always ask a clear yes/no (or pick-one) question in the user’s language, e.g. “Should <rail> become the default payment method?” Only if the user answers yes, move that rail’s token to the front. If no, append the new rail or keep existing order as appropriate without promoting it to default.
- MCP Wallet (): Auth (Section 1) still comes before any
quick_walletchange that addsPAYMENT_METHOD_PRIORITY; after successful login, apply the same user-confirmed rule for whetherquick_walletbecomes default when other rails already exist.quick_wallet - Reordering among rails already listed (user wants to switch default only): still require explicit confirmation before editing which token is first.
- 当用户绑定第二个或更多支付通道时,绝对不能在无用户明确选择的情况下更改**的首个**令牌(当前默认通道)。
PAYMENT_METHOD_PRIORITY - 始终用用户的语言提出清晰的是/否(或选择)问题,例如“是否将**<通道>设为默认支付方式?”仅当用户回答是时,才将该通道的令牌移至首位**。若用户回答否,则追加新通道或保持现有顺序,不得将其设为默认。
- MCP Wallet(): 在添加
quick_wallet到quick_wallet之前,仍需先完成认证(第1节);登录成功后,当已有其他通道时,遵循相同的用户确认规则决定是否将PAYMENT_METHOD_PRIORITY设为默认。quick_wallet - 若用户仅想在已列出的通道间重新排序(仅切换默认通道):仍需在编辑首位令牌前获得明确确认。
5. Gate Exchange (gate_exchange
)
gate_exchange5. Gate Exchange(gate_exchange
)
gate_exchangeIf the user configures exchange-only pay: ensure Gate Exchange MCP is registered separately; set to include when that is the intended rail. Payment tools are only on the Exchange MCP — read each tool’s there.
PAYMENT_METHOD_PRIORITYgate_exchangeinputSchema若用户配置仅交易所支付:需确保Gate Exchange MCP已单独注册;当该通道为预期支付方式时,将**添加到。支付工具仅存在于Exchange MCP上——需查看该服务器上每个工具的**。
gate_exchangePAYMENT_METHOD_PRIORITYinputSchemaAuthentication State
认证状态
Payment and signing use whichever wallet rail the user has actually configured. Gate Pay MCP is read from the host’s MCP config (path and format depend on Cursor, VS Code, Claude Code, etc. — not hardcoded here).
env- : If set in
PAYMENT_METHOD_PRIORITY, comma-separated; first token = default. Tokens:env,quick_wallet,plugin_wallet,local_private_key. If unset, infer rails only from non-empty env keys / MCP session, or ask the user.gate_exchange - : Only when the user chose this rail:
local_private_key(and any RPC vars your MCP documents) must be set inEVM_PRIVATE_KEY— never collect private keys in chat. If empty, this rail is unavailable.env - (MCP Wallet): Setup = login success via tool auth (Section 1:
quick_walletif present, elsex402_quick_wallet_authwhen listed and schema supports MCP Wallet login). Nox402_requestfor users. Auth before writingMCP_WALLET_API_KEY; on failure, do not change thatPAYMENT_METHOD_PRIORITY. Pay: Workflow Step 5; on expiry, auth once then retry sign once.env - :
plugin_walletinPLUGIN_WALLET_TOKEN;envnot user-mandatory by default (see Wallet and rails). IfPLUGIN_WALLET_SERVER_URLrequires a URL argument, comply with schema. If the token is missing, this rail is unavailable.inputSchema - : Gate Exchange MCP configured separately; route there only when that MCP exists and user selects this rail.
gate_exchange
When a second or additional payment rail is added, ask whether the default should switch to the newly bound rail. Do not reorder until the user explicitly agrees to change the default.
PAYMENT_METHOD_PRIORITY支付和签名使用用户实际配置的钱包通道。Gate Pay MCP 从宿主的MCP配置中读取(路径和格式取决于Cursor、VS Code、Claude Code等——此处未硬编码)。
env- :若在**
PAYMENT_METHOD_PRIORITY中设置,为逗号分隔的字符串;首个令牌为默认通道。令牌包括:env、quick_wallet、plugin_wallet、local_private_key。若未设置**,仅根据非空环境键/MCP会话推断通道,或询问用户。gate_exchange - :仅当用户选择该通道时,
local_private_key(及MCP文档要求的任何RPC变量)需在**EVM_PRIVATE_KEY**中设置——绝对不能在聊天中收集私钥。若为空,该通道不可用。env - (MCP Wallet): 已设置 = 通过工具认证成功登录(第1节:若存在则使用**
quick_wallet,否则当x402_quick_wallet_auth已列出且Schema支持MCP Wallet登录时使用该工具)。无需用户提供x402_request。在写入MCP_WALLET_API_KEY之前需先完成认证;认证失败时不得更改该PAYMENT_METHOD_PRIORITY**。支付: 工作流步骤5;会话过期时,重新认证一次后重试签名一次。env - :
plugin_wallet需在PLUGIN_WALLET_TOKEN中;env默认无需用户配置(请查看钱包与通道)。若**PLUGIN_WALLET_SERVER_URL**要求URL参数,需遵循Schema。若令牌缺失,该通道不可用。inputSchema - :Gate Exchange MCP已单独配置;仅当该MCP存在且用户选择该通道时路由到此处。
gate_exchange
当添加第二个或更多支付通道时,询问用户是否将新绑定的通道设为默认。不得在用户明确同意更改默认通道前重新排序****。
PAYMENT_METHOD_PRIORITYGate Pay x402 Module (MCP Tools)
Gate Pay x402模块(MCP工具)
How to build arguments
(mandatory)
arguments如何构建arguments
(强制要求)
argumentsBefore every MCP tool call in this flow:
- Locate the tool by exact name on the correct server: discovery tools on the discovery server id (if any); all on the payment server id (see MCP Server Connection Detection).
x402_* - Read that tool's :
inputSchema,properties,required,enum.description - Assemble only from that schema and from allowed runtime values (user message, context, prior tool outputs).
arguments
Do not copy parameter tables from this Skill; the MCP is the source of truth. Any conflict between this file and → follow . If the MCP is not connected and schema is unavailable, complete MCP setup first or use vendor docs.
inputSchemainputSchemainputSchema在本流程中每次调用MCP工具前:
- 在正确的服务器上按准确名称找到工具:发现工具在发现服务器ID上(若存在);所有**工具在支付服务器ID上(请查看MCP服务器连接检测**)。
x402_* - 读取该工具的****:
inputSchema、properties、required、enum。description - 仅根据该Schema和允许的运行时值(用户消息、上下文、之前的工具输出)组装。
arguments
不得复制本技能中的参数表;MCP 是唯一权威来源。若本文档与存在冲突→遵循。若MCP未连接且Schema不可用,需先完成MCP设置或使用供应商文档。
inputSchemainputSchemainputSchemaTools (names to look up in MCP)
工具(需在MCP中查找的名称)
Merchant discovery: When listed on any server, use (or the exact name on that server) and its . Invoke on the discovery server, not on the payment server unless both tools are co-listed there. If absent everywhere, skip discovery calls.
discoveryResourceinputSchema| Tool | Classification | Side-effect level | Purpose | Parameters |
|---|---|---|---|---|
| Read (list) | None (no pay) | GatePay catalog search — invokable resources + metadata only (no pay/order) | |
| Read / HTTP | Merchant I/O only; no sign until later tools | Send merchant HTTP request; read status, headers, body | See MCP |
| Mixed | Low when used for HTTP/login; High when schema drives combined sign/pay—still requires consent before any pay | Only if listed — some builds use this for HTTP + 402 + optional sign, and/or MCP Wallet login via | See MCP |
| Write (session) | Establishes wallet session | MCP Wallet device/OAuth auth ( | See MCP |
| Write (session) | OAuth session for centralized pay | Gate Pay OAuth when user uses centralized_payment (Bearer token for submit per tool docs) | See MCP |
| Write (pay) | High — signs and submits payment | Parse 402, sign, submit payment (all-in-one) | See MCP |
| Write (sign) | High — produces signing material | Create signed payload / encoded signature only | See MCP |
| Write (pay) | High — submits payment | Submit payment with signature (split path) | See MCP |
| Write (pay) | High — centralized settlement when server exposes it | Account-center / centralized pay path per MCP (if listed) | See MCP |
Merchant / / come from the user message, conversation context, or upstream discovery (resource / / MCP discovery response — map per ); map field names to whatever the schema requires ( and/or , only as listed on the connected server).
urlmethodbodyoutputSchemainputSchemax402_place_orderx402_request商户发现: 当任何服务器列出该工具时,使用**(或该服务器上的准确名称)及其。仅在发现**服务器上调用,除非工具同时在支付服务器上列出。若所有服务器均未列出,跳过发现调用。
discoveryResourceinputSchema| 工具 | 分类 | 副作用级别 | 用途 | 参数 |
|---|---|---|---|---|
| 读取(列表) | 无(无支付操作) | GatePay目录搜索——仅返回可调用资源+元数据(无支付/下单) | |
| 读取/HTTP | 仅商户I/O;后续工具才会签名 | 发送商户HTTP请求;读取状态、头部、Body | 查看MCP |
| 混合 | 用于HTTP/登录时低;当Schema驱动签名/支付结合时高——仍需在支付前获得同意 | 仅当列出时使用——部分构建版本用其处理HTTP+402+可选签名,和/或通过 | 查看MCP |
| 写入(会话) | 建立钱包会话 | MCP Wallet设备/OAuth认证( | 查看MCP |
| 写入(会话) | 用于中心化支付的OAuth会话 | 当用户使用centralized_payment时的Gate Pay OAuth认证(根据工具文档使用Bearer令牌提交) | 查看MCP |
| 写入(支付) | 高——签名并提交支付 | 解析402、签名、提交支付(一站式) | 查看MCP |
| 写入(签名) | 高——生成签名材料 | 仅创建已签名的负载/编码签名 | 查看MCP |
| 写入(支付) | 高——提交支付 | 使用签名提交支付(拆分路径) | 查看MCP |
| 写入(支付) | 高——当服务器暴露时进行中心化结算 | 根据MCP进行账户中心/中心化支付(若列出) | 查看MCP |
商户的**//来自用户消息**、对话上下文或上游发现结果(资源//MCP发现响应——需根据****映射);需将字段名称映射到Schema要求的名称(和/或,仅当已连接服务器列出时使用)。
urlmethodbodyoutputSchemainputSchemax402_place_orderx402_requestExecution workflow
执行工作流
Map user intent to parameter extraction → MCP connection probe (Step 0) → preflight ( required fields, env rails) → tool calls → user-visible summary:
inputSchema- Extract merchant URL/method/body or discovery constraints from the user and context. If When is mandatory applies, call the discovery tool on the discovery MCP before any
discoveryResource/x402_place_orderon the payment MCP, then derive Step 4 fields from the selected catalog item.x402_request - Preflight per MCP Server Connection Detection and Authentication State; complete Wallet configuration procedure if the user is setting up a rail.
- Invoke tools in Workflow order; before each call, rebuild from that tool’s
arguments.inputSchema - Output per Report Template; on failures use Error handling.
将用户意图映射到参数提取→MCP连接探测(步骤0)→预检(必填字段、环境通道)→工具调用→用户可见摘要:
inputSchema- 提取商户URL/方法/Body或发现约束(来自用户和上下文)。若强制调用的场景适用,需在支付MCP上调用**
discoveryResource/x402_place_order之前,先在发现MCP**上调用发现工具,然后从所选目录项中导出步骤4的字段。x402_request - 根据MCP服务器连接检测和认证状态进行预检;若用户正在设置通道,完成钱包配置流程。
- 按工作流顺序调用工具;每次调用前,根据该工具的****重新构建
inputSchema。arguments - 根据报告模板输出结果;失败时使用错误处理。
Workflow
工作流
x402 Payment Flow
x402支付流程
text
Step 0: MCP detection (once per session) — payment MCP (§A) + discovery MCP (§B) when catalog is required — see **MCP Server Connection Detection**
|
Step 1: Payment intent checks — PAYMENT_METHOD_PRIORITY + env + user balance acknowledgment (user-confirmed)
|
Step 2: Choose rail
|- gate_exchange -> Gate Exchange MCP tools only (read each tool's inputSchema there)
+- Gate Pay x402 -> Continue
|
Step 3: Before each **`x402_*`** tool call on the **payment MCP** -> read that tool's inputSchema and build arguments
|
Step 4: Merchant HTTP + 402 on **payment MCP**: `x402_place_order` **or** (if listed) `x402_request` — per live tool list and schema
|- Non-402 -> handle per merchant rules
+- 402 -> extract payment challenge from response per MCP/tool docs (e.g. headers); keep url/method/body for retry
|
Step 5: If MCP Wallet (`quick_wallet`) -> before sign: `x402_quick_wallet_auth` **if listed**, else (if listed) satisfy login via `x402_request` per schema (e.g. `sign_mode`); on expiry -> same auth once then retry sign once (per product limits)
|
Step 6: x402_sign_payment (default) OR x402_create_signature -> x402_submit_payment (split); **or** if `x402_request` is listed: further `x402_request` calls per schema for sign/pay
For each step: arguments strictly from that tool's inputSchema; wire outputs only as schema/response shapes allow
|
Step 7: Summarize success to the user in their language; **addresses** may be in chat; **private keys** only via terminal/temp-file flow per **Safety Rules** and **Wallet configuration procedure** Section 1 step 5Discovery and pay confirmation: Catalog: If When is mandatory applies, call the catalog tool on the discovery server first → select resource → continue from Step 3–4 on the payment MCP. If the user already supplies sufficient merchant HTTP fields per schema, skip catalog. If no server lists a discovery tool, skip catalog (user URLs/context only) unless the user must add discovery MCP per Setup guide — discovery MCP. Pay consent: After the user sees a clear price (quote or 402 summary), obtain explicit pay consent before Step 5–6 (merge with Step 1 if needed to avoid asking twice). Full rules: GatePay merchant discovery & agent orchestration.
discoveryResourceSame-server rule: All steps for one merchant order / 402 challenge use the same payment MCP server id. Discovery may use a different server id.
x402_*text
步骤0:MCP检测(每个会话一次)——支付MCP(§A)+ 当需要目录服务时的发现MCP(§B)——请查看**MCP服务器连接检测**
|
步骤1:支付意图检查——PAYMENT_METHOD_PRIORITY + 环境 + 用户余额确认(用户已确认)
|
步骤2:选择通道
|- gate_exchange -> 仅使用Gate Exchange MCP工具(查看该服务器上每个工具的inputSchema)
+- Gate Pay x402 -> 继续
|
步骤3:在**支付MCP**上调用每个**`x402_*`**工具前→读取该工具的inputSchema并构建参数
|
步骤4:在**支付MCP**上处理商户HTTP + 402:`x402_place_order` **或**(若列出)`x402_request`——根据实际工具列表和Schema
|- 非402响应 -> 根据商户规则处理
+- 402响应 -> 根据MCP/工具文档从响应中提取支付挑战(例如头部);保留url/method/Body用于重试
|
步骤5:若使用MCP Wallet(`quick_wallet`)→签名前:若列出则调用`x402_quick_wallet_auth`,否则(若列出)根据Schema通过`x402_request`完成登录(例如`sign_mode`);会话过期时→重新认证一次后重试签名一次(根据产品限制)
|
步骤6:x402_sign_payment(默认)或x402_create_signature -> x402_submit_payment(拆分路径);**或**若列出`x402_request`:根据Schema进行后续`x402_request`调用以完成签名/支付
每个步骤:参数严格来自该工具的inputSchema;仅根据Schema/响应结构传递输出
|
步骤7:用用户的语言向用户总结成功结果;**地址**可在聊天中展示;**私钥**仅通过终端/临时文件流程传递(根据**安全规则**和**钱包配置流程**第1节步骤5)发现与支付确认: 目录服务: 若强制调用的场景适用,先在发现服务器上调用目录工具→选择资源→在支付MCP上从步骤3-4开始继续。若用户已提供足够的商户HTTP字段以满足Schema要求,跳过目录服务。若无服务器列出发现工具,跳过目录服务(仅使用用户URL/上下文),除非用户需根据设置指南——发现MCP添加发现MCP。支付同意: 用户看到明确价格(报价或402摘要)后,需在步骤5-6之前获得明确支付同意(可与步骤1合并以避免重复询问)。完整规则请查看GatePay商户发现与Agent编排。
discoveryResource同服务器规则: 对于一个商户订单/402挑战,所有**步骤需使用同一支付MCP服务器ID**。发现功能可使用不同服务器ID。
x402_*Judgment Logic Summary
判断逻辑摘要
- Use Routing Rules to pick the subsection in this file (wallet setup, discovery, x402 pay, Exchange, MCP connectivity).
- Discovery first when mandatory: If a discovery catalog tool is listed (on any server) and the user buys/orders without merchant HTTP parameters sufficient for , call that tool on its server before
inputSchema/x402_place_orderon the payment server — see Whenx402_requestis mandatory.discoveryResource - Schema-first: Every MCP object must match the target tool’s
arguments; on conflict,inputSchemawins.inputSchema - Consent before writes: No signing, submission, or centralized payment tools until clear price + explicit user confirmation; confirmation covers all write steps in the flow (General Rules and Safety Rules).
- Same-server (pay): One 402 challenge → one payment MCP server id for all related calls (discovery may be elsewhere).
x402_* - Rails: Only switch or add default per Section 4 (explicit user choice).
PAYMENT_METHOD_PRIORITY
- 使用路由规则选择本文档中的小节(钱包设置、发现、x402支付、交易所、MCP连接性)。
- 强制先发现: 若发现目录工具已列出(在任何服务器上)且用户购买/下单时未提供足够的商户HTTP参数以满足**,需在支付服务器上调用
inputSchema/x402_place_order之前,先在该工具所在服务器上调用发现工具——请查看强制调用x402_request的场景**。discoveryResource - Schema优先: 每个MCP 对象必须匹配目标工具的**
arguments;若存在冲突,inputSchema优先**。inputSchema - 写入前需同意: 在用户看到明确价格并给出明确确认前,不得调用签名、提交或中心化支付工具;确认需覆盖流程中的所有写入步骤(通用规则和安全规则)。
- 同服务器(支付): 一个402挑战→所有相关**调用使用一个**支付MCP服务器ID(发现功能可在其他服务器)。
x402_* - 通道规则: 仅根据第4节(用户明确选择)切换或添加默认****。
PAYMENT_METHOD_PRIORITY
Report Template
报告模板
After wallet setup or payment, respond in the user’s language with:
- Outcome: success, failed, cancelled, or blocked (with reason).
- Amounts / assets / chain when the MCP or merchant returned them; never invent values.
- References from tool output (ids, hashes) only when present.
- Next steps: retry, change rail, reload MCP, or end—without fabricating order or payment status.
钱包设置或支付完成后,用用户的语言回复:
- 结果: 成功、失败、取消或阻止(含原因)。
- 金额/资产/链: 仅当MCP或商户返回时展示;绝对不能自行编造值。
- 参考信息: 仅展示工具输出中的引用(ID、哈希)(若存在)。
- 下一步: 重试、更改通道、重新加载MCP或结束——不得编造订单或支付状态。
Scenarios
场景
QA-oriented Context / Prompt Examples / Expected Behavior templates live in .
references/scenarios.md面向QA的上下文/示例提示/预期行为模板位于****。
references/scenarios.mdError handling
错误处理
| Situation | Suggested action |
|---|---|
| MCP timeout / transport error | Retry once; if it persists, suggest restarting the MCP host or checking network; re-run MCP Server Connection Detection. |
Auth expired / | Run |
| User declines pay after seeing price | Stop; do not call sign/pay tools; offer another merchant or end. |
| 402 / insufficient balance | Surface MCP error text; suggest another configured rail only if available and the user agrees (Wallet and rails). |
| 402 challenge missing or unparsable | Do not invent payment params; re-run the HTTP tool your server lists ( |
Missing tool / no | Finish install from the setup guide; do not guess parameters. |
| Widen search text, check |
| 场景 | 建议操作 |
|---|---|
| MCP超时/传输错误 | 重试一次;若仍失败,建议重启MCP宿主或检查网络;重新运行MCP服务器连接检测。 |
认证过期/ | 根据Schema调用** |
| 用户看到价格后拒绝支付 | 停止;不得调用签名/支付工具;提供其他商户选项或结束流程。 |
| 402/余额不足 | 展示MCP错误文本;仅当其他通道可用且用户同意时,建议使用其他已配置通道(钱包与通道)。 |
| 402挑战缺失或无法解析 | 不得自行编造支付参数;重新运行服务器列出的HTTP工具( |
工具缺失/无 | 根据设置指南完成安装;不得猜测参数。 |
** | 放宽搜索文本、检查 |
Data handling & eligibility
数据处理与合规性
- Data flow: Payment traffic and wallet go to the payment MCP (
env). Discovery queries go to whichever server lists the catalog tool (possibly a remote URL MCP). Secrets (gatepay-local-mcp, fullEVM_PRIVATE_KEY, private keys from tool output) stay in payment MCP env or integrated terminal flows—not in chat (Safety Rules).PLUGIN_WALLET_TOKEN - Age: Payment and account-linked flows assume the user is 18+ and complies with applicable Gate user agreements; do not proceed with payment setup if the user cannot meet those requirements.
- 数据流: 支付流量和钱包**发送到支付MCP**(
env)。发现查询发送到列出目录工具的服务器(可能是远程URL MCP)。机密信息(gatepay-local-mcp、完整EVM_PRIVATE_KEY、工具输出中的私钥)仅存于支付MCP env或集成终端流程中——不得出现在聊天中(安全规则)。PLUGIN_WALLET_TOKEN - 年龄要求: 支付和账户关联流程假设用户年满18岁且遵守适用的Gate用户协议;若用户无法满足这些要求,不得继续支付设置。
Sub-Modules
子模块
This skill uses single-file routing for procedural logic: wallet setup, discovery, workflow, and Exchange path all live in this . Use Routing Rules to jump to those sections. holds QA-oriented scenarios (prompt shapes and expected behavior); it is not a runtime routing submodule. Human-oriented docs: , .
SKILL.mdreferences/scenarios.mdREADME.mdCHANGELOG.md本技能使用单文件路由处理流程逻辑:钱包设置、发现、工作流和交易所路径均位于本文件中。使用路由规则跳转到相应小节。包含面向QA的场景(提示格式和预期行为);它不是运行时路由子模块。面向用户的文档:、。
SKILL.mdreferences/scenarios.mdREADME.mdCHANGELOG.mdGate Exchange path
Gate Exchange路径
When is selected and Gate Exchange MCP is available: use only Exchange MCP tools for order/pay. Before each call, read that tool's on the Exchange server. Do not complete the same Gate Pay order using a third-party x402 MCP.
gate_exchangeinputSchemax402_place_order当选择且Gate Exchange MCP可用时:仅使用Exchange MCP工具进行下单/支付。每次调用前,查看Exchange服务器上该工具的****。不得在第三方x402 MCP上完成同一Gate Pay 订单。
gate_exchangeinputSchemax402_place_orderFollow-up Routing
后续路由
| User Intent After Flow | Target |
|---|---|
| Change default payment / add second wallet | This file — Wallet configuration procedure Section 4 |
Retry after MCP Wallet ( | This file — Workflow Step 5–6 |
| Merchant params missing | Ask user or upstream; then Step 4 with the HTTP tool the server lists ( |
| Discovery empty / cannot select | GatePay merchant discovery & agent orchestration — relax |
| User declines pay after seeing price | Stop pay tools; offer another merchant or end |
| Plugin rail failed, no other configured rail | GatePay merchant discovery & agent orchestration — do not auto-start unconfigured |
| 流程后用户意图 | 目标 |
|---|---|
| 更改默认支付方式/添加第二个钱包 | 本文档——钱包配置流程第4节 |
MCP Wallet( | 本文档——工作流步骤5-6 |
| 商户参数缺失 | 询问用户或上游;然后使用服务器列出的HTTP工具( |
| 发现结果为空/无法选择 | GatePay商户发现与Agent编排——放宽 |
| 用户看到价格后拒绝支付 | 停止支付工具;提供其他商户选项或结束流程 |
| 插件通道失败,无其他已配置通道 | GatePay商户发现与Agent编排——不得自动启动未配置的 |
Cross-Skill Collaboration
跨技能协作
Other skills or upstream layers may supply merchant / / or discovery context. This skill orchestrates discovery (on discovery MCP when present) → selection → optional quote → pay confirmation → on the payment MCP (and optionally Gate Exchange MCP), using for each tool call. It does not replace full merchant catalogs outside the MCP surface.
urlmethodbodyx402_*inputSchema其他技能或上游层可能提供商户**//或发现上下文。本技能编排发现(当存在时在发现MCP上)→选择→可选报价→支付确认→支付MCP上的工具(及可选Gate Exchange MCP),每次工具调用均使用**。它不替代MCP之外的完整商户目录。
urlmethodbodyx402_*inputSchemaSupported networks & assets
支持的网络与资产
Networks, tokens, and amounts are defined by the merchant 402 / payment-required payload and MCP behavior — not enumerated here. Follow tool responses and merchant rules.
网络、代币和金额由商户402/支付要求负载和MCP行为定义——未在此处枚举。需遵循工具响应和商户规则。
Safety Rules
安全规则
- Schema-first calls: Always align with the target tool's
argumentsbefore invoking MCP. Skill vsinputSchema→inputSchemawins (same as top Gate Pay x402 layer note and How to buildinputSchema).arguments - Sensitive payloads — MCP Wallet (): Private keys, seeds, and exported signing secrets from the tool go only to the integrated terminal (or gitignored temp file + terminal pointer), never the agent chat — see Wallet configuration procedure Section 1 step 5; works on Windows, macOS, Linux via
quick_wallet/nodeor file fallback. Public deposit / wallet addresses may appear in chat. Do not dump huge raw JSON into chat; redact secrets in chat.python - Private keys — rails and user paste: : User sets
local_private_keyonly in local MCPEVM_PRIVATE_KEY— never collect or repeat that key in chat (Section 3). MCP Wallet: Tool-returned secrets → terminal only (Section 1 step 5). If the user pastes any private key in chat: do not echo it, store it from chat, or sign from chat; tell them to put it only inenvand to stop sending keys in chat. Signing uses env as MCP reads it.env - Open API tokens: Store in ; mask or confirm in chat without exposing full values.
env - Same-server / no cross-vendor mix for one Gate order: see Workflow.
x402_place_order - Session vs chat: Do not rely on chat memory for MCP Wallet login state; use and/or (when listed)
x402_quick_wallet_authfor MCP Wallet login per schema; usex402_requestwhen listed and the user uses centralized_payment (see Wallet configuration procedure Section 1); rely on MCP responses as documented.x402_gate_pay_auth
- Schema优先调用: 调用MCP前,始终确保与目标工具的**
arguments一致。技能与inputSchema冲突→inputSchema优先(与顶部Gate Pay x402层说明和如何构建inputSchema**一致)。arguments - 敏感负载——MCP Wallet(): 工具返回的私钥、助记词和导出的签名机密仅发送到集成终端(或已加入git忽略的临时文件+终端指引),绝对不能发送到Agent聊天——请查看钱包配置流程第1节步骤5;通过
quick_wallet/node或文件回退方式支持Windows、macOS、Linux。公开存款/钱包地址可在聊天中展示。不得将庞大的原始JSON转储到聊天中;在聊天中编辑机密信息。python - 私钥——通道与用户粘贴: : 用户仅在本地MCP
local_private_key中设置env——绝对不能在聊天中收集或重复该密钥(第3节)。MCP Wallet: 工具返回的机密→仅发送到终端(第1节步骤5)。若用户在聊天中粘贴任何私钥: 不得回显、从聊天中存储或从聊天中签名;告知用户仅在**EVM_PRIVATE_KEY中设置密钥,并停止在聊天中发送密钥。签名使用MCP读取的env**中的密钥。env - Open API令牌: 存储在****中;在聊天中屏蔽或确认,不得暴露完整值。
env - 同服务器/禁止跨供应商混合处理一个Gate 订单:请查看工作流。
x402_place_order - 会话与聊天: 不得依赖聊天记忆存储MCP Wallet登录状态;使用**和/或(当列出时)
x402_quick_wallet_auth根据Schema完成MCP Wallet登录;当用户使用centralized_payment且x402_request已列出时,使用该工具(请查看钱包配置流程**第1节);需遵循MCP文档依赖工具响应。x402_gate_pay_auth