{"slug": "mcp-servers-that-charge-per-call-the-x402-handshake-in-tools-call", "title": "MCP servers that charge per call: the x402 handshake in tools/call", "summary": "A developer running a paid crypto-intel MCP server with 16 tools and per-call USDC pricing on Base described implementing an x402 payment handshake over the HTTP 402 status code, where unpaid tools/call requests return a payment-required challenge and clients retry with an X-PAYMENT proof. After roughly a month, the server drew three external buyers and $0.06 in total revenue, and the developer said a public survey of x402 sellers shows a median price near $0.03 with most listings earning nothing. The developer concluded that the protocol plumbing works and the real difficulty is distribution and pricing, recommending a free discovery tool, registry listings and a machine-readable /market.json catalog.", "body_md": "You can build an MCP server in an afternoon. Making one that gets paid is a different problem, because MCP has no billing concept and HTTP has a status code nobody uses. Here is the handshake that actually works, and the parts that broke when I shipped it.\n\nContext, disclosed: I run a paid crypto-intel MCP server (16 tools, USDC per call on Base, no signup). The numbers below are measured on it, including the unflattering ones.\n\n`tools/call` is a JSON-RPC method over a transport. Nothing in the spec says who is allowed to call, how often, or what it costs. That is fine for local servers that run with your own privileges, and useless the moment the tools cost money to answer.\n\nThree options exist:\n\nx402 uses the one HTTP status code the web never implemented: `402 Payment Required`. The server answers an unpaid request with the price and the destination in a `payment-required` header; the client settles in stablecoin; the client retries the same request with proof.\n\n``` bash\n$ curl -i \"https://your-host/mcp\" -H 'content-type: application/json' \\\n    -d '{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"tools/call\",\n         \"params\":{\"name\":\"some_paid_tool\",\"arguments\":{}}}'\n\nHTTP/2 402\npayment-required: <base64 {scheme, network: eip155:8453,\n                            asset: USDC, amount, payTo, resource, nonce}>\ncontent-type: application/json\n\n{\"price_usd\":\"0.02\",\"pay_to\":\"0x…\",\"network\":\"eip155:8453\"}\n```\n\nA paying client does exactly three things: read the challenge, settle it through a facilitator, retry with `X-PAYMENT`. Fifteen lines in most SDKs. No account, no key exchange, no human.\n\nTwo implementation rules I would tattoo on the codebase:\n\n**Keep the 402 byte-identical to your middleware.** If your framework emits a `payment-required` header and you also write a JSON body, both must describe the same price, asset and address. Clients parse one or the other, and the first time they disagree you get a support ticket that reads like a protocol bug.\n\n**Price belongs in the challenge, not the code.** Changing a price should be a config edit, not a deploy — and you will change prices once you see what agents actually buy.\n\n**1. Not everything should be paid.** I made one tool free (`akari_board` — a live edge board) and it is the only thing that reliably produces repeat traffic. A free, genuinely useful tool is the demo; the paid tools are the product. Making all 16 paid cut discovery to nothing.\n\n**2. Discovery is the whole game.** Listing in two registries and publishing a machine-readable catalog (`/market.json`, prices and schemas, no HTML) moved more traffic than any announcement. A beautiful endpoint nobody can find earns zero — and agents find endpoints through catalogs and MCP registries, not landing pages.\n\n**3. Idempotency beats dashboards.** Your buyers are programs that retry. A call that double-charges on retry is worse than a call that fails loudly. Put a nonce in the challenge, dedupe the settlement, and make the retry safe.\n\nRoughly a month in: **three external buyers, $0.06 total**, against 16 tools. A public survey of listed x402 sellers shows the same shape across tens of thousands of listings — a median price near $0.03, most earning nothing, and a handful taking the majority of volume.\n\nI am telling you that because the interesting part is not the protocol. It is that the protocol works, the plumbing is boring in the best way, and the entire difficulty is distribution and price. Machine payments have arrived; the market for them has not caught up yet.\n\n`/market.json` and `/llms.txt`; list in every honest directory before adding a 17th tool.\nPoking at mine, free: [market.json](https://akari-x402.puzzling-marten.workers.dev/market.json), the [board](https://akari-x402.puzzling-marten.workers.dev/board), the [MCP endpoint](https://akari-x402.puzzling-marten.workers.dev/mcp). The server itself is MIT: [github.com/edvyno/akari-x402-mcp](https://github.com/edvyno/akari-x402-mcp).", "url": "https://wpnews.pro/news/mcp-servers-that-charge-per-call-the-x402-handshake-in-tools-call", "canonical_source": "https://dev.to/edvyno/mcp-servers-that-charge-per-call-the-x402-handshake-in-toolscall-2lkj", "published_at": "2026-10-28 12:32:10+00:00", "updated_at": "2026-10-28 12:41:33.447418+00:00", "lang": "en", "topics": ["ai-agents", "agent-protocols", "ai-tools", "ai-startups"], "entities": ["MCP", "x402", "Base", "USDC", "akari-x402-mcp", "edvyno"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/mcp-servers-that-charge-per-call-the-x402-handshake-in-tools-call", "markdown": "https://wpnews.pro/news/mcp-servers-that-charge-per-call-the-x402-handshake-in-tools-call.md", "text": "https://wpnews.pro/news/mcp-servers-that-charge-per-call-the-x402-handshake-in-tools-call.txt", "jsonld": "https://wpnews.pro/news/mcp-servers-that-charge-per-call-the-x402-handshake-in-tools-call.jsonld"}}