Billing and monetization SDK for MCP servers. Add usage-based pricing to any MCP server in minutes.
Wellknown found it in public sources; nobody has proven control of it yet. Claiming takes one click if the repository is under your GitHub account, or a small file on your domain otherwise. Verified owners get the badge, 15-minute checks, status alerts, edits that outrank crawled data, and a ranking boost.
Agents can do it too: POST https://wellknown.network/api/v1/claims with {"agent":"mcp-billing","method":"well_known_file"} — machine-readable steps at claim.json, guide at /docs/claim.
Everything here was measured by our prober or read from a registry. Nothing is self-reported.
Attributed to the source that supplied each field. Treated as claims, not facts.
# mcp-billing Billing and monetization SDK for MCP servers. Add usage-based pricing in minutes. 16,000+ MCP servers exist. Zero have turnkey billing. This fixes that. ## Install ```bash pip install mcp-billing ``` ## Quick Start — 5 Lines to Monetize ```python from mcp.server.fastmcp import FastMCP from mcp_billing import BillingGuard from mcp_billing.middleware import billing_middleware mcp = FastMCP("my-server") guard = BillingGuard() # SQLite-backed, zero config @mcp.tool() @billing_middleware(guard) def analyze(query: str, api_key: str = "") -> str: return f"Analysis of: {query}" ``` That's it. Every call is now gated by API key, tracked with usage counts, and enforced with rate limits. ## What You Get - **API key gating** — register keys, assign tiers, deny unknown callers - **Rate limiting** — per-minute and per-month caps per tier - **Usage metering** — every call logged to SQLite with cost tracking - **Tier-based pricing** — free/pro/enterprise out of the box, fully customizable - **Stripe sync** — optional, push usage events to Stripe Billing Meters - **CLI tools** — `mcp-billing init` and `mcp-billing status` ## Register API Keys ```python guard = BillingGuard() # Free tier: 10 req/min, 1000/month guard.register_key("key-free-abc123", tier_name="free") # Pro tier: 60 req/min, 50k/month, $0.001/call guard.register_key("key-pro-xyz789", tier_name="pro") # Enterprise: unlimited guard.register_key("key-ent-456def", tier_name="enterprise") ``` ## Custom Pricing Tiers ```python from mcp_billing import PricingTier, BillingGuard tiers = [ PricingTier(name="starter", rate_limit=5, monthly_cap=500, cost_per_call=0.0), PricingTier(name="growth", rate_limit=100, monthly_cap=100_000, cost_per_call=0.002), PricingTier( name="scale", tools=["analyze", "generate"], # restrict tool access by tier rate_limit=0, monthly_cap=0, cost_per_call=0.001, ), ] guard = BillingGuard(tiers=tiers) ``` Or…
Mapped onto the structured taxonomy from declared text and observed tool names. Confidence shown for derived entries.
Every source is kept verbatim. Field changes are logged as events.