PayStage Preflight

io.github.base-buzz由 GitHub 账号 base-buzz 发布v0.2.3更新于 Nov 12, 2026

Evaluate x402 PaymentRequired against a local spending policy before an agent pays

发布方自己的服务:Preflight

已验证STDIO仅桌面金融安全与监控

概览

AI 生成的概览

本地 stdio MCP 服务器,在代理付款前用 JSON 消费策略校验 x402 PaymentRequired 载荷,返回 pay、review 或 do_not_pay。

可以做什么
  • 评估付款请求:用本地策略校验 x402 PaymentRequired 载荷,得到 pay、review 或 do_not_pay 三种结论之一。
  • 套用消费规则:允许的网络、资产与收款地址,单次与单会话金额上限,人工审核阈值,以及最大超时。
  • 将格式错误或违反策略的请求判为 do_not_pay,将超过人工阈值的请求判为 review。
适用场景
当代理能够发起 x402 付款,而你想在资金流出前用确定性的本地检查拦截或升级不符合规则的付款时使用。
运行要求
需要 Node.js 与 npx 以 stdio 方式在本地运行该 npm 包,并需要一个策略 JSON 文件,其绝对路径通过 PAYSTAGE_POLICY_PATH 指定。判定过程不需要账号、API 密钥或网络访问。
安装前请注意
结论只是建议:它本身不付款也不托管资金,客户端必须真正遵守 pay、review 与 do_not_pay。策略写错(网络、资产、收款地址或上限)会直接改变被批准的付款,请仔细核对策略文件。README 说明该包会读取策略文件与 PAYSTAGE_POLICY_PATH,并提到相关包使用 PAYSTAGE_RPC_URL。

安装

在 SourceWeft 中

  1. 打开 控制台中的 PayStage Preflight,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

@paystage/preflight

Evaluate an x402 PaymentRequired against a local spending policy before your agent pays. Returns one of three verdicts: pay, review, or do_not_pay.

  • Local-first — policy lives in a JSON file on your machine. No secrets, no network calls to decide.
  • MCP-native — runs as a stdio MCP server so Claude Desktop, Cursor, and any MCP client can call it as a tool.
  • Deterministic — same input + same policy ⇒ same verdict.

Install

Run directly with npx (no global install):

bash
npx -y @paystage/preflight

Or add it to your MCP client config.

Claude Desktop

Add to claude_desktop_config.json:

json
{  "mcpServers": {    "paystage-preflight": {      "command": "npx",      "args": ["-y", "@paystage/preflight"],      "env": {        "PAYSTAGE_POLICY_PATH": "/absolute/path/to/policy.json"      }    }  }}

Cursor

Add to .cursor/mcp.json:

json
{  "mcpServers": {    "paystage-preflight": {      "command": "npx",      "args": ["-y", "@paystage/preflight"],      "env": {        "PAYSTAGE_POLICY_PATH": "/absolute/path/to/policy.json"      }    }  }}

Example policy.json

json
{  "version": 1,  "name": "standard",  "allowed_networks": ["eip155:8453", "eip155:84532"],  "allowed_assets": [    "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",    "0x036CbD53842c5426634e7929541eC2318f3dCF7e"  ],  "allowed_pay_to": ["0x209693Bc6afc0C5328bA36FaF03C514EF312287C"],  "max_amount_per_call": "1.00",  "max_amount_per_session": "10.00",  "require_human_above": "0.50",  "max_timeout_seconds": 300,  "default_verdict": "review"}

Amounts are human-readable USDC (e.g. "0.50" = 0.50 USDC). Networks use CAIP-2 identifiers.

Verdicts

VerdictMeaning
payWithin policy — safe to proceed automatically.
reviewAllowed but above a human threshold — ask a human before paying.
do_not_payViolates policy (network, asset, payTo, amount, timeout, or malformed).

Supply chain and access

Socket.dev scores this package on what it can do, not what it does with it, so the flags it raises are worth explaining rather than removing:

FlagWhy it is there
Filesystem accessReads the policy JSON you point it at (policy_path / PAYSTAGE_POLICY_PATH). Nothing is written.
Environment variable accessPAYSTAGE_POLICY_PATH only (and PAYSTAGE_RPC_URL via auth-watch).
Network access, URL stringsNone in this package. The RPC endpoints you may see in the tree belong to @paystage/auth-watch.

No shell, no eval, no telemetry, no key custody. The full table is in SECURITY.md; the deny list is published with a citation per entry in KNOWN_DRAINERS.md.

Links

来源:packages/preflight/README.md,提交 1b92c54

工具

1

evaluate_mcp_payment

Evaluate an x402 PaymentRequired payload against a PayStage spending policy before paying

输入参数policypolicy_pathpayment_required必填

版本历史

1
  1. v0.2.3最新Nov 12, 2026

评分

已满足适用检查项的 90%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分
  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具必需15 分
  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分

其他 Preflight 集成