プロトタイプ · プレビュー版:公式レジストリのすべてのサーバーを掲載し、30分ごとに同期しています。レビューとアカウント機能は今後のステップで始まります。
PopNx MCPAIを使う人のためのMCPサーバー · やさしい言葉で解説

Spend Guard

作者:vulinh1704バージョン 0.2.0i★ –iパソコンで動く
レジストリ名io.github.vulinh1704/spend-guard

インストール

概要

作者による説明(英語の原文)

Budgets, payee allowlists, price-spike checks and human approval for agents paying x402 paywalls

PopNx MCPの3つの柱

この3つを1つのスコアにまとめることはしません。意見、測定、人気はそれぞれ別のものだからです。

できること

このサーバーのやさしい解説はまだ書いていません。以下はレジストリから読み取った事実です。

  • 接続方法: パソコンで動く
  • トランスポート: stdio
  • カテゴリ: その他
  • 入力が必要なもの:ARC_PRIVATE_KEY, NEAR_PRIVATE_KEY

インストール

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

インストールの前に

  • 基本チェック:1項目中1項目に合格
  • あなたのパソコンで、あなたのユーザーと同じ権限(ファイル、ネットワーク、アプリ)で動きます。
  • 自分で入力するもの: SPEND_GUARD_POLICY, SPEND_GUARD_RAILS, SPEND_GUARD_LEDGER, SPEND_GUARD_DASHBOARD_PORT, SPEND_GUARD_APPROVAL_TIMEOUT, SPEND_GUARD_MOCK_NETWORK, ARC_PRIVATE_KEY, NEAR_ACCOUNT_ID, NEAR_PRIVATE_KEY

「秘密」と表示された値は、あなたのアカウントの鍵です。絶対に人に教えたり、チャットに貼り付けたりしないでください。

必要なもの

  • npmNode.jsのインストール(npxコマンドに必要)

どのアプリを使っていますか?

上でアプリを選んでください。選んだアプリを覚えておくので、次からはボタンに「…にインストール」と表示されます。

Claude Desktop → Settings → Developer → Edit Config を開き、claude_desktop_config.json にこれを貼り付けます

{
  "mcpServers": {
    "spend-guard": {
      "command": "npx",
      "args": [
        "-y",
        "@vulinh1704/spend-guard",
        "mcp"
      ],
      "env": {
        "SPEND_GUARD_POLICY": "your-value",
        "SPEND_GUARD_RAILS": "your-value",
        "SPEND_GUARD_LEDGER": "your-value",
        "SPEND_GUARD_DASHBOARD_PORT": "your-value",
        "SPEND_GUARD_APPROVAL_TIMEOUT": "your-value",
        "SPEND_GUARD_MOCK_NETWORK": "your-value",
        "ARC_PRIVATE_KEY": "your-value",
        "NEAR_ACCOUNT_ID": "your-value",
        "NEAR_PRIVATE_KEY": "your-value"
      }
    }
  }
}

ターミナルでこれを実行します

claude mcp add spend-guard --env SPEND_GUARD_POLICY=your-value --env SPEND_GUARD_RAILS=your-value --env SPEND_GUARD_LEDGER=your-value --env SPEND_GUARD_DASHBOARD_PORT=your-value --env SPEND_GUARD_APPROVAL_TIMEOUT=your-value --env SPEND_GUARD_MOCK_NETWORK=your-value --env ARC_PRIVATE_KEY=your-value --env NEAR_ACCOUNT_ID=your-value --env NEAR_PRIVATE_KEY=your-value -- npx -y @vulinh1704/spend-guard mcp

動かす前に、空欄の値を入力してください。

Cursorで開く

または、設定を自分でコピーする

プロジェクトの .cursor/mcp.json、または ~/.cursor/mcp.json に貼り付けます

{
  "mcpServers": {
    "spend-guard": {
      "command": "npx",
      "args": [
        "-y",
        "@vulinh1704/spend-guard",
        "mcp"
      ],
      "env": {
        "SPEND_GUARD_POLICY": "your-value",
        "SPEND_GUARD_RAILS": "your-value",
        "SPEND_GUARD_LEDGER": "your-value",
        "SPEND_GUARD_DASHBOARD_PORT": "your-value",
        "SPEND_GUARD_APPROVAL_TIMEOUT": "your-value",
        "SPEND_GUARD_MOCK_NETWORK": "your-value",
        "ARC_PRIVATE_KEY": "your-value",
        "NEAR_ACCOUNT_ID": "your-value",
        "NEAR_PRIVATE_KEY": "your-value"
      }
    }
  }
}

ブラウザがアプリを開いてよいか確認し、そのあとアプリが設定を表示して確認を求めます。キーの値は空欄のままなので、自分で入力してください。

VS Codeで開く

または、設定を自分でコピーする

プロジェクトの .vscode/mcp.json に貼り付けます

{
  "servers": {
    "spend-guard": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@vulinh1704/spend-guard",
        "mcp"
      ],
      "env": {
        "SPEND_GUARD_POLICY": "your-value",
        "SPEND_GUARD_RAILS": "your-value",
        "SPEND_GUARD_LEDGER": "your-value",
        "SPEND_GUARD_DASHBOARD_PORT": "your-value",
        "SPEND_GUARD_APPROVAL_TIMEOUT": "your-value",
        "SPEND_GUARD_MOCK_NETWORK": "your-value",
        "ARC_PRIVATE_KEY": "your-value",
        "NEAR_ACCOUNT_ID": "your-value",
        "NEAR_PRIVATE_KEY": "your-value"
      }
    }
  }
}

ブラウザがアプリを開いてよいか確認し、そのあとアプリが設定を表示して確認を求めます。キーの値は空欄のままなので、自分で入力してください。

これはパソコンで動くサーバーですが、ChatGPTがつなげるのはインターネット上のサーバーだけです。ほかのアプリを選んでください。

選んだアプリは、この端末のCookieに保存されます。アカウントは不要です。

自分で入力する値

  • SPEND_GUARD_POLICY env
    Policy JSON file: networks, budgets, approval amount, spike ratio, known services and their payees. Without one, every payment waits for your approval.
  • SPEND_GUARD_RAILS env
    How to pay: mock (pays nothing), near, arc, gateway, or a comma list. arc and gateway need ARC_PRIVATE_KEY, near needs NEAR_ACCOUNT_ID and NEAR_PRIVATE_KEY.
  • SPEND_GUARD_LEDGER env
    Decisions file, read back on start so a restart keeps today's spend; servers on one file share one budget. Default ~/.spend-guard/ledger.jsonl; off keeps it in memory.
  • SPEND_GUARD_DASHBOARD_PORT env
    Port of the approval dashboard on 127.0.0.1. 0 picks a free one; off means no dashboard, and payments that need approval are declined.
  • SPEND_GUARD_APPROVAL_TIMEOUT env
    Seconds a payment waits for your answer before it is declined. Raise it together with your client's tool timeout.
  • SPEND_GUARD_MOCK_NETWORK env
    Network the mock rail pretends to pay on.
  • ARC_PRIVATE_KEY 秘密 env
    Agent key for the arc and gateway rails. Testnet keys only.
  • NEAR_ACCOUNT_ID env
    Agent account for the near rail (testnet).
  • NEAR_PRIVATE_KEY 秘密 env
    Agent key for the near rail. Testnet keys only.

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

できること

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

基本チェックi

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

  • ✓ 合格

    作者とリポジトリが一致

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

  • … 未チェック

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

    このリポジトリはまだGitHubから読み取っていません

  • … 未チェック

    ライセンスがある

    このリポジトリはまだGitHubから読み取っていません

  • – 対象外

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

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

  • – 対象外

    OAuthでサインイン

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

  • … 未チェック

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

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

その他のほかのサーバーとの比較i

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

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

よくある質問

Spend Guardは安全ですか?

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

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

