Overview

MCP-Billing

Building the MCP tool takes a weekend. Wiring identity and payments around it does not. MCP-Billing is the part nobody ships, already shipped: 7 modules, 300+ passing tests, Next.js 15 and TypeScript.

Start here#

If you want to Go to
Get it running locally in five steps Quickstart
Put it in production Deploy to Vercel
Understand what you get What's included
Report usage from your MCP server Reporting usage
Know what counts as a billable call Billing decisions
Try the metering pattern for free mcp-metering package

Why this exists#

The auth side of MCP servers is mostly solved: OAuth 2.1 where the client supports it, API keys where it does not. The unsolved part is billing, specifically deciding what counts as a billable request once retries, partial failures and streamed responses enter the picture.

One developer on r/mcp put it this way: four hours in, they were reading RFC 9728, not one line of auth code made the search smarter, and they shipped with a static API key.

MCP-Billing takes an explicit, documented position on retries, interrupted calls and streaming instead of leaving you to work it out after a chargeback.

The numbers behind the problem#

  • 10,000+ active public MCP servers as of March 2026 (Anthropic)
  • Under 5% of MCP servers are monetized, because billing infrastructure is still unbuilt
  • 40% of exposed MCP services run with no auth at all (Censys)

Sections#

  • Guides — install, deploy, and see what ships in the box
  • Billing — the usage endpoint, the three edge cases, and the free metering package
  • Auth — OAuth 2.1 with PKCE, API key lifecycle, and multi-tenancy
  • Reference — stack, configuration points, trade-offs, FAQ, and license

What it costs#

One-time €79 during the launch window, rising to €149 afterwards. No subscription, no revenue share. See pricing and license for what the commercial license covers.