paybondpaybond
Sign in

MCP agent spend controls

Authorize agent spend through paybond-mcp-server — tenant-bound MCP tools for coding agents, Claude Desktop, and stdio MCP hosts.

MCP hosts (Claude Desktop, Codex, Cursor, custom orchestrators) launch Paybond as a stdio MCP server. The server exposes a tenant-bound tool surface: verify capabilities, authorize spend before side-effecting work, and submit evidence — same tenant boundary as the SDKs.

MCP is a first-class adapter

MCP hosts are a supported integration path alongside in-process adapters. Coding agents often start here before wiring paybond.instrument() in application code.

Try it (sandbox MCP path)

Terminal
Terminal commandSwipe to inspect long lines
paybond login
paybond agent sandbox smoke \
  --operation paid-tool \
  --requested-spend-cents 100 \
  --evidence-preset cost_and_completion \
  --result-body '{"status":"ok","cost_cents":100}' \
  --format table

For MCP-native sandbox tools inside a running host, call paybond_bootstrap_sandbox_guardrail before the paid tool and paybond_submit_sandbox_guardrail_evidence after.

Launch the server

terminal

Terminal commandSwipe to inspect long lines
npx -y -p @paybond/kit paybond-mcp-server

Required: PAYBOND_API_KEY (from paybond login.env.local). Optional policy hot-reload:

Terminal
Terminal commandSwipe to inspect long lines
export PAYBOND_POLICY_FILE="./paybond.policy.yaml"
export PAYBOND_POLICY_RELOAD="watch"

Claude Desktop / Codex config

Add to your MCP host config (stdio):

{
  "mcpServers": {
    "paybond": {
      "command": "npx",
      "args": ["-y", "-p", "@paybond/kit", "paybond-mcp-server"],
      "env": {
        "PAYBOND_ENV_FILE": ".env.local"
      }
    }
  }
}

Full coding-agent setup: /docs/kit/coding-agent-setup.

Production MCP flow

  1. paybond_create_spend_intent or paybond_fund_intentintent_id + capability_token
  2. paybond_authorize_agent_spend before the paid or side-effecting tool
  3. Execute vendor work
  4. paybond_submit_spend_evidence with completion payload

PAYBOND_MCP_EVIDENCE_POLICY defaults to strict — evidence submit tools refuse calls until validation succeeds for the preset and payload.

Scaffold a paid-tool guard

Terminal
Terminal commandSwipe to inspect long lines
npx -p @paybond/kit paybond-init \
  --preset paid-tool-guard \
  --framework provider-agnostic \
  --out paybond-paid-tool-guard.ts

For multi-tool agents in application code, graduate to agent middleware.

Developer reference: /docs/kit/mcp-server.