入力が必要なもの:ARC_PRIVATE_KEY, NEAR_PRIVATE_KEY

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

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

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

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

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

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

代わりに使えるものは?

同じカテゴリには:Spec Driven Development, Remote Desktop Commander, Thth

代わりの候補

同じカテゴリで、ほかの作者が作ったサーバー。スターの多い順。

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

Spec Driven Development

MCP Server that facilitates spec-driven development workflows, not just Vibe Coding.

作者:formulahendry初期↓ 66/週★ 44014 か月前更新

パソコンで動く

Remote Desktop Commander

Remote Desktop Commander: use files, terminal and processes on your own computers from any AI app.

作者:desktop-commander成長中★ 2113 日前更新

クラウドで動く✓ desktopcommander.app

Thth

Call before you post: ships a draft to Threads/Bluesky/Mastodon only after a person approved it.

作者:aokings初期↓ 1977/週今日更新

パソコンで動く

作者のREADME

READMEを開く

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

Spend Guard

A spending guard for AI agents that pay for APIs in USDC.

A real run on Arc testnet with x402 exact (node demo/agent.js --arc-x402 --dashboard), trimmed and sped up: the guard refuses a 40x price spike and a swapped payout address before anything is signed, and a $0.30 payment goes out only after a person clicks Approve on the dashboard.

Agents are starting to pay per call over HTTP 402: the server answers 402 Payment Required with a price, the agent pays and gets the data (the x402 protocol). An agent that can pay can also be talked into paying: a prompt injection, a retry loop, or a paywall that raises its price or swaps its payout address. Spend Guard sits between the agent and its money. Every payment is checked against budgets, a payee allowlist and the endpoint's usual price, and anything unusual waits for a person to approve it. All of this happens before any USDC leaves and before any authorization is signed. It pays on Circle's Arc testnet by plain USDC transfer, by x402 exact (EIP-3009) and by Circle Gateway nanopayments, from a local key, and in NEAR on NEAR testnet. A rail for Circle developer-controlled wallets is tested offline only. Claude and other MCP clients can use it as an MCP server.

Status: testnet only, not audited. On npm as @vulinh1704/spend-guard and in the official MCP Registry as io.github.vulinh1704/spend-guard. MIT licensed.

Quickstart (1 minute, no keys)

You need git and Node 22.22.2 or later. No keys and no wallet: the payments are mocked, and nothing leaves your machine after the install.

git clone https://github.com/vulinh1704/spend-guard

cd spend-guard npm ci node demo/agent.js # a scripted agent against a demo paywall that turns bad node demo/agent.js --dashboard # the same run, paced, with the live page on http://localhost:4400

With --dashboard, open http://localhost:4400 while it runs. The $0.30 /report waits there for Approve or Deny, and is declined after 120 seconds without an answer. The page stays up until you press Ctrl+C. If 4400 is taken, the demo takes a free port and prints it; DASHBOARD_PORT picks another.

What it stops

The demo paywall behaves for a few calls and then turns bad. /quotes raises its price 40x, and /maps asks to be paid at a look-alike address. /report stays honest but costs more than the agent may pay without asking. This is the offline demo, node demo/agent.js:

✓ paid $0.01   /weather  {"city":"Hanoi","tempC":29,"sky":"clear"}

✓ paid $0.02 /news {"headlines":["Stablecoin volume hits a record","New L2 opens its testnet"]} ✓ paid $0.01 /quotes {"NEAR":2.5,"BCH":450} ✓ paid $0.01 /quotes {"NEAR":2.5,"BCH":450} ✓ paid $0.01 /quotes {"NEAR":2.5,"BCH":450} ✗ denied /quotes $0.40 is 40x the usual $0.01 for 127.0.0.1:33955/quotes; $0.40 is above the $0.25 that needs your approval ✓ paid $0.015 /maps {"route":"Hoan Kiem → My Dinh","km":11.2} ✓ paid $0.015 /maps {"route":"Hoan Kiem → My Dinh","km":11.2} ✗ denied /maps 127.0.0.1:33955 asked to be paid at rnaps.paywall.testnet, which is not one of its known addresses ✓ paid $0.01 /weather {"city":"Hanoi","tempC":29,"sky":"clear"} ? asks you: $0.30 is above the $0.25 that needs your approval → no ✗ declined /report $0.30 is above the $0.25 that needs your approval

