๐Ÿ”’ One-time payment โ€” no subscription

MCP Billing Boilerplate

Charge per tool call on your MCP server โ€” an original Next.js + TypeScript starter kit with OAuth 2.1 + PKCE, API key rotation, idempotent Stripe metered billing, webhook dedup and Redis rate limiting.

$79 one-time

What it is

A starter kit for selling metered access to an MCP server. Your clients call your tools, and every call is billed through a Stripe Billing Meter โ€” with the auth, billing and safety wiring already done. It is original code written for this pack, not a resale of another boilerplate.

What is inside

How it works โ€” the interface

  1. Set up the services (about an hour the first time). Create a Supabase project and run the included migration, create a Stripe Billing Meter named mcp_calls, point a Stripe webhook at /api/webhooks/stripe, and add a Redis URL. Copy .env.example to .env.local and fill it in.
  2. Run the tests. npm install then npm test โ€” 18 tests run with no services needed (in-memory stores). npm run typecheck and npm run build both pass.
  3. Swap in your tools. The demo endpoint (POST /api/mcp) ships with two demo tools, ping and echo. Replace the tool handlers with your own โ€” the auth, rate-limit and metering wrapper stays.
  4. Deploy to Vercel (or any Next.js host), set the same environment variables there, and your MCP server bills per call.
Terminal output of the boilerplate test suite: 18 tests pass, 0 fail, including 20 concurrent claims with the same idempotency key billing exactly once
Real output of npm test from the included suite: 18 tests pass, 0 fail โ€” including the idempotency test (20 concurrent claims, one key, billed once).

Requirements

Honest limits

Buy โ€” $79 one-time

Pay with PayPal โ€” $79

One-time payment, no subscription. After paying, come back here and redeem with your PayPal transaction ID.

I already paid

Honest limits โ€” this purchase