How the x402 handshake fits inside a single MCP tool call
by•
Short version of how purchase_hotel works end to end:
Agent calls the tool with a rate ID and guest details.
Server returns HTTP 402 with a payment challenge (amount, recipient, expiry).
Agent signs a USDC authorization on Base. No wallet UI, no user involvement.
Agent retries the same tool call with the signature attached.
A facilitator submits the transfer on-chain. It settles in ~2 seconds.
The server continues the booking inline and returns a confirmation.
3 views


Replies