Free preview, paid run: a Cloudflare MCP server over Sume

Cloudflare lets one MCP server mix free and paid tools. Offer a free estimate tool backed by Sume dry_run, then a paidTool that starts the run.

4 min readSume
All posts

If you sell Sume-backed work through a Cloudflare MCP server, expose two tools: a free one that returns an estimate, and a paid one that runs the job. Cloudflare's x402 docs say free and paid tools can be mixed on one server. Sume's dry_run gives the free half, because it returns an admission and cost preview without submitting a job.

The buyer's agent can then decide whether the quoted price is worth paying before any payment is requested.

The two tools

Free estimate and paid run (read 2026-10-04)
ToolPriceBacked by
estimateFreeSume call with dry_run=true; no job is created
runpaidTool price in USDThe real Sume call with idempotency_key and max_spend_usd
Unpaid run call402 with payment requirementsCloudflare x402; client pays and retries with proof
Test networkbase-sepolia with Circle faucet USDCCloudflare docs

Why split it

A single paid tool forces buyers to pay before they know what the job costs. Splitting lets your server quote first. Sume documents dry_run as the preview and max_spend_usd as an optional cap that is enforced only when sent (tools and gates), so pass both in your handlers: the estimate to set the quote, and the cap to bound the run.

Keep the quote and the cap consistent. If the estimate says $0.40, price the paid tool above that and cap the run at or under your own cost limit.

Pitfalls

  • A quote is an estimate; admission can still return queue_full or rate_limited, so plan a retry path (generation admission).
  • Do not reuse one idempotency_key for different jobs.
  • Test the whole flow on base-sepolia before mainnet.
  • Your price must cover your own cost, which the free estimate tool should not give away for free if it is sensitive.

Sources

Related posts

More in Developers

All Developers posts

Written by Sume