MangroveTechnologies

Example Paid Tool — Development skill for Claude Code

Development community

Template for interacting with an x402-paid MCP tool.

How to install Example Paid Tool

Installs to ~/.claude/skills/mangrovetechnologies-x402-plugin-template-example-paid-tool/SKILL.md

Terminal
mkdir -p ~/.claude/skills/mangrovetechnologies-x402-plugin-template-example-paid-tool && curl -fsSL https://raw.githubusercontent.com/MangroveTechnologies/x402-plugin-template/HEAD/.claude/skills/example-paid-tool.md -o ~/.claude/skills/mangrovetechnologies-x402-plugin-template-example-paid-tool/SKILL.md

Restart Claude Code, or start a new session, for it to be picked up.

What Example Paid Tool does


name: example-paid-tool description: Template for interacting with an x402-paid MCP tool

Paid Tool Interaction

Flow

  1. Call the tool WITHOUT a payment parameter
  2. Server returns PAYMENT_REQUIRED with price and network details
  3. Present the price: "This costs $X USDC on Base. Proceed?"
  4. If confirmed, construct x402 payment using the user's wallet
  5. Call the tool WITH the payment parameter (base64-encoded signature)
  6. Present results

Error Handling

  • PAYMENT_REQUIRED: Ex

Alternatives in Development

  • Claude Code Examples — Official example projects and patterns from Anthropic 35.6k ★
  • Example Plugin — Reference implementation for plugin developers 14k ★
  • Claude How To — by luongnv89 — Example-driven guide to mastering Claude Code through progressive tutorials with copy-paste tem 8.5k ★

Full documentation available on GitHub

View Source Repository