Tomas Achmedovas

How the x402 handshake fits inside a single MCP tool call

by

Short version of how purchase_hotel works end to end:

  1. Agent calls the tool with a rate ID and guest details.

  2. Server returns HTTP 402 with a payment challenge (amount, recipient, expiry).

  3. Agent signs a USDC authorization on Base. No wallet UI, no user involvement.

  4. Agent retries the same tool call with the signature attached.

  5. A facilitator submits the transfer on-chain. It settles in ~2 seconds.

  6. The server continues the booking inline and returns a confirmation.

3 views

Add a comment

Replies

Be the first to comment