Template for building Claude Code + OpenClaw plugins that consume x402-enabled MCP servers. The client-side companion to x402-app-template.
- Clone this template
- Run
./init.sh my-plugin-name https://my-server.com/mcp - Replace example skills in
.claude/skills/with your tool interactions - Replace example tools in
openclaw-plugin/with your MCP tool definitions - Update
shared/config.tswith any custom configuration
.claude/ Claude Code plugin
settings.json MCP server connection
skills/ One markdown file per tool interaction
commands/ Slash commands
hooks/ Lifecycle hooks (session start, etc.)
openclaw-plugin/ OpenClaw plugin
src/index.ts register() with hooks and tool proxies
openclaw.plugin.json Tool definitions
shared/ Shared between both platforms
config.ts Server URL and auth config
types.ts Common TypeScript types
Paid tools use the x402 micropayment protocol:
- Call the tool without a
paymentparameter - Server returns
PAYMENT_REQUIREDwith price and network details - Present the cost to the user
- If confirmed, sign the payment with the user's wallet
- Call the tool with the
paymentparameter (base64 signature) - Server verifies payment, settles on-chain, returns data
- x402-app-template -- Server-side template
- x402 Protocol -- Payment protocol specification