Skip to main content
The Bazaar MCP server exposes the CDP Bazaar catalog as a Model Context Protocol (MCP) server. AI agents connect to this endpoint and use two built-in tools — search_resources and proxy_tool_call — to discover and invoke paid x402 endpoints. The @x402/mcp client wraps a standard MCP client with automatic payment handling so agents never interact with wallets or signing directly.
The Bazaar MCP server is designed for consuming existing paid endpoints. To build your own MCP server that accepts x402 payments from callers, see the MCP Server guide.

MCP tools

search_resources

Semantic search over the CDP Bazaar index. Returns matching resource descriptions, payment pricing, input/output schemas, and relevance-ordered results — the same data available through Search resources. Arguments:

proxy_tool_call

Calls a discovered Bazaar resource by tool name and arguments. The @x402/mcp client intercepts any payment-required response from the server, automatically constructs a payment payload using the configured x402 client, attaches it to the MCP request’s _meta field, and retries. The server then verifies and settles the payment before forwarding the request to the resource server and returning the result. From the agent’s perspective this is a single callTool() call — the @x402/mcp client handles 402 detection, payment creation, and retry internally. Arguments:

Client setup

Install the required packages:
Connect an agent to the Bazaar MCP server:

Payment flow

When an agent calls proxy_tool_call, the MCP client handles the payment loop automatically:
  1. Agent calls client.callTool("proxy_tool_call", { toolName, ...args }).
  2. @x402/mcp forwards the call to the Bazaar MCP server.
  3. If the target resource server requires payment, the Bazaar MCP server signals payment-required.
  4. @x402/mcp invokes onPaymentRequested (if configured) and, if approved, constructs a payment payload and attaches it to _meta on a retry call.
  5. The Bazaar MCP server calls /v2/x402/verify then /v2/x402/settle on the CDP Facilitator.
  6. After successful settlement, the MCP server forwards the original request to the resource server and returns the response to the agent.