gitwtfhub

wtf is mcp-billing-showcase?

maarcgiil7/mcp-billing-showcase — explained in plain English

Analysis updated 2026-05-18

0TypeScriptAudience · developerComplexity · 4/5LicenseSetup · moderate

TL;DR

A public showcase of two code samples from a paid boilerplate that adds OAuth login, API keys, and Stripe usage billing to MCP servers.

Mindmap

mindmap
  root((MCP Billing))
    What it does
      Meters MCP usage
      Bills via Stripe
      Rate limits requests
    Tech stack
      Next.js
      Prisma
      PostgreSQL
      Redis
    Use cases
      Prevent double billing
      Sliding window limits
      Buy full boilerplate
    Audience
      Developers
      SaaS builders

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Why would anyone build with this?

REASON 1

See a real example of billing usage events safely so retried requests are not charged twice.

REASON 2

See a working example of an atomic Redis-based sliding window rate limiter.

REASON 3

Decide whether to buy the full paid boilerplate for adding billing to an MCP server.

REASON 4

Learn one approach to handling partial failures and streamed responses in usage-based billing.

What's in the stack?

TypeScriptNext.jsPostgreSQLPrismaRedisStripe

How it stacks up

maarcgiil7/mcp-billing-showcase0xradioac7iv/tempfs7vignesh/pgpulse
Stars000
LanguageTypeScriptTypeScriptTypeScript
Setup difficultymoderatemoderatemoderate
Complexity4/53/54/5
Audiencedeveloperdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you spin it up?

Difficulty · moderate Time to first run · 30min

This repo only contains two sample files, the runnable product with setup steps is a separate paid purchase.

This is a public sample of a separately sold paid product, no open license is granted for the full codebase.

Wtf does this do

This repository is a showcase for a paid boilerplate called MCP-Billing, sold separately on Gumroad, that adds login, API keys, and usage-based billing to MCP servers. MCP servers are a way for AI tools to connect to external services, and this project focuses on the billing side of running one as a paid product: figuring out what actually counts as a billable request when calls can retry, partially fail, or stream data back over time. The full paid product includes OAuth 2.1 login with PKCE, API key creation and rotation, Stripe based usage billing, rate limiting backed by Redis, per user quotas, a dashboard built with Next.js, and over 300 automated tests. This public repository only includes two real code files copied from that product as samples: one showing how usage events are recorded safely so a retried request cannot get billed twice, and one showing the rate limiting logic implemented as a single atomic Redis script. The billing approach records every usage event in a Postgres database first, before trying to report it to Stripe, so a failed Stripe call does not cause the record to disappear. Only requests marked as completed are billed by default, while partial or failed requests are still logged for review. Retried requests are protected from double billing through a database level uniqueness rule rather than a check-then-write pattern that could have a timing gap. The stack described for the full product is Next.js, TypeScript, PostgreSQL through Supabase, Prisma, and Upstash Redis, deployable to Vercel, Railway, or Fly.io. This showcase repository itself does not state a license, and the underlying product is sold rather than given away.

Yoink these prompts

Prompt 1
Explain how the idempotency key prevents double billing in metering.ts.
Prompt 2
Walk me through how the sliding window rate limiter script works in Redis.
Prompt 3
Help me design a similar usage-event table for my own billing system.
Prompt 4
What would I need to change to bill partial requests instead of only completed ones?

Frequently asked questions

wtf is mcp-billing-showcase?

A public showcase of two code samples from a paid boilerplate that adds OAuth login, API keys, and Stripe usage billing to MCP servers.

What language is mcp-billing-showcase written in?

Mainly TypeScript. The stack also includes TypeScript, Next.js, PostgreSQL.

What license does mcp-billing-showcase use?

This is a public sample of a separately sold paid product, no open license is granted for the full codebase.

How hard is mcp-billing-showcase to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is mcp-billing-showcase for?

Mainly developer.

View the repo → Decode another repo

This repo across BitVibe Labs

Don't trust strangers blindly. Verify against the repo.