Build the server with Cloudflare’s Agents SDK: wrap an MCP server in withX402 and register chargeable tools with paidTool. The official example is a Base Sepolia testnet demonstration, not a production deployment recipe. For production, choose a facilitator and network deliberately, and implement the MCP payment-required and settlement fields specified for x402 transport v2.
What the integration does
x402 lets an MCP server require payment for a tool call. In Cloudflare’s documented pattern, the Agents SDK handles the server integration through withX402 and paidTool. An MCP client receives a payment requirement, prepares a payment payload, and retries the call; after verification, execution, and settlement, the server returns payment-response metadata.
As an Amazon Associate I earn from qualifying purchases.
This is distinct from x402’s HTTP resource-request flow. HTTP integrations use payment headers, while the MCP transport communicates payment requirements and settlement through tool results and MCP _meta fields. See Cloudflare’s x402 documentation and the x402 Foundation’s MCP transport v2 specification.
Build the server with the Agents SDK
The Cloudflare example shows a server wrapped with withX402(server, config). It registers paid tools using paidTool(name, description, priceUSD, inputShape, outputShape, handler). The example also keeps a free echo tool alongside a paid square tool, illustrating that not every tool has to require payment.
#1 Best Overall
-
Create an MCP server using the MCP server implementation used by the Agents SDK.
-
Wrap it with
withX402(server, config). Configure the payment network, recipient address, and facilitator URL. -
Register each chargeable tool with
paidTool, providing its name, description, price, input and output shapes, and handler.PC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minuteSpecial offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy. -
Use raw Zod shapes for the tool schemas as in the example. Its API does not accept flexible AI SDK schema adapters.
Rank #2
Forvencer Server Book, 2 Zipper Pocket, Server Books for Waitress- Upgraded Two Zipper Pockets: Forvencer server books feature two secure zipper pockets for better organization of coins, cash, and receipts, ensuring that everything you collect has a safe and secure place
- Smart Storage & Quick Access: Designed with 8 multi-functional compartments, the right side includes a guest receipt pad, while the left has a money pocket, ticket pocket, and credit card slot. Two small clear pockets store bills, receipts, and other visible items. A stitched pen loop ensures you always have your favorite pen ready
- High-quality & Easy to Clean: Crafted from high-quality PU leather with heavy-duty stitching, this server book is built to last. It resists tears, scratches, and its waterproof surface makes cleaning easy with just a damp cloth or a non-chlorine sanitizer
- Perfect Fit for Your Apron: Measuring 5” x 8”, this compact organizer is slightly smaller than other models, making it ideal for bending or sitting while carrying in your server apron. It holds everything a waitress needs—a place for everything
- What's Included: This server organizer comes with multiple open and zippered pockets to store money, receipts, tips, etc. Clear sleeves are perfect for keeping menus or special lists while serving. Available in a variety of colors, allowing you to express yourself even when in uniform
-
Add free tools separately where they suit the service.
The sample configuration uses network: "eip155:84532", a placeholder recipient address, and facilitator: { url: "https://x402.org/facilitator" }. The network identifier is for Base Sepolia. The example labels CLIENT_TEST_PK as test-only, and its $0.01 tool price is illustrative—not a production price recommendation.
Implement the MCP payment and retry flow
For MCP, a payment challenge is a tool result, not merely an HTTP 402 response or header. The transport specification defines the fields and retry behavior:
The Tool Desk
Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →-
The client calls a paid tool without payment.
-
The server returns a tool result with
isError: trueandPaymentRequiredinformation. It must include the same information in bothstructuredContentandcontent[0].text; the latter contains the JSON encoding of that object. -
The client reads
structuredContentwhen available, withcontent[0].textas the fallback, creates the payment payload, and retries with that payload in request_meta["x402/payment"]. -
The server verifies the payment, executes the tool, and settles the transaction.
-
On success, the tool result includes settlement information in
_meta["x402/payment-response"]. If settlement fails after the tool has executed, return an error rather than the tool’s result.Recommended Free Tools
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
These matching response formats matter for interoperability: clients may rely on structured output or need to parse the text fallback. The specification’s server requirement is explicit: “Servers MUST provide the PaymentRequired in both formats.”
Rank #4
- Upgraded Magnetic Closure Pocket and Two Zipper Pockets: Unlike other brands, Forvencer server books are designed with two secure zipper pockets and two expandable magnetic pockets. These allow you to easily store and organize a large number of coins, cash, and receipts.
- Smart Storage & Quick Lookup: 10 multi-functional compartments. On the right side has a check pad, and on the other has a Money Pocket, Tickets Pocket and Credit Card Slot. Two small clear pockets can store bills, receipts and other items to be viewed. A stitched pen loop to store your favorite pen.
- Long-Lasting and Easy to Clean: Serving book features high-quality PU leather and heavy-duty stitching. PU is extremely strong with high tensile strength and good resistance to tearing, abrasion and scratching. Waterproof leather makes it simple to wipe down your server book with warm water or non-chlorine sanitizer solution to remove any dirt, soil, grime, or soda residue to keep it clean.
- Fit Perfectly in your Apron: Our 5" x 9" server book is designed to accommodate regular checks and fit easily in your apron pocket.
- What You Get: Forvencer server book in strict quality control, our worry-free 1-Year warranty, and friendly customer service.
Choose a network, payment scheme, and facilitator
The sample is configured for Base Sepolia and uses the public x402.org facilitator. Treat that as a test setup, not a default mainnet configuration. Cloudflare describes a facilitator as optional but recommended: it can verify payment payloads and submit transactions for settlement, reducing the blockchain work the resource server must handle. For production, the x402 Foundation advises selecting a production facilitator that supports the intended network, operating one, or self-facilitating. Confirm the provider’s availability, supported scheme/network pair, operational behavior, and credential requirements before launch. See the Foundation’s x402 repository and production guidance.
Cloudflare’s overview describes two payment schemes: exact, a fixed token amount, and upto, authorization up to a maximum with the actual charge set at settlement based on resource consumption. The overview lists Base, Ethereum, Polygon, Optimism, Arbitrum, Avalanche, Solana, Aptos, Stellar, and Sui. That list does not guarantee every scheme works with every network, SDK, or facilitator; verify the specific combination you plan to use in the Cloudflare overview and the selected facilitator’s documentation.
For a test configuration, Cloudflare calls out Base Sepolia and test USDC from the Circle Faucet. Keep test credentials and test funds separate from production payment handling.
Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Repair Windows errors before they cause bigger problemsFix Now →Decide how the client handles payment approval
Cloudflare’s example demonstrates withX402Client and an optional human payment-confirmation flow. Decide what approval policy your product requires before enabling client-side signing: a client should not silently authorize a user’s payment unless that behavior is intentional and clearly governed by the product’s consent model. See the Agents SDK example.
Best Value
- [Large Capacity & Apron-Friendly] Measuring an oversized 4.7 x 9 inches, this larger server book provides extra room for taller receipts, guest checks, and menus while still fitting perfectly into standard restaurant aprons. (Note: apron and guest check pads are not included.)
- [Secure Magnetic & Zipper Pockets] Features a powerful magnetic closure pocket to securely hold large amounts of cash flat, alongside a heavy-duty zippered pocket to keep coins from falling out. Perfect for keeping your bills, receipts, change, and credit cards safely locked away during a hectic shift.
- [Classic Black & White Polka Dot Design] Crafted from high-quality, soft PU faux leather, this server book features a timeless black background accented by retro-chic white polka dots. It brings a touch of modern fashion to your workday, brightening your uniform while matching any restaurant dress code.
- [Professional Craftsmanship & Durability] Built to withstand the grueling, fast-paced demands of the food service industry. Engineered with reinforced seams and meticulous stitching that won't fray, this lightweight organizer offers a polished, high-end look that stands up to daily wear and tear.
- [The Ultimate Shift Organizer] The perfect shift companion for busy waitstaff, servers, and bartenders. Whether you are holding cash, writing down orders, or tracking daily food and wine specials, this stylish book keeps you organized, fast, and efficient under pressure.
What to verify before production
-
Confirm that the chosen network, token, payment scheme, SDK, and facilitator support one another.
-
Choose whether to use an external facilitator, operate one, or self-facilitate; establish how credentials and operational failures will be handled.
-
Ensure payment-required information is returned in both required formats and that retries carry the payment payload in the specified MCP metadata field.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy. -
Define what the client presents for approval and how it handles rejection, verification failure, and settlement failure.
-
Use current Cloudflare Workers deployment guidance for Wrangler configuration and production secret storage. The documented example does not establish exact deployment commands or a complete production launch procedure.
Quick Recap
Bestseller No. 1Bestseller No. 2Bestseller No. 3
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




