A Claude Code plugin that scaffolds MPP (Machine Payments Protocol) billing into any API project. It generates production-ready cost tracking, session management, and payment integration code for your framework.
claude install-plugin /path/to/mpp-bundlerOr run Claude with the plugin directory:
claude --plugin-dir /path/to/mpp-bundler- Install the plugin
- Open your API project in Claude Code
- Run
/mpp-bundler:init - Follow the prompts to configure providers, pricing, and payment methods
| Command | Description |
|---|---|
/mpp-bundler:init [billing-model] |
Scaffold MPP billing into your project |
/mpp-bundler:add-provider <name> |
Add an API provider to your cost bundle |
/mpp-bundler:add-payment-method <method> |
Enable a payment method (stripe/tempo/card/lightning) |
/mpp-bundler:setup-tempo |
Guided Tempo wallet onboarding |
/mpp-bundler:add-dashboard |
Scaffold a cost/revenue dashboard |
/mpp-bundler:status |
Show current MPP configuration summary |
The plugin teaches Claude how to:
- Detect your framework (Next.js, Hono, Express, Elysia, CF Workers, Bun, FastAPI) and API providers (OpenAI, Anthropic, Exa, etc.)
- Generate a
mpp-bundle.config.tswith provider pricing, payment methods, and platform premium - Scaffold runtime code (
mpp-bundle.ts) that tracks costs across providers and bundles them - Wire MPP-compliant middleware into your existing endpoints (402 challenges, payment verification)
- Support three billing models: one-time charge, pay-as-you-go sessions, and SSE per-token streaming
After setting up billing, run /mpp-bundler:add-dashboard to scaffold a cost/revenue dashboard that shows:
- Margin visibility — cost (what you pay providers) vs revenue (what consumers pay you) with margin percentage and health indicator
- Provider breakdown — per-provider and per-model cost/revenue analysis
- Daily trends — time-series chart showing cost vs revenue gap over time
- Endpoint analytics — which endpoints cost the most and generate the most revenue
- Recent transactions — live feed of usage log entries
The dashboard includes a database migration (bundle_usage_log table), a fire-and-forget usage logger wired into track(), 6 admin API endpoints (gated by MPP_ADMIN_KEY), and a dashboard UI (React page for Next.js, standalone HTML for other frameworks).
- Stripe — card payments via Payment Intents
- Tempo — crypto pay-as-you-go via payment channels
- Card — generic card payments
- Lightning — Bitcoin Lightning Network