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:
| Argument | Type | Required | Description |
|---|---|---|---|
query | string | No | Free-text search query. |
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:
| Argument | Type | Required | Description |
|---|---|---|---|
toolName | string | Yes | The name of the tool to call, as returned by search_resources. |
...args | any | No | Additional arguments forwarded to the target resource server. |
Client setup
Install the required packages:Payment flow
When an agent callsproxy_tool_call, the MCP client handles the payment loop automatically:
- Agent calls
client.callTool("proxy_tool_call", { toolName, ...args }). @x402/mcpforwards the call to the Bazaar MCP server.- If the target resource server requires payment, the Bazaar MCP server signals payment-required.
@x402/mcpinvokesonPaymentRequested(if configured) and, if approved, constructs a payment payload and attaches it to_metaon a retry call.- The Bazaar MCP server calls
/v2/x402/verifythen/v2/x402/settleon the CDP Facilitator. - After successful settlement, the MCP server forwards the original request to the resource server and returns the response to the agent.
Related
- Search resources — REST alternative to
search_resources - Browse the catalog — paginated catalog of all Bazaar resources
- MCP Server guide — build your own x402-enabled MCP server
- Bazaar overview
@x402/mcppackage