payfetch is the buyer seat in the Forum Labs network, positioned as a paid fetch client with spend controls. Users bring their own wallet, private keys always stay local, and no MCP tool can raise limits. It is released as a local stdio MCP server, accompanied by a small library and CLI.
Purpose payfetch lets AI agents fetch URLs and, when a server returns HTTP 402 (the x402 payment protocol), automatically pay within a user-controlled spending policy. Unlike the reference x402 client, which pays 402 requests unconditionally, payfetch's core is its policy and security surface.
Main capabilities · Spending caps: per-call, daily, per-host daily, and optional lifetime total caps. Caps are hard; budget is reserved before payment, signed authorizations hold budget until they explicitly expire, budget may be overcounted but never undercounted; at most one payment attempt per request, so retry loops cannot drain the wallet. · Allow and deny lists: default open; can be set to allowlist to pay only listed hosts; patterns in deny are always rejected and take precedence over allow. · Approval threshold: a price strictly above the threshold (default 0.10 USD) triggers approval; approval authorizes only a single payment, there is no "always allow". · Trust and security checks: optional, calls the Forum Labs API, with a default guard budget of 0 and uses only free quota; paid guards must be explicitly enabled with a daily budget set. · Receipt ledger: every attempt (including free fetches, dry runs, rejections, and unknown settlements) appends an immutable JSON record noting URL, method, host, result, rejection code, pipeline steps passed through, selected quote, guard results, approval info, payment info, budget at decision time, and HTTP summary; key material, signatures, full payment payloads, response bodies, and header values are never stored.
Usage Run on demand via npx; the package exposes two binaries: payfetch (the operations CLI) and payfetch-mcp (the stdio MCP server). To start the server, use npx -p @forum-labs/payfetch payfetch-mcp. When configuring the wallet, exactly one signing source must be set, supporting a raw private key, a key file with permissions 600, or a Coinbase CDP server wallet. It can then be connected to an MCP client; the example sets PAYFETCH_TEST_MODE=1 to dry-run on Base Sepolia. In use, first use payment_quote to get terms, the selected quote, trust check results, remaining budget, and the policy decision (no signing, no reservation), then use paid_fetch's dryRun for a dry run, and finally make the actual payment. maxAmountUsd can only tighten the per-call cap, not loosen it.
Applicable scenarios and limitations Suitable for scenarios where you want AI agents to automatically pay for x402 APIs within controlled bounds and require a non-custodial wallet and detailed auditing. Limitations include: only x402, Base USDC, and the exact scheme are supported; Solana-settled x402, the upto scheme, and MPP are parsed and then rejected with the reason recorded; Node 22 or higher is required, and Windows is not supported; USD is treated as USDC at 1.00, and depegging will make caps inaccurate by the depeg factor; the policy file is located at {dataDir}/config.json, an invalid file fails closed, all paid tools return policy_config_invalid, only the user themself can modify the policy, and MCP tools will not change it; during approval, elicit is the default, but as of Claude Code v2.1.198 and the current Claude Desktop, neither supports elicit prompts; in queue mode, approval requires the PAYFETCH_APPROVER=1 environment variable, and agents must not approve their own payments; when the trust guard is enabled, each paid fetch sends the stripped target endpoint and a random installation id to the Forum Labs trust API, and this can be fully disabled with guards.trust.enabled: false, after which there are no external calls; optional result reporting is off by default and only reports event by event via payfetch report <receiptId>. Website https://forum-labs.com/payfetch , source code https://github.com/forum-labs/payfetch , Status and scope: version 1.0.0, policy schema p3f.policy.v1, client schema p3f-1.0.0.