プロトタイプ · プレビュー版:公式レジストリのすべてのサーバーを掲載し、30分ごとに同期しています。Google でログインするとレビューを書けます。プロトタイプ · 30分ごとに更新
PopNx MCPAIを使う人のためのMCPサーバー · やさしい言葉で解説

PayStage x402 Guard — payment safety before the wallet signs

作者:base-buzzバージョン 0.4.9i★ 5 (リポジトリ全体のスター)iパソコンで動く公式サイト ↗
レジストリ名io.github.base-buzz/x402-guard

インストール方法

What it does

x402 payment safety: judge a payment against your policy before signing. Read-only, never signs.

  • Connects パソコンで動く
  • Account or key No key needed
  • Category ネットショップ・決済

この順位の理由

一覧は利用スコア(100 点満点)で並びます。内訳は次のとおり

人気28/80GitHub スターか週間ダウンロード数。大きい方を 60、小さい方を 20 で数えます
新しさ12/1230 日以内のリリースかコード更新で満点
応答中0/8前回の確認でクラウドのエンドポイントが応答
利用スコア40/100

品質: 基本チェック 3/3 項目に合格(表示のみ、並び順には不使用) · 勢い: 207 (「急上昇」タブでのみ使用)

インストール

使っているAIアプリを選んで、設定をコピーしてください。

ひとことで AI にインストールしてもらう

PayStage x402 Guard — payment safety before the wallet signs をインストールして。https://mcp.popnx.com/i/base-buzz-x402-guard.md に従い、コマンドを見せて、私が OK するまで実行しないで。

パソコンで作業できる AI(Claude Code や Cursor など)に貼り付けます。手順を読み、コマンドを見せて、あなたの OK を待ちます。キー不要・登録不要。 · AI が読む全文を見る

チェック 3/3 合格 · あなたのパソコンで動きます · ✓ コマンド確認済み 2026年11月18日

まず:どの AI を使っていますか?

使っているアプリを選ぶと、下に手順が表示されます。

Claude につなげますが、先に準備が必要です

先にパソコンへ Node.js を入れてください(1 回だけ) · パソコン版 Claude アプリ(Windows または Mac)のみ。Web やスマホでは使えません

AI にインストールしてもらう

このメッセージを Claude のチャットに貼り付けます。AI がパソコンを確認し、変更するファイルを伝え、毎回あなたの了承を待ちます。

このパソコンの Claude に MCP server PayStage x402 Guard — payment safety before the wallet signs を入れてください。順番に:1) node -v で Node.js があるか確認。なければ https://nodejs.org/en/download から入れるよう私に伝え、自分では入れない。2) この設定だけを使う(PopNx MCP の確認済み):{ "mcpServers": { "x402-guard": { "command": "npx", "args": [ "-y", "@paystage/x402-guard" ] } } } 3) 変更するファイルのフルパスか実行するコマンドを伝えて、私の了承を待つ。4) キーは不要。5) 了承した内容を実行し、PayStage x402 Guard — payment safety before the wallet signs のツールが本当に表示されるか確認する。

このメッセージにあなたのキーは含まれません。キーが必要な場合は、AI がファイルやアプリの入力欄にご自身で貼るよう案内します。

  1. Node.js を入れる(まだなければ)

    もう入っていますか?先に確認 · ターミナルを開き、このコマンドを入力して Enter

    node -v
    • バージョン番号(例 v26.13.1)が出る = 入っています。この手順は飛ばせます
    • "command not found"(Windows では "is not recognized")が出る = まだ入っていないか、入れた直後でターミナルを開き直す必要があります
    ターミナルの開き方

    Mac:⌘ + Space を押し、Terminal と入力して Enter

    Windows:スタートメニューを開き、Windows PowerShell と入力して「開く」

    まだ入っていない場合: 公式ダウンロードページで LTS 版と、クリックで進むインストーラーを選びます:Mac は .pkg、Windows は .msi。ダブルクリックして最後まで進めるだけで、curl コマンドは不要です

    Node.js のダウンロードページを開く ↗

    入れ終わったらターミナルを閉じて開き直し、同じコマンドをもう一度実行します。バージョン番号が出れば完了です: node -v

    一度入れれば、Node.js を使うすべてのツールで使えます

  2. パソコン版 Claude アプリの設定ファイルを開く

    SettingsDeveloperEdit Config

  3. この設定を貼り付けて保存

    {
      "mcpServers": {
        "x402-guard": {
          "command": "npx",
          "args": [
            "-y",
            "@paystage/x402-guard"
          ]
        }
      }
    }
  4. Claude を終了してもう一度開く

  5. 試してみる

    PayStage x402 Guard — payment safety before the wallet signs を使って、私に何ができるか教えて、1 つやってみせて

    ✓ Claude が PayStage x402 Guard — payment safety before the wallet signs を使っていると言うか、回答に PayStage x402 Guard — payment safety before the wallet signs のツール名が出れば接続成功です

