Skip to content

vikram14s/mpp-bundler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MPP Bundler — Claude Code Plugin

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.

Installation

claude install-plugin /path/to/mpp-bundler

Or run Claude with the plugin directory:

claude --plugin-dir /path/to/mpp-bundler

Quick Start

  1. Install the plugin
  2. Open your API project in Claude Code
  3. Run /mpp-bundler:init
  4. Follow the prompts to configure providers, pricing, and payment methods

Commands

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

What It Does

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.ts with 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

Bundle Dashboard

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).

Supported Payment Methods

  • Stripe — card payments via Payment Intents
  • Tempo — crypto pay-as-you-go via payment channels
  • Card — generic card payments
  • Lightning — Bitcoin Lightning Network

Links

About

Claude Code plugin that scaffolds MPP (Machine Payments Protocol) billing into any API project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors