Discover with the Bazaar MCP server
The Bazaar exposes an MCP server so any MCP-compatible agent can search and call paid x402 endpoints:
Searching is free. Only
proxy_tool_call against a paid resource triggers a payment, and it does
so with the standard x402 MCP transport rather than a Bazaar-specific mechanism, so the client
setup below covers it.
The payment loop over MCP
The full wire-level detail lives in the x402 Foundation’s MCP transport spec; this is the short version:- The client calls a paid tool with no payment attached.
- The server returns a tool result with
isError: trueand aPaymentRequiredpayload — MCP’s equivalent of an HTTP 402 status andPAYMENT-REQUIREDheader. - The client builds a payment payload and retries the same tool call, this time with it attached
at
_meta["x402/payment"]— MCP’s equivalent ofPAYMENT-SIGNATURE. - The server verifies and settles the payment, then returns the tool’s real result with
settlement info attached at
_meta["x402/payment-response"]— MCP’s equivalent ofPAYMENT-RESPONSE.
Pay for tool calls
Wrap your MCP client so this loop runs transparently around tool calls, paired with a CDP-managed wallet — no private keys or manual scheme registration. The same wrapped client works against any x402 MCP server, including the Bazaar’sproxy_tool_call.
- TypeScript
- Python
@x402/mcp’s wrapMCPClientWithPayment wraps any MCP SDK Client; every other method stays a
direct passthrough. CdpX402Client from the CDP SDK provisions its wallet lazily and signs
payments automatically.clients/mcp/simple.ts.