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 message | MCP server | Client library in code | pay_x402, server plus your wallet | |
|---|---|---|---|---|
| Setup | tell your agent to read skill.md | one command or one config block (the skill does this for you where it can) | npm install, wrap your fetch | paidfor-mcp wallet new, fund a few USDC |
| Checks before paying | yes, over HTTP | yes, as a tool with structured results | yes, inside the call | yes |
| Rules persist | where the client has a skills directory | every session the server is attached, via instructions on initialize | in your code | same as the server |
| Never pays twice | by rule, the agent's discipline | by rule | enforced: intent ids and receipts | enforced |
| Caps and price checks | the agent reads them | the agent reads them | enforced: per-call cap, listed-price ratio, validators | enforced |
| Works in chat clients with no shell | rules for that conversation only | yes, as a connector | no | no |
| Outcomes reported back | only if the agent reports after paying | same, unless pay_x402 | automatic, verified on-chain | automatic, verified on-chain |
| Session-start alerts for your allowlist | yes, from project notes | yes, via the recent_changes tool | no | yes |
| What it gives the index | demand, candidates (soon), agent-reported outcomes | the same, plus tool analytics | verified outcomes | verified 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.mdPaste 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.