spendctl

Spend policy for AI agents that pay (x402, MPP). Login-free sandbox, real sidecar, no real funds.

使うべきか

品質と安全性

A
説明の品質
100%
スキーマの完全性
98%
命名の品質
93%
ポイズニングのリスク
80%
権限の一致
100%
プロトコルへの準拠
100%

検出事項(2)

  • HIGHTool poisoning patterns detected
  • MEDIUMTool description contains URL to non-standard domainsandbox_pay 内

ツール定義とプロトコルへの準拠に関する自動分析に基づいています。

コンテキストコスト

~1,693トークン数(ツール定義)
~1.4 KB一般的なレスポンスサイズ
注意への影響は中程度(128k コンテキストの 1.32%)

これは、サーバーのツールがモデルのコンテキストに読み込まれるたびに消費されるおおよそのトークン数です。数が多いほど、ほかのタスクに使える注意が減ります。

インストール

ワンクリックインストール

これを `claude_desktop_config.json` ファイルに追加してください:

{
  "mcpServers": {
    "spendctl": {
      "url": "https://mcp.spendctl.dev/mcp"
    }
  }
}

リモートエンドポイント

https://mcp.spendctl.dev/mcpstreamable-http

できること

ツール一覧

ツール(6)

🟢 読み取り専用🟡 書き込み🔴 削除⚪ 不明
🟡sandbox_create(preset)

Creates an isolated spendctl sandbox and returns its sandbox_id. Call it first: every other tool needs the sandbox_id, and one sandbox serves a whole conversation (create another only to try a different preset). The sandbox is a real spendctl sidecar with a throwaway wallet, a mock x402 facilitator and two mock paid APIs; no real money moves and nothing outside the sandbox is reachable. Returns the sandbox_id, the agent's policy (budgets, allowed hosts, approval rule) and the paid endpoints with their prices. Limits: 5 sandboxes per minute per client; a sandbox expires after 2 hours without calls (24 hours at most). Example: preset "strict" to see refusals, "approvals" to see a payment held for a human.

入力スキーマ

{
  "type": "object",
  "properties": {
    "preset": {
      "default": "default",
      "description": "Policy preset. default: comfortable caps, both endpoints allowed; strict: $0.015 per request and $0.03 per day, weather only, so the search API and a fourth weather call are refused; approvals: payments at or above $0.015 wait for approve",
      "type": "string",
      "enum": [
        "default",
        "strict",
        "approvals"
      ]
    }
  },
  "$schema": "https://json-schema.org/draft/2020-12/schema"
}
🟡sandbox_pay(sandbox_id, url, idempotencyKey, dryRun, approvalId)

Fetches one of the sandbox's paid endpoints (HTTP 402, x402) through the spendctl sidecar, which applies the sandbox agent's budget, allowlist and approval policy, pays with the throwaway wallet if allowed, and returns the response. Use it for every paid call in the sandbox: with dryRun to see the decision without paying, with approvalId to complete a payment that was held and then approved. The endpoints are https://weather.sandbox.spendctl.dev/weather?city=<name> ($0.01) and https://search.sandbox.spendctl.dev/search?q=<query> ($0.02), as listed by sandbox_create and documented at https://spendctl.dev/docs/sandbox/; any other host is refused. Returns a one-line summary (HTTP status, amount paid, decision, receipt id) followed by the response body, or the refusal with its reason, or an approval id when the payment is waiting for a human. Only sandbox hosts exist and no real funds are involved; the request is always a GET and responses are clipped at 20,000 characters. Example: url https://weather.sandbox.spendctl.dev/weather?city=Kyoto

入力スキーマ

{
  "type": "object",
  "properties": {
    "sandbox_id": {
      "type": "string",
      "pattern": "^[0-9a-f]{32}$",
      "description": "The sandbox_id returned by sandbox_create (32 hex characters)"
    },
    "url": {
      "type": "string",
      "format": "uri",
      "description": "Absolute URL of a sandbox endpoint, e.g. https://weather.sandbox.spendctl.dev/weather?city=Kyoto"
    },
    "idempotencyKey": {
      "description": "Reuse the same key when retrying a call so the sandbox is never charged twice, e.g. \"kyoto-1\"",
      "type": "string"
    },
    "dryRun": {
      "description": "true: only report what spendctl would decide; never pay",
      "type": "boolean"
    },
    "approvalId": {
      "description": "The approval id from an earlier sandbox_pay result, after approve accepted it, to complete that held payment",
      "type": "string"
    }
  },
  "required": [
    "sandbox_id",
    "url"
  ],
  "$schema": "https://json-schema.org/draft/2020-12/schema"
}
🟢check_budget(sandbox_id)

Shows the sandbox agent's spending limits, what has been spent in each window and what is left. Use it before a paid call when the remaining budget matters, or after a refusal to see which limit was hit. Returns the agent name and mode, the per-request limit, the approval threshold, what happens when a budget is exceeded, the allowed hosts and one line per window (hourly, daily: spent, limit, remaining). Read-only; changes nothing.

入力スキーマ

{
  "type": "object",
  "properties": {
    "sandbox_id": {
      "type": "string",
      "pattern": "^[0-9a-f]{32}$",
      "description": "The sandbox_id returned by sandbox_create (32 hex characters)"
    }
  },
  "required": [
    "sandbox_id"
  ],
  "$schema": "https://json-schema.org/draft/2020-12/schema"
}
🟢list_receipts(sandbox_id, limit)

Lists the sandbox agent's most recent payment attempts, newest first: paid (amount and mock transaction hash), refused (reason codes) and waiting for approval. Use it to report what happened so far or to find a receipt id; after a hold, the approval id is in the sandbox_pay result. Returns up to `limit` lines, one per attempt, with time, receipt id, method, URL, amount and status, or "No payments yet." Read-only.

入力スキーマ

{
  "type": "object",
  "properties": {
    "sandbox_id": {
      "type": "string",
      "pattern": "^[0-9a-f]{32}$",
      "description": "The sandbox_id returned by sandbox_create (32 hex characters)"
    },
    "limit": {
      "default": 10,
      "description": "How many attempts to return, newest first (1 to 100, default 10)",
      "type": "integer",
      "minimum": 1,
      "maximum": 100
    }
  },
  "required": [
    "sandbox_id"
  ],
  "$schema": "https://json-schema.org/draft/2020-12/schema"
}
🟢get_policy(sandbox_id)

Returns the sandbox's spendctl.yaml as text: the preset name and the agent's budgets, allowed hosts and approval rules. Use it to explain why a payment was refused or held, or to show what a spendctl policy file looks like. Read-only; the sandbox policy cannot be changed, create a sandbox with another preset instead.

入力スキーマ

{
  "type": "object",
  "properties": {
    "sandbox_id": {
      "type": "string",
      "pattern": "^[0-9a-f]{32}$",
      "description": "The sandbox_id returned by sandbox_create (32 hex characters)"
    }
  },
  "required": [
    "sandbox_id"
  ],
  "$schema": "https://json-schema.org/draft/2020-12/schema"
}
⚪approve(sandbox_id, approvalId, decision, note)

Approves or denies a payment that sandbox_pay reported as waiting for approval, as the human approver would with `spendctl approve`. Use it only with an approval id from this sandbox; in the real product a human decides, in the sandbox the model plays that role. Returns the approval id and its new status (approved or denied). An approved payment completes when sandbox_pay is called again with the same approvalId; a denied one stays refused. Deciding the same approval twice keeps the first decision.

入力スキーマ

{
  "type": "object",
  "properties": {
    "sandbox_id": {
      "type": "string",
      "pattern": "^[0-9a-f]{32}$",
      "description": "The sandbox_id returned by sandbox_create (32 hex characters)"
    },
    "approvalId": {
      "type": "string",
      "description": "The approval id returned by sandbox_pay in its \"waiting for approval\" result (Approval id: ...)"
    },
    "decision": {
      "default": "approve",
      "description": "approve releases the held payment; deny refuses it for good",
      "type": "string",
      "enum": [
        "approve",
        "deny"
      ]
    },
    "note": {
      "description": "Optional reason recorded with the decision, up to 200 characters",
      "type": "string",
      "maxLength": 200
    }
  },
  "required": [
    "sandbox_id",
    "approvalId"
  ],
  "$schema": "https://json-schema.org/draft/2020-12/schema"
}

コミュニティ

このサーバーを評価する

エビデンス

最近の観測

検証済みバージョンは記録されていませんツール 6 件