メニュー名は 2026年11月11日 に Anthropic のヘルプページで確認 · アプリのバージョンにより画面が少し違うことがあります

ChatGPT はまだ PayStage x402 Guard — payment safety before the wallet signs につなげません

PayStage x402 Guard — payment safety before the wallet signs はパソコンに入れて使うものですが、ChatGPT は Web 上で動くサーバーにしかつなげません

代わりにできること

A · PayStage x402 Guard — payment safety before the wallet signs につなげるアプリを使う

  • 先にパソコンへ Node.js を入れてください(1 回だけ) · パソコン版 Claude アプリ(Windows または Mac)のみ。Web やスマホでは使えません
  • 先にパソコンへ Node.js を入れてください(1 回だけ)
  • 先にパソコンへ Node.js を入れてください(1 回だけ)
  • 先にパソコンへ Node.js を入れてください(1 回だけ)

B · ネットショップ・決済 の中で ChatGPT につなげる別のサーバー

同じカテゴリでよく使われているものから、キーなしでアドレスだけでつなげるものを選びました

Claude Code につなげますが、先に準備が必要です

先にパソコンへ Node.js を入れてください(1 回だけ)

AI にインストールしてもらう

このメッセージを Claude Code のチャットに貼り付けます。AI がパソコンを確認し、変更するファイルを伝え、毎回あなたの了承を待ちます。

このパソコンの Claude Code に MCP server PayStage x402 Guard — payment safety before the wallet signs を入れてください。順番に:1) node -v で Node.js があるか確認。なければ https://nodejs.org/en/download から入れるよう私に伝え、自分では入れない。2) この設定だけを使う(PopNx MCP の確認済み):claude mcp add --scope user x402-guard -- npx -y @paystage/x402-guard 3) 変更するファイルのフルパスか実行するコマンドを伝えて、私の了承を待つ。4) キーは不要。5) 了承した内容を実行し、PayStage x402 Guard — payment safety before the wallet signs のツールが本当に表示されるか確認する。

このメッセージにあなたのキーは含まれません。キーが必要な場合は、AI がファイルやアプリの入力欄にご自身で貼るよう案内します。

  1. Node.js を入れる(まだなければ)

    もう入っていますか?先に確認 · ターミナルを開き、このコマンドを入力して Enter

    node -v
    • バージョン番号(例 v26.13.1)が出る = 入っています。この手順は飛ばせます
    • "command not found"(Windows では "is not recognized")が出る = まだ入っていないか、入れた直後でターミナルを開き直す必要があります
    ターミナルの開き方

    Mac:⌘ + Space を押し、Terminal と入力して Enter

    Windows:スタートメニューを開き、Windows PowerShell と入力して「開く」

    まだ入っていない場合: 公式ダウンロードページで LTS 版と、クリックで進むインストーラーを選びます:Mac は .pkg、Windows は .msi。ダブルクリックして最後まで進めるだけで、curl コマンドは不要です

    Node.js のダウンロードページを開く ↗

    入れ終わったらターミナルを閉じて開き直し、同じコマンドをもう一度実行します。バージョン番号が出れば完了です: node -v

    一度入れれば、Node.js を使うすべてのツールで使えます

  2. ターミナルを開く

    Mac:Command+スペースで Terminal と入力 · Windows:PowerShell を開く

  3. このコマンドを貼り付けて Enter

    claude mcp add --scope user x402-guard -- npx -y @paystage/x402-guard
  4. Claude Code で /mcp と入力

    PayStage x402 Guard — payment safety before the wallet signs が一覧にあり、接続済みと表示されれば OK です

  5. 試してみる

    PayStage x402 Guard — payment safety before the wallet signs を使って、私に何ができるか教えて、1 つやってみせて

    ✓ Claude Code が PayStage x402 Guard — payment safety before the wallet signs を使っていると言うか、回答に PayStage x402 Guard — payment safety before the wallet signs のツール名が出れば接続成功です

メニュー名は 2026年11月11日 に Anthropic のヘルプページで確認 · アプリのバージョンにより画面が少し違うことがあります

Cursor につなげますが、先に準備が必要です

先にパソコンへ Node.js を入れてください(1 回だけ)

AI にインストールしてもらう

このメッセージを Cursor のチャットに貼り付けます。AI がパソコンを確認し、変更するファイルを伝え、毎回あなたの了承を待ちます。

このパソコンの Cursor に MCP server PayStage x402 Guard — payment safety before the wallet signs を入れてください。順番に:1) node -v で Node.js があるか確認。なければ https://nodejs.org/en/download から入れるよう私に伝え、自分では入れない。2) この設定だけを使う(PopNx MCP の確認済み):{ "mcpServers": { "x402-guard": { "command": "npx", "args": [ "-y", "@paystage/x402-guard" ] } } } 3) 変更するファイルのフルパスか実行するコマンドを伝えて、私の了承を待つ。4) キーは不要。5) 了承した内容を実行し、PayStage x402 Guard — payment safety before the wallet signs のツールが本当に表示されるか確認する。

このメッセージにあなたのキーは含まれません。キーが必要な場合は、AI がファイルやアプリの入力欄にご自身で貼るよう案内します。

  1. Node.js を入れる(まだなければ)

    もう入っていますか?先に確認 · ターミナルを開き、このコマンドを入力して Enter

    node -v
    • バージョン番号(例 v26.13.1)が出る = 入っています。この手順は飛ばせます
    • "command not found"(Windows では "is not recognized")が出る = まだ入っていないか、入れた直後でターミナルを開き直す必要があります
    ターミナルの開き方

    Mac:⌘ + Space を押し、Terminal と入力して Enter

    Windows:スタートメニューを開き、Windows PowerShell と入力して「開く」

    まだ入っていない場合: 公式ダウンロードページで LTS 版と、クリックで進むインストーラーを選びます:Mac は .pkg、Windows は .msi。ダブルクリックして最後まで進めるだけで、curl コマンドは不要です

    Node.js のダウンロードページを開く ↗

    入れ終わったらターミナルを閉じて開き直し、同じコマンドをもう一度実行します。バージョン番号が出れば完了です: node -v

    一度入れれば、Node.js を使うすべてのツールで使えます

  2. このボタンで Cursor を開く

    Cursor で開く

    Cursor がインストールの確認をするので Install を押します

  3. Cursor の AI チャットを Agent モードで開く

  4. 試してみる

    PayStage x402 Guard — payment safety before the wallet signs を使って、私に何ができるか教えて、1 つやってみせて

    ✓ Cursor が PayStage x402 Guard — payment safety before the wallet signs を使っていると言うか、回答に PayStage x402 Guard — payment safety before the wallet signs のツール名が出れば接続成功です

メニュー名は 2026年11月11日 に Cursor のヘルプページで確認 · アプリのバージョンにより画面が少し違うことがあります

VS Code につなげますが、先に準備が必要です

先にパソコンへ Node.js を入れてください(1 回だけ)

AI にインストールしてもらう

このメッセージを VS Code のチャットに貼り付けます。AI がパソコンを確認し、変更するファイルを伝え、毎回あなたの了承を待ちます。

このパソコンの VS Code に MCP server PayStage x402 Guard — payment safety before the wallet signs を入れてください。順番に:1) node -v で Node.js があるか確認。なければ https://nodejs.org/en/download から入れるよう私に伝え、自分では入れない。2) この設定だけを使う(PopNx MCP の確認済み):{ "servers": { "x402-guard": { "type": "stdio", "command": "npx", "args": [ "-y", "@paystage/x402-guard" ] } } } 3) 変更するファイルのフルパスか実行するコマンドを伝えて、私の了承を待つ。4) キーは不要。5) 了承した内容を実行し、PayStage x402 Guard — payment safety before the wallet signs のツールが本当に表示されるか確認する。