spent today $0.10 of $1.00; 3 payments stopped

The same run on Arc testnet with x402 exact (node demo/agent.js --arc-x402, 31 Oct 2026) paid in real test USDC. The agent only signed. The paywall settled each signature on chain and paid the gas, so the agent's balance fell by exactly the $0.10 it spent:

agent 0xBbc0B612C19beA521D2eA1Ad7dfEe91D23753244 · Arc testnet (USDC) · x402 v2 exact, EIP-3009

✓ paid $0.01 /weather … https://testnet.arcscan.app/tx/0x92414aea1d896cd7ebd032c85ca32a84764d743931e61f4474a92f434a61fae3 ✗ denied /maps … asked to be paid at 0xF870cC7D7c258Cc856197fB6C3C819AD6Bb324b5, which is not one of its known addresses agent wallet $17.999436 → $17.899436 USDC (-$0.10)

RuleWhat it catches
A per-payment limit, a daily budget and a per-call cap for each serviceoverpriced calls; a loop's total stops at the daily budget
Payee allowlist per servicea paywall that starts asking to be paid somewhere else
Price spike against the endpoint's usual pricea sudden 5x, 40x, 1000x
Human approval above a threshold, or for an unknown servicelarge payments, a payment to a host the policy doesn't list, such as one an injected page pointed the agent to
One decision at a time (with a ledger file, across processes too)parallel tool calls racing the daily budget

Every decision, paid or not, is recorded with its reasons. The rules and their exact messages are in docs/policy.md.

How it works

agent ── payingFetch(url) ──► paywall: 402 + offer (PAYMENT-REQUIRED)

│ ▼ Guard ── policy: budgets, payees, usual price ── ledger │ └─ flagged? ask the person on the dashboard ▼ Rail ── USDC transfer · EIP-3009 signature · Gateway authorization · Circle wallet │ payingFetch ──► paywall: PAYMENT-SIGNATURE ──► 200 + data + PAYMENT-RESPONSE (settlement)

The guard decides before a rail moves money or signs anything. A rail that signs uses the payee and amount the guard approved, never the paywall's own numbers, and it pins the chain and token it signs for. More in docs/architecture.md.

Rails

RailHow the agent paysStatus
Arc USDC transfer (--arc)ERC-20 transfer from the agent's key. The paywall checks the receipt's USDC Transfer event.Works on Arc testnet, for example this payment.
x402 exact on Arc (--arc-x402)Signs an EIP-3009 transferWithAuthorization for USDC. The paywall verifies and settles it, and pays the gas.Works on Arc testnet. The demo paywall is its own settler.
Circle Gateway (--gateway)Signs a Gateway authorization against USDC deposited once in Circle's Gateway Wallet. Circle settles the payments in batches.Works on Arc testnet, with no Circle account or API key. One earlier run's payments landed in one batch transaction.
Circle WalletsA Circle developer-controlled wallet transfers or signs, so no private key sits in the agent's process.Tested offline against Circle's SDK. Not run against Circle yet, because it needs your Circle account (setup).
NEAR testnet (--near)Native NEAR transfer.Works on NEAR testnet.
MockNothing moves.Tests and the offline demo.
Bitcoin Cash, ConcordiumPlanned.

Details for each rail are in docs/rails.md.

x402 v2 and the exact scheme (EIP-3009)

payingFetch speaks x402 v2. It reads the offer from the PAYMENT-REQUIRED header, and still reads v1 JSON bodies. For an exact offer in USDC on Arc that names the token's EIP-712 domain, the agent signs a transferWithAuthorization and sends no transaction. The signature is the payment, so the guard decides first and counts it as spent when it is signed. Each signature is for the approved payee and amount only, has a fresh random nonce, and is valid for at most 120 seconds. Offers for another chain (the same key works on Arc mainnet), another token, or Permit2 and escrow flows are refused before anything is signed, with the reason.

