You built an MCP server. It works. Agents call your tools, get results, everybody's happy — except you're paying for compute and API calls out of pocket.
You want to charge for it. But now you're looking at building: payment verification, usage tracking, API key management, subscription tiers, credit balances, revenue splits, Stripe integration, webhook handling. That's 2–4 weeks of work that has nothing to do with the tool you actually built.
This is the billing problem every MCP server operator hits. You can build tools in a weekend, but monetizing them takes weeks. Most operators choose "not monetizing" and either burn money or shut down.
payments — USDC on Base chain. No API key needed. The caller sends a payment claim header:
curl -X POST https://mcp-billing-gateway-production.up.railway.app/proxy/weather \
-H "X-402-Payment: <base64-encoded-payment-claim>" \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": "req-1",
"method": "tools/call",
"params": {"name": "get_weather", "arguments": {"city": "Berlin"}}
}'
If a caller sends a request without valid payment, they get a structured 402 response with pricing info:
{
"jsonrpc": "2.0",
"id": "req-1",
"error": {
"code": 402,
"message": "Payment Required",
"data": {
"price_usd_micro": 10000,
"x402_address": "0x...",
"chain": "base"
}
}
}
This means your single server can accept both fiat (Stripe) and crypto (USDC) payments simultaneously, depending on what the caller supports.
Revenue and Analytics
Track how your server is being used and how much you're earning:
# Usage analytics
curl "https://mcp-billing-gateway-production.up.railway.app/api/v1/operator/servers/srv_01jvz.../usage?from=2026-04-01&to=2026-04-15" \
-H "Authorization: Bearer cgwop_abcd1234..."
The response includes usage broken down by day, by tool name, by billing rail (fiat vs. x402), and top callers. You see exactly which tools are popular and which pricing model callers prefer.
# Revenue and payouts
curl https://mcp-billing-gateway-production.up.railway.app/api/v1/operator/revenue \
-H "Authorization: Bearer cgwop_abcd1234..."
The default revenue split is 85/15 — you keep 85% of each call's revenue, the platform takes 15%. When you're ready to collect:
curl -X POST https://mcp-billing-gateway-production.up.railway.app/api/v1/operator/payouts/request \
-H "Authorization: Bearer cgwop_abcd1234..."
Funds transfer to your linked Stripe account within 1–2 business days. Minimum payout: $1.00.
Self-Hosting
The gateway is open for self-hosting if you want full control:
docker run -p 3000:3000 \
-e DB_PATH=/data/billing.db \
-e STRIPE_SECRET_KEY=sk_test_... \
-e STRIPE_WEBHOOK_SECRET=whsec_... \
-e PLATFORM_URL=https://your-domain.com \
-v billing-data:/data \
mcp-billing-gateway
SQLite for storage (no Postgres dependency), Stripe for payment processing, and the full operator + caller API available at your own domain. Set DEFAULT_TAKE_RATE_BPS to adjust the revenue split (default 1500 = 15%).
What You Don't Have to Build
Here's what the gateway handles so you don't have to:
| Concern | Without Gateway | With Gateway |
|---|---|---|
| API key management | Build auth system | Built-in (hashed, scoped, revocable) |
| Payment processing | Integrate Stripe SDK | Pre-integrated via Stripe Connect |
| Usage metering | Build tracking system | Per-call metering with breakdown |
| Subscription management | Handle Stripe webhooks | Automatic period tracking + cancellation |
| Credit system | Build ledger + balance tracking | Prepaid credits with auto-refund on errors |
| x402 crypto payments | Implement payment verification | Built-in x402 validation + anti-replay |
| Revenue analytics | Build dashboard | Usage by day, tool, billing rail, caller |
| Payouts | Manual Stripe transfers | One API call, automatic splits |
Getting Started
- Register as an operator (30 seconds)
- Complete Stripe onboarding (2 minutes)
- Register your server with a proxy slug (1 minute)
- Create a pricing plan (1 minute)
- Share the proxy URL with your users
Your MCP server is now monetized. No code changes to your server, no new dependencies, no payment infrastructure to maintain.
Live gateway:
Glama listing: glama.ai/mcp/servers/sapph1re/mcp-billing-gateway-sdk
SOCIAL SHARE CARD GENERATOR