Give a desktop agent a local x402 wallet: pay-per-call APIs without an API key

Desktop hosts such as Claude Desktop and Cursor can attach a remote MCP server, but they still cannot sign an HTTP 402 Payment Required challenge. If the API is priced in USDC via x402, a remote /mcp URL will list tools and then stall on payment.

A workable pattern is a local stdio MCP client: the buyer's key and spend caps stay on their machine, the client checks the 402 against published payment pins, and only then signs. I published one for BRAINIAC.software, a catalog of pay-per-call JSON APIs on Base (no account, no API key). This post covers installing that client, inspecting a live 402, and a cheap check an agent can run before it touches a Base token.

Disclosure: I work on BRAINIAC.software. There is no free trial and I am not claiming customers. Discovery and the client download are free; a successful 2xx that returns real data costs the listed USDC price. Prices below are from the live catalog on 23 November 2026; if one has moved, the 402 header is the source of truth.

The gap

Remote Streamable HTTP MCP is fine for listing tools. Payment is a different job. x402 expects the client to read a 402, confirm the payee, asset, network and amount, sign, and retry. Claude Desktop, Cursor, and similar hosts do not do that for a remote server. So the key and the spend policy have to live in a process the buyer actually controls.

The local client is a stdio MCP server with four tools: list_apis, search, and describe are free; call is the paid POST. Before it signs, it checks payTo, the USDC contract, eip155:8453 (Base), and the Coinbase CDP facilitator against pins in the skill. It also enforces a per-call cap and a UTC-day cap that the buyer sets.

What a 402 looks like

You can inspect the price without paying. This unpaid POST returns HTTP 402 and does not move any USDC:

curl -i -X POST https://www.brainiac.software/api/v1/token-security/risk-verdict \ -H 'Content-Type: application/json' \ -H "Idempotency-Key: $(openssl rand -hex 32)" \ -d '{"tokenAddress":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"}' 

The Payment-Required header is base64 JSON, x402 version 2, scheme exact, network eip155:8453, amount "10000" (that is $0.01 USDC, 6 decimals), asset 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913, payTo 0x6428665E83F503904571104311bB78CBb29b975c, facilitator https://api.cdp.coinbase.com/platform/v2/x402. Invalid input returns 400 and no payment challenge.

Docs for this route: token-security/risk-verdict.

Install the local client

The walkthrough, pins, and host config are in the skill. Download the client, check the SHA-256, then install the dependencies listed there. Re-check the checksum whenever you re-download the file.

As of this writing the published SHA-256 is:

95c2a3852c004d2841c3d4bcfd903dcc4efdc7e3b844aab89229b098ae62bb45

Set BRAINIAC_PRIVATE_KEY, BRAINIAC_MAX_USD_PER_CALL, and BRAINIAC_DAILY_MAX_USD only in the MCP host environment on your machine. Do not paste a private key into a chat, a skill file, or this article. Fund the key with Base USDC. Point Cursor or Claude Desktop at the local file as a stdio server, using the JSON in the skill.

Free discovery should work as soon as the server starts: list_apis reads the catalog, search finds a route, describe returns the schema and example. Prefer describe before call so the body matches the live schema.

A cheap worked example

Before an agent buys or approves a Base token, POST /api/v1/token-security/risk-verdict ($0.01) reads the contract and returns facts, signals, and checks it could not complete, kept in separate fields. It does not invent a “risk score”. A missing check is not a pass, and the result is not a recommendation to buy or sell.

A related $0.01 call is token-due-diligence/honeypot, which runs a Honeypot.is buy/sell simulation plus tax, gas, and contract-verification data.

Two other cheap checks that are often useful:

The live catalog is 1,190 operations in 153 groups, with listed prices from $0.001 to $0.20 USDC on Base.

What you are actually charged for

Settlement happens only after a successful HTTP 2xx result that returns real data (status complete or partial). HTTP 4xx and 5xx are not charged. A coverage body with status failed, or an empty payload, is also not charged. Settled 2xx responses include a payment-response header; uncharged responses do not.

That is the rule the catalog publishes today. If a partial result includes data and a nextCursor, you can resume. Treat a partial as incomplete work, not as a clean bill of health.

Limits

This is Base USDC and the x402 exact scheme only. There is no account and no API key, and no dashboard “undo” if you set the caps too high, so start with a small BRAINIAC_MAX_USD_PER_CALL. Outputs are lookups and drafts for a person to review; they are not legal advice or official determinations. OFAC name-screen matches still need a human.

I am posting this to find out whether agent builders want pay-per-call checks without an API key, and which operations they would actually pay for. If you already wrap x402 inside a local MCP server, I would like to hear what you set as the default spend cap.