このメッセージにあなたのキーは含まれません。キーが必要な場合は、AI がファイルやアプリの入力欄にご自身で貼るよう案内します。

  1. Node.js を入れる(まだなければ)

    もう入っていますか?先に確認 · ターミナルを開き、このコマンドを入力して Enter

    node -v
    • バージョン番号(例 v26.13.1)が出る = 入っています。この手順は飛ばせます
    • "command not found"(Windows では "is not recognized")が出る = まだ入っていないか、入れた直後でターミナルを開き直す必要があります
    ターミナルの開き方

    Mac:⌘ + Space を押し、Terminal と入力して Enter

    Windows:スタートメニューを開き、Windows PowerShell と入力して「開く」

    まだ入っていない場合: 公式ダウンロードページで LTS 版と、クリックで進むインストーラーを選びます:Mac は .pkg、Windows は .msi。ダブルクリックして最後まで進めるだけで、curl コマンドは不要です

    Node.js のダウンロードページを開く ↗

    入れ終わったらターミナルを閉じて開き直し、同じコマンドをもう一度実行します。バージョン番号が出れば完了です: node -v

    一度入れれば、Node.js を使うすべてのツールで使えます

  2. このボタンで VS Code を開く

    VS Code で開く

    VS Code がインストールの確認をするので Install を押します

  3. VS Code の AI チャットを Agent モードで開く

  4. 試してみる

    PayStage x402 Guard — payment safety before the wallet signs を使って、私に何ができるか教えて、1 つやってみせて

    ✓ VS Code が PayStage x402 Guard — payment safety before the wallet signs を使っていると言うか、回答に PayStage x402 Guard — payment safety before the wallet signs のツール名が出れば接続成功です

メニュー名は 2026年11月11日 に VS Code のヘルプページで確認 · アプリのバージョンにより画面が少し違うことがあります

Windsurf、Zed、Gemini CLI など MCP を使える他のアプリは追加方法がそれぞれ違います。アプリ一覧で確認してください

MCP を使えるアプリをすべて見る →

JSON 設定は下の「開発者向け」にあります

つまずいたら?PayStage x402 Guard — payment safety before the wallet signs を使っている人に聞いてみましょう💬 ディスカッション →
開発者向け:ターミナルのコマンドと JSON 設定

パソコンにインストール

Claude Code

claude mcp add --scope user x402-guard -- npx -y @paystage/x402-guard

Claude Desktop (claude_desktop_config.json)

{
  "mcpServers": {
    "x402-guard": {
      "command": "npx",
      "args": [
        "-y",
        "@paystage/x402-guard"
      ]
    }
  }
}

Cursor (~/.cursor/mcp.json)

{
  "mcpServers": {
    "x402-guard": {
      "command": "npx",
      "args": [
        "-y",
        "@paystage/x402-guard"
      ]
    }
  }
}

VS Code (mcp.json)

{
  "servers": {
    "x402-guard": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@paystage/x402-guard"
      ]
    }
  }
}

この設定は、作者のレジストリ登録情報から作成しています。READMEと違う場合は、READMEに従ってください。

ひと目でわかる

GitHubスターi
5 (リポジトリ全体のスター)
このリポジトリには複数の MCP があり、スターは順位で1件だけ数えます
週あたりのダウンロードi
2,371/週
接続方法
パソコンで動く
最新バージョンi
0.4.9
レジストリ公開日i
2026年11月18日
コードの最終更新i
2026年11月18日
作者
base-buzz
パッケージ
npm: @paystage/x402-guard
ウェブサイト
paystage.xyz
レジストリでの状態
有効

使えるアプリ

このサーバーのつなぎ方と、各アプリの公式ドキュメントに基づきます。2026年11月10日に確認。

パソコン上で動かせるアプリ

