OAuth 2.1, API keys, Stripe metering, rate limiting — wired together and working. The part nobody ships.
One-time payment. No subscription. No revenue share. You own the code.
Building the MCP tool takes a weekend. Wiring identity and payments around it doesn't. This is a common story from builders shipping MCP servers in 2026:
— Real developer, r/mcp
Your server accepts standard OAuth clients without you touching a single RFC.
Generate, rotate and revoke keys from the dashboard in one click.
Charge per call, per token, whatever you want. Retries and interrupted calls already handled — no edge cases to think about.
Protect your server from abuse without writing a sliding window algorithm.
Each MCP server client gets its own context, keys and quota.
Don't couple billing to your logic. It's infrastructure, not product code. Change your MCP server without touching billing.
Usage-based billing gets interesting once you have retries, partial failures, and streamed responses. These three decisions are already made for you.
Every usage event carries an idempotencyKey
. Same key twice, billed once.
A call that dies mid-way is recorded with status: "partial"
, not sent to Stripe unless you say so.
One usage event per completed stream — not one per token.
One-time payment. Full source code. MIT license with resale restriction.
Q: Do I need to understand OAuth 2.1 to use this?
A: No. Everything is pre-configured. Add your environment variables and deploy.
Q: What if Stripe changes its API?
A: The code is in your repository. You control the updates.
Q: Does it work with any MCP server or only certain frameworks?
A: It works as an independent layer. Your MCP server calls the auth and billing endpoints — framework agnostic.
Q: How does it handle retries and interrupted calls in billing?
A: Each usage event carries an idempotency_key. If the same event arrives twice (network retry), it's only charged once. Interrupted calls are recorded as 'partial' and you decide whether to charge them — documented with code examples.
Q: Is support included?
A: Yes — I respond to GitHub issues for 60 days from purchase.
Q: Can I use it in client projects?
A: Yes. Unlimited use license. You cannot resell the boilerplate itself.
Get MCP-Billing and have auth + billing running today.
One-time payment · No subscription · MIT license