node scripts/arc-testnet-wallet.js       # agent key and demo payees in .env; fund the agent at https://faucet.circle.com (Arc Testnet)

node scripts/arc-facilitator.js # the demo paywall's settling key, topped up with a little test USDC for gas node demo/agent.js --arc-x402 --dashboard

Circle Gateway nanopayments

The agent deposits USDC into Circle's Gateway Wallet once. After that each call is an off-chain authorization: no gas and no transaction per call, so a $0.01 call costs $0.01. Circle settles the payments on Arc in batches a few minutes later. A Gateway authorization stays valid for at least 7 days, so the guard decides before it is signed. The rail also signs nothing the deposit can't cover, counting what is signed but not settled yet.

node scripts/gateway-deposit.js 1        # approve and deposit 1 test USDC (two Arc transactions)

node demo/agent.js --gateway --dashboard # nanopayments to an x402 v2 seller that settles each one with Circle node scripts/gateway-status.js # Gateway balance, and each payment's batch transaction on Arc

Circle Wallets

With CircleWalletRail, Circle holds the key (MPC) and signs when asked. The agent's process has a testnet API key and an entity secret, but no private key, and Spend Guard still checks every payment before Circle is asked to send or sign. Circle's own controls (custody, screening, DENIED) still apply after the guard says yes. docs/circle-wallets.md explains the setup, which needs your own Circle developer account, and how the two layers fit together.

Use it from Claude or any MCP client

spend-guard mcp serves the guard over stdio and gives an MCP client three tools:

  • pay_and_fetch fetches a URL and pays its x402 paywall through the guard.
  • spending_status and spending_policy are read-only views of the budget, recent payments and the rules.

There is no tool to approve a payment or to change the policy. Payments the policy flags wait for you on the dashboard. They are declined after 55 seconds without an answer, and a call the client cancels never pays.

The config goes in .mcp.json (Claude Code, project scope) or claude_desktop_config.json (Claude Desktop). Cursor and other clients take the same mcpServers shape.

From npm. The default mock rail pays nothing, so this is a safe first try:

{

"mcpServers": { "spend-guard": { "command": "npx", "args": ["-y", "@vulinh1704/spend-guard", "mcp"], "env": { "SPEND_GUARD_POLICY": "/abs/path/policy.json" } } } }

The mock rail pretends to pay on near-testnet, so this policy must allow that network: list "networks": ["near-testnet"], or leave networks out and the server allows the networks of the rails it runs. A policy that lists only Arc networks leaves the mock rail nothing it may pay. To have something to pay, run the demo paywall from a clone, node demo/paid-api.js, and ask the agent to fetch http://localhost:4402/weather. demo/mcp-policy.json is a mock policy that knows its payees.

From a clone, and for the rails that pay. Node reads the keys from .env with --env-file, which npx can't pass on, so they stay out of the client's config:

{

"mcpServers": { "spend-guard": { "command": "node", "args": ["--env-file=/abs/path/spend-guard/.env", "/abs/path/spend-guard/bin/spend-guard.js", "mcp"], "env": { "SPEND_GUARD_POLICY": "/abs/path/policy.json", "SPEND_GUARD_RAILS": "arc,gateway" } } } }

Or in Claude Code: claude mcp add spend-guard -- npx -y @vulinh1704/spend-guard mcp, or from a clone claude mcp add spend-guard --env SPEND_GUARD_POLICY=/abs/path/policy.json --env SPEND_GUARD_RAILS=arc -- node --env-file=/abs/path/spend-guard/.env /abs/path/spend-guard/bin/spend-guard.js mcp

A policy.json for the arc,gateway config. Its networks are the ones those two rails pay on; with ot

冒頭だけを表示しています。続きはリポジトリで読めます

PopNxに聞く