ClaudeGooseLM StudioMsty StudioCherry StudioCursorVS Code + GitHub CopilotVisual StudioWindsurf (Devin Desktop)ZedKiroClineContinueJetBrains AI AssistantClaude CodeCodex CLIGemini CLIOpenCodenodecodeWarpLibreChatRaycast

すべてのアプリと長所・短所 →

できること

パソコンで動くサーバーです。インストールすると、ツール一覧がAIアプリに表示されます。

基本チェックi

誰でも見られる情報をチェックしており、コードは読んでいません。当てはまらない項目は数に入れていません。 · 2026年11月18日にチェック

  • ✓ 合格

    作者とリポジトリが一致

    レジストリ名は、リポジトリを所有するGitHubアカウント base-buzz で確認済みです

  • ✓ 合格

    今もメンテナンスされている

    コードの最終更新:今日

  • ✓ 合格

    ライセンスがある

    MITを使用

  • – 対象外

    エンドポイントが応答する

    これはパソコンで動くため、インターネット上のエンドポイントはありません

  • – 対象外

    OAuthでサインイン

    パソコンで動き、代わりにローカルの設定を使います

  • … 未チェック

    ツールの説明に隠れた指示がない

    パソコンで動くサーバーです。ツール一覧を読み取れるのは、インターネット上のエンドポイントがある場合だけです

公開済みの脆弱性(OSV.dev)

OSV.dev に @paystage/x402-guard@0.4.9 の登録はありません

このバージョンのパッケージ本体のみ確認。すべての依存関係ではありません · 確認日 2026年11月18日

確認していること → · JSON

作者の方へ:再確認の依頼・情報の誤りの報告
作者向け:README にバッジを付ける

作者の方は、このコードを README に貼れます。バッジはこのページにリンクします。

[![Featured on PopNx MCP](https://mcp.popnx.com/badge/base-buzz-x402-guard.svg)](https://mcp.popnx.com/en/servers/base-buzz-x402-guard)

話し合い

質問、コツの共有、使えないことの報告ができます。「役に立った」の多い順です。

まだ投稿はありません。最初の質問や共有をどうぞ。

ここの投稿は利用者によるもので、PopNx チームのものではありません。

ログインして投稿

ユーザーレビュー

まだレビューはありません

ログインしてレビューを書く

ネットショップ・決済のほかのサーバーとの比較i

  • このカテゴリのほかの2903件のうち0%よりスターが多い
  • このカテゴリのほかの2903件のうち99%より最近レジストリに公開
  • 基本チェックの結果が、このカテゴリのほかの2903件のうち99%と同じかそれ以上

レジストリでこのカテゴリにある有効なすべてのサーバーと比較しています。スターは、公開者がリポジトリの所有者である場合だけ数えます。

よくある質問

PayStage x402 Guard — payment safety before the wallet signsは安全ですか?

当てはまる基本チェック3項目のうち3項目に合格しました。コードは読んでいません。キーやトークンを追加する前に、サーバーがどんなアクセスを求めているかを確認し、必要な権限だけを持つキーを使ってください。

どんなキーやコードが必要ですか?

レジストリには必須のキーは載っていません。ただし、最初に使うときにサインインを求めるサーバーもあります。

パソコンで動きますか、それともクラウドですか?

あなたのパソコンで動きます。必要なときにAIアプリが起動し、データは作者のサーバーを通りません(サーバー自体がオンラインサービスを呼び出す場合を除きます)。

今もメンテナンスされていますか?

GitHubリポジトリの最終更新は今日、最新バージョン(0.4.9)がレジストリに届いたのは今日です。

どのアプリで使えますか?

Claude Desktop、Claude Code、Cursor、VS CodeなどのMCP対応アプリで使えます。パソコンにNode.jsも必要です。

代わりに使えるものは?

同じカテゴリには:Stripe MCP, flightclaw, Trade It, Marketplace Ad Pros: Amazon Ads & Seller Central, idealo MCP Server

似た働きのほかの候補

同じカテゴリでほかの作者のもの。コマンドは確認済み。公式を先に、次にスター順。

カードの見方:↓ 週あたりのダウンロードi★ GitHubスターi3つの柱:レビュー · チェック · 利用状況i更新=最新バージョンをレジストリに公開した日i

Stripe MCP

MCP server integrating with Stripe - tools for customers, products, payments, and more.

作者:stripe広く使われている★ 207213 か月前更新

クラウドで動く✓ 提供元 · stripe.com

flightclaw

Search ~300 airlines and book flights with a checkout link. OAuth sign-in by email code.

作者:flightclaw成長中★ 862 か月前更新

クラウドで動く✓ 提供元 · flightclaw.com

Trade It

Connect brokerage accounts to AI assistants: holdings, orders, asset lookup, and approved trading.

作者:trade-it-inc初期★ 6233 日前更新

クラウドで動く✓ 提供元 · tradeit.app

idealo MCP Server

Search products, compare prices and discover deals across 6 European markets with your AI assistant.

作者:idealo初期★ 286 か月前更新

クラウドで動く✓ 提供元 · mcp.idealo.com
似たものと比べる
これ
PayStage x402 Guard — payment safety before the wallet signs
Stripe MCPflightclawTrade ItMarketplace Ad Pros: Amazon Ads & Seller Centralidealo MCP Server
動く場所パソコンにインストールが必要クラウドで動き、インストール不要クラウドで動き、インストール不要クラウドで動き、インストール不要クラウドで動き、インストール不要クラウドで動き、インストール不要
キーが必要いいえいいえいいえいいえいいえいいえ
Claude で + から追加いいえはいいいえいいえいいえいいえ
基本チェック3/34/44/44/44/44/4
ライセンスMITMITMITCC0-1.0MITMIT
料金登録情報に費用の記載なし登録情報に費用の記載なし登録情報に費用の記載なし登録情報に費用の記載なし登録情報に費用の記載なし登録情報に費用の記載なし

作者のREADME

READMEを開く

作者のリポジトリから書かれたとおりにコピーしたものです。PopNx MCPは内容を確認・推奨していません。HTML、画像、スクリプトは取り除いています。リンクはこのサイトの外へ移動します。

@paystage/x402-guard

The ten lines between *"the agent decided to pay"* and *"the money moved."*

x402-fetch runs the payment loop well: request, read the 402, sign, retry. What it does not do is ask whether that payment should happen. This wraps it, evaluates your policy against the actual challenge, and refuses before the wallet signs.

The whole change

-const res = await fetch("https://api.example.com/paid");

+const res = await guarded("https://api.example.com/paid");

Two lines, one call site. The policy below is configuration you write once; the guard only changes how the request is made.

npm install @paystage/x402-guard x402-fetch   # v1, unscoped: takes a signer (see "two packages" below)

Published with provenance. Every version from 0.1.1 onward is built and signed by this

repository's CI (npm view @paystage/x402-guard dist.attestations shows it). The one exception is

0.1.0, which was published by hand on 2026-11-12 before the Trusted Publisher existed and carries

no attestation — pin >=0.1.1 if that matters to your policy.

import { guardFetch } from "@paystage/x402-guard";

import { privateKeyToAccount } from "viem/accounts";

const guarded = guardFetch(fetch, { walletClient: account, policy: { version: 1, max_amount: { value: "0.05", asset: "USDC", decimals: 6 }, allowed_pay_to: ["0x…"], allowed_assets: [{ symbol: "USDC", decimals: 6, address: "0x…", network: "eip155:8453" }], allowed_networks: ["eip155:8453"], max_timeout_seconds: 300, unknown_payee: "deny", }, });

const res = await guarded("https://api.example.com/paid"); res.headers.get("x-paystage-verdict"); // "pay" | "review" | "do_not_pay"

What it decides

SituationResult
Not a 402respond normally, verdict pay, reason no_payment_required
Policy allowsdelegate to x402-fetch, sign and pay, verdict pay
Policy deniesreturn the original 402 with verdict do_not_pay — nothing is signed
Challenge unreadableverdict review — refuse rather than guess
Policy itself invalidthrows at construction, not at payment time

A refusal returns the server's real challenge, not a manufactured error, so the caller can log what was actually asked for.

Why not just maxValue

maxValue in x402-fetch is one number. A spend policy is not one number: it is who may be paid, in which asset, on which network, for how long, and what to do when the payee is unknown. The interesting failures are the ones a single ceiling cannot express — the right amount sent to the wrong address is still a drained wallet.

Honest limits

  • It evaluates before signing, using the 402 challenge. It cannot see what the server does after settlement.
  • The receipt is a verdict header (x-paystage-verdict, x-paystage-reason-codes). It is not yet a signed, independently verifiable receipt — that is what @paystage/mcp paystage-verify and the hosted API produce.
  • No evaluation has been run against a live adversary. See docs/why-preflight.md in the repository.

Related

The seller's side: refuse before verification

guardFetch protects an agent that pays. paystageVerifierHook protects a seller that is about to be paid — it plugs into the hooks @x402/core runs before verification, so a payment that violates your policy is aborted before the facilitator is asked to verify or settle it.

import { x402ResourceServer } from "@x402/core/server";

import { paystageVerifierHook } from "@paystage/x402-guard";

const server = new x402ResourceServer(facilitator) .registerExtension(paystageVerifierHook({ policy }));

It cannot be bypassed by a caller who forgot to use our client, which is the failure mode a client-side guard always has.

It fails closed. If policy evaluation throws, the payment is aborted with paystage_evaluation_failed. A hook that failed open would look like protection and behave like consent — there is a test for exactly that.

On the SDK directly: one hook

Two packages, similar names

x402-fetch (unscoped, 1.x) takes a signer and is what guardFetch wraps. @x402/fetch (scoped, 2.x) takes an `x402Client` and is the line this project itself uses elsewhere. They are not interchangeable: passing a v2 client to walletClient raises a named error rather than failing inside the peer with createPaymentPayload is not a function. On v2, register the hook below instead — the policy, verdicts and reason codes are identical.

guardFetch covers anyone paying through x402-fetch. If you drive @x402/core yourself, core exposes onBeforePaymentCreation — which runs before a payment payload exists and can abort with a reason:

import { x402Client } from "@x402/core/client";

import { paystageClientHook } from "@paystage/x402-guard";

const client = x402Client.fromConfig({ schemes: [/* … */] }); client.onBeforePaymentCreation(paystageClientHook({ policy }));

Same policy, same verdicts, same reason codes as every other surface. A refusal aborts payload creation, so nothing is signed and the reason travels with it.

Any facilitator, unchanged

The verifier hook attaches to the resource server, not to the facilitator — so it composes with whatever facilitator you already run: CDP, PayAI (@payai/facilitator), a self-hosted one, or none. Those packages are configuration (a URL and auth headers); there is nothing in them to wrap, which is why this is a hook rather than a per-facilitator package.

const server = new x402ResourceServer(createFacilitatorConfig(PAYAI_URL))

.registerExtension(paystageVerifierHook({ policy }));

A refused payment aborts in beforeVerify, so the facilitator is never asked to verify or settle it. That ordering is the point, and there is a test asserting the facilitator's methods are never called.

Keep the verdict

A refusal that leaves no trace is a refusal nobody can debug. Two opt-in seams:

guardFetch(fetch, {

policy, onVerdict: (v) => log.info(v), // your logger telemetryUrl: "https://api.paystage.xyz/v1/guard-verdict", // or the hosted collector })

The record is { verdict, reasonCodes, payTo, at } — no wallet address, no signature, no request body. Telemetry is fire-and-forget and never on the payment path: a failed POST cannot fail the call, and a throwing logger cannot change whether a payment is allowed.

Circle's batched client

@circle-fin/x402-batching exposes the same onBeforePaymentCreation hook @x402/core does, so this is a registration and not an adapter — its context ({ paymentRequired, selectedRequirements } with { scheme, network, asset, amount, payTo, maxTimeoutSeconds }) is the shape this package already reads:

import { GatewayClient } from "@circle-fin/x402-batching/client";

import { paystageClientHook } from "@paystage/x402-guard";

const client = new GatewayClient({ /* … */ }); client.onBeforePaymentCreation(paystageClientHook({ policy }));

The hook runs before the payment payload exists, so a refusal aborts the batch before anything is signed. Verified against @circle-fin/x402-batching@4.0.0 type definitions in tests/circle-batching.test.ts — if their context shape changes, that test fails here instead of in someone's signing loop.