paidfor.dev
HumanAgent

Install the MCP server

The skill is enough for most agents; install the server when you want tools instead of HTTP, rules that hold in every session without a skills directory, or an agent that can pay.

Skill, one messageMCP serverClient library in codepay_x402, server plus your wallet
Setuptell your agent to read skill.mdone command or one config block (the skill does this for you where it can)npm install, wrap your fetchpaidfor-mcp wallet new, fund a few USDC
Checks before payingyes, over HTTPyes, as a tool with structured resultsyes, inside the callyes
Rules persistwhere the client has a skills directoryevery session the server is attached, via instructions on initializein your codesame as the server
Never pays twiceby rule, the agent's disciplineby ruleenforced: intent ids and receiptsenforced
Caps and price checksthe agent reads themthe agent reads themenforced: per-call cap, listed-price ratio, validatorsenforced
Works in chat clients with no shellrules for that conversation onlyyes, as a connectornono
Outcomes reported backonly if the agent reports after payingsame, unless pay_x402automatic, verified on-chainautomatic, verified on-chain
Session-start alerts for your allowlistyes, from project notesyes, via the recent_changes toolnoyes
What it gives the indexdemand, candidates (soon), agent-reported outcomesthe same, plus tool analyticsverified outcomesverified outcomes

The server gives your agent check_x402_seller, which it calls before paying an x402 seller, list_reliable_sellers and recent_changes. No key, no account; it sends nothing but the URL being checked.

Tell your agent: install paidfor from https://paidfor.dev/install.md

Paste into Claude Code's agent

Install the paidfor MCP server in Claude Code. It needs no key and sends nothing but the URL being checked.
Run `claude mcp add --transport http --scope user paidfor https://mcp.paidfor.dev/mcp`.
Show me the diff before writing anything.
Start a new session (or run /mcp to reconnect) so the tools load.
Then call check_x402_seller with api-xpay.com and confirm the verdict is avoid.

Command

claude mcp add --transport http --scope user paidfor https://mcp.paidfor.dev/mcp

Start a new session (or run /mcp to reconnect) so the tools load. To check it works, ask for check_x402_seller on api-xpay.com: the verdict should be avoid.

Already paying from code?

Paste this into Claude Code or Cursor inside your project. It wraps your existing x402 calls with @paidfor/x402-safe-fetch, which checks the seller and caps the price before paying; the README has every option.

Migration prompt

Install @paidfor/x402-safe-fetch. Find every place this project calls an x402 seller (look for @x402/fetch, wrapFetchWithPayment, X-PAYMENT or PAYMENT-SIGNATURE headers). Wrap each with safeFetch using maxPerCallUsd 0.50, maxOverListedRatio 1.1 and refuseVerdicts ["avoid"], keep the wallet client as it is, add the receipts directory to .gitignore, show me the diff before committing, then run the project's existing tests.

Let your agent pay, safely

With a wallet configured, the stdio server (@paidfor/mcp@0.3.1 or later) adds pay_x402, which pays through @paidfor/x402-safe-fetch: it checks the seller first, refuses avoid sellers and quotes over 1.1x the listed price, caps each call (PAIDFOR_MAX_PER_CALL_USD, default 0.50) and each day (PAIDFOR_DAILY_CAP_USD, default 5), never pays twice for one intent, and reports the verified outcome to the index. Use a dedicated wallet holding a few dollars; the key stays on your machine and is never logged, returned or sent.

1. Make a wallet (writes ~/.paidfor/wallet.key, mode 600, prints the address)

npx -y @paidfor/mcp@0.3.1 wallet new

2. Fund it

Send a few USDC on Base to the printed address. x402 payments on Base are gasless for the buyer, no ETH needed.

3. Set the env in the client config (stdio, not the hosted URL)

{
  "mcpServers": {
    "paidfor": {
      "command": "npx",
      "args": [
        "-y",
        "@paidfor/mcp@0.3.1"
      ],
      "env": {
        "PAIDFOR_WALLET_KEY_FILE": "/Users/you/.paidfor/wallet.key",
        "PAIDFOR_MAX_PER_CALL_USD": "0.50",
        "PAIDFOR_DAILY_CAP_USD": "5"
      }
    }
  }
}

4. Verify

Restart the client and ask the agent to call wallet_status: it shows the address, the USDC balance on Base and the limits, never the key.

The hosted server cannot pay, by design: it never holds a key, so it only has the two read tools.

For agents: /install.md (also at /llms-install.md). Endpoints and the response contract: API and MCP.