{
  "id": "x402.mcp.paid-tool",
  "protocol": "x402",
  "layer": "payment",
  "role": "merchant",
  "status": "optional",
  "title": "Charge per MCP tool call with paidTool",
  "description": "The Cloudflare Agents SDK wraps an MCP server with withX402 and adds paidTool for priced tools.",
  "goal": "Sell individual agent actions (for example a price check) next to free tools.",
  "note": "Price is in USD; network base or base-sepolia.",
  "how_to_implement": {
    "steps": [
      "Wrap McpServer with withX402(config).",
      "Register priced tools with paidTool(name, description, price, schema, annotations, handler)."
    ],
    "snippet": {
      "lang": "ts",
      "code": "server = withX402(new McpServer({ name: \"PaidMCP\", version: \"1.0.0\" }), {\n  network: \"base\",\n  recipient: \"0xYourWalletAddress\",\n  facilitator: { url: \"https://x402.org/facilitator\" },\n});\nthis.server.paidTool(\"square\", \"Squares a number\", 0.01, { number: z.number() }, {},\n  async ({ number }) => ({ content: [{ type: \"text\", text: String(number ** 2) }] }));",
      "source_url": "https://developers.cloudflare.com/agents/tools/payments/x402/charge-for-mcp-tools/",
      "source_label": "Cloudflare: charge for MCP tools with x402"
    }
  },
  "resources": [
    {
      "label": "Cloudflare: charge for MCP tools with x402",
      "url": "https://developers.cloudflare.com/agents/tools/payments/x402/charge-for-mcp-tools/",
      "type": "docs",
      "publisher": "Cloudflare"
    }
  ],
  "audit": {
    "method": "code_review",
    "automatable": false,
    "human": "Call the paid tool from an x402 client; it requires payment, the free tool does not."
  },
  "how_to_verify": "Call the paid tool from an x402 client; it requires payment, the free tool does not.",
  "artifacts": [
    "withX402",
    "paidTool"
  ],
  "depends_on": [
    "mcp.server"
  ],
  "status_note": "Price is in USD; network base or base-sepolia.",
  "verified": true,
  "slug": "x402-mcp-paid-tool",
  "category": "payment",
  "url": "https://vreeman.ai/commerce/checklist#x402.mcp.paid-tool",
  "updated": "2026-10-12",
  "sources": [
    {
      "label": "Cloudflare: charge for MCP tools with x402",
      "url": "https://developers.cloudflare.com/agents/tools/payments/x402/charge-for-mcp-tools/",
      "type": "docs",
      "publisher": "Cloudflare"
    }
  ],
  "related_slugs": [
    "mcp-server"
  ]
}