MCP Billing Gateway SDK
MCP Billing Gateway
Fügen Sie Stripe-Abonnements, Credits pro Aufruf und x402-Krypto-Zahlungen zu jedem MCP-Server hinzu — ohne Abrechnungscode schreiben zu müssen.
MCP Billing Gateway ist ein gehosteter Abrechnungs-Proxy, der zwischen KI-Agenten und Ihrem MCP-Server sitzt. Er übernimmt automatisch die Zahlungsüberprüfung, Nutzungsverfolgung und die Durchsetzung von Tarifen. Sie registrieren Ihren Server, legen einen Preisplan fest und verweisen Aufrufer auf die Proxy-URL. Kein Abrechnungscode erforderlich.
Live-Service: https://mcp-billing-gateway-production.up.railway.app
Installation
pip install mcp-billing-gatewayOder mit uvx:
uvx mcp-billing-gatewayKonfiguration für Claude Desktop
Hinzufügen zu ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) oder %APPDATA%\Claude\claude_desktop_config.json (Windows):
{
"mcpServers": {
"mcp-billing-gateway": {
"command": "uvx",
"args": ["mcp-billing-gateway"]
}
}
}Konfiguration für Cursor
Hinzufügen zu .cursor/mcp.json in Ihrem Projekt:
{
"mcpServers": {
"mcp-billing-gateway": {
"command": "uvx",
"args": ["mcp-billing-gateway"]
}
}
}Starten Sie Ihren Editor nach dem Hinzufügen der Konfiguration neu, um den MCP-Server zu aktivieren.
Related MCP server: Agent Bazaar
Tools
Tool | Beschreibung |
| Gibt Service-Fähigkeiten, unterstützte Zahlungsmethoden, Funktionen und Integrationsdokumente zurück |
Der lokale MCP-Server bietet Service-Discovery. Die vollständige Abrechnungsfunktionalität läuft auf dem gehosteten Gateway — registrieren Sie sich als Betreiber und leiten Sie Ihre MCP-Server darüber weiter.
Funktionsweise
AI Agent → MCP Billing Gateway → Your MCP Server
(billing enforced here)Registrieren Sie sich als Betreiber und erhalten Sie einen API-Schlüssel
Registrieren Sie Ihre MCP-Server-URL + Preisplan
Verweisen Sie Aufrufer auf Ihren Proxy-Slug:
https://mcp-billing-gateway-production.up.railway.app/proxy/{your-slug}/mcpAufrufer zahlen via Stripe-API-Schlüssel oder x402 USDC — die Abrechnung erfolgt transparent
Funktionen
Abrechnung pro Aufruf — berechnen Sie Aufrufern jeden Tool-Aufruf (Fiat oder Krypto)
Abonnements — monatliche/jährliche Stripe-Pläne mit Aufruflimits
Gestaffelte Preise — kostenloser Tarif + kostenpflichtige Tarife basierend auf der Nutzung
x402-Mikrozahlungen — akzeptieren Sie USDC auf Base von KI-Agenten ohne API-Schlüssel
Betreiber-Dashboard — verfolgen Sie Umsatz, Nutzung und Aufrufer in Echtzeit
MCP-Transport — vollständiger Streamable HTTP MCP-Transport am
/mcp/-Endpunkt
Schnellstart
1. Als Betreiber registrieren
curl -X POST https://mcp-billing-gateway-production.up.railway.app/api/v1/operator/register \
-H "Content-Type: application/json" \
-d '{"email": "you@example.com", "name": "Your Name"}'Antwort:
{
"operator_id": "op_abc123",
"api_key": "bg_live_xxxxxxxxxxxx",
"message": "Operator registered successfully"
}2. Ihren MCP-Server registrieren
curl -X POST https://mcp-billing-gateway-production.up.railway.app/api/v1/servers \
-H "Authorization: Bearer bg_live_xxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"name": "My MCP Server",
"upstream_url": "https://your-mcp-server.com/mcp",
"proxy_slug": "my-server"
}'3. Einen Preisplan erstellen
curl -X POST https://mcp-billing-gateway-production.up.railway.app/api/v1/servers/{server_id}/plans \
-H "Authorization: Bearer bg_live_xxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"name": "Pay as you go",
"billing_model": "per_call",
"price_per_call_usd_micro": 10000,
"free_calls_per_month": 100
}'4. Aufrufer mit Ihrem Proxy-Server verbinden
{
"mcpServers": {
"my-server": {
"url": "https://mcp-billing-gateway-production.up.railway.app/proxy/my-server/mcp",
"headers": {
"Authorization": "Bearer CALLER_API_KEY"
}
}
}
}Zahlungsmethoden
Methode | Am besten für | Wie |
Stripe-Abonnement | Menschliche Entwickler | Monatlicher oder jährlicher Plan via Stripe Checkout |
Stripe pro Aufruf | Menschliche Entwickler | Credits werden pro Tool-Aufruf verbraucht |
x402-Mikrozahlungen | KI-Agenten | USDC auf Base, keine API-Schlüssel erforderlich |
Beispiele
Gateway-Fähigkeiten prüfen
# Using the MCP client
result = await session.call_tool("get_billing_info")
print(result)
# {
# "service": "MCP Billing Gateway",
# "version": "0.1.0",
# "payment_methods": ["stripe_subscription", "stripe_metered", "x402_crypto"],
# "features": ["Per-call usage tracking", "Tiered pricing", ...],
# "live_service": "https://mcp-billing-gateway-production.up.railway.app"
# }Einen bestehenden MCP-Server registrieren und monetarisieren
# 1. Register
API_KEY=$(curl -s -X POST .../api/v1/operator/register \
-H "Content-Type: application/json" \
-d '{"email": "dev@example.com", "name": "Dev"}' | jq -r .api_key)
# 2. Add your server
SERVER_ID=$(curl -s -X POST .../api/v1/servers \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{"name": "my-tool", "upstream_url": "https://my-tool.com/mcp", "proxy_slug": "my-tool"}' \
| jq -r .server_id)
# 3. Set pricing: $0.01 per call, 100 free calls/month
curl -X POST .../api/v1/servers/$SERVER_ID/plans \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{"name": "Starter", "billing_model": "per_call", "price_per_call_usd_micro": 10000, "free_calls_per_month": 100}'
# Callers now connect via: .../proxy/my-tool/mcpBetreiber-Dashboard
Greifen Sie auf Ihr Dashboard zu unter:
https://mcp-billing-gateway-production.up.railway.app/dashboardVerfolgen Sie Umsatz, Nutzung, aktive Aufrufer und konfigurieren Sie Ihre Server in Echtzeit.
API-Referenz
Betreiber-Endpunkte
Endpunkt | Methode | Beschreibung |
| POST | Betreiberkonto erstellen |
| GET | Profil und API-Schlüssel anzeigen |
| GET | Umsatz- und Nutzungsstatistiken |
Serververwaltung
Endpunkt | Methode | Beschreibung |
| POST | MCP-Server registrieren |
| GET | Ihre Server auflisten |
| POST | Preisplan erstellen |
Proxy
Endpunkt | Methode | Beschreibung |
| ANY | Proxy-Aufrufe mit Abrechnungsdurchsetzung |
| ANY | Streamable HTTP MCP-Transport |
Architektur
┌─────────────┐ ┌──────────────────────┐ ┌──────────────────┐
│ AI Agent / │────▶│ MCP Billing Gateway │────▶│ Your MCP Server │
│ MCP Client │◀────│ (hosted on Railway) │◀────│ (upstream) │
└─────────────┘ └──────────────────────┘ └──────────────────┘
│
├── Payment verification (Stripe / x402)
├── Usage tracking & rate limiting
├── Tier enforcement
└── Operator dashboardDas Gateway ist ein transparenter Proxy. Aufrufer interagieren normal mit Ihrem MCP-Server — das Gateway fängt Anfragen ab, überprüft die Zahlung, verfolgt die Nutzung und leitet an Ihren Upstream-Server weiter.
Selbst gehostet
Das Gateway steht unter der oben genannten gehosteten URL zur Verfügung. Für selbst gehostete Bereitstellungen klonen Sie das Server-Repository und stellen Sie es via Docker bereit:
docker build -t mcp-billing-gateway .
docker run -p 3000:3000 mcp-billing-gatewayLizenz
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Tools
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceA comprehensive framework for building and deploying commercial MCP servers with integrated billing, usage metering, and Stripe payment processing. It enables developers to monetize AI tools through a complete ecosystem including API key management, affiliate tracking, and automated deployment scripts.
- AlicenseNot gradedqualityCmaintenancePer-call billing and metering proxy for MCP tool servers. Providers set pricing via the open MCP Billing Spec (MIT), consumers pay through Stripe Connect with signed receipts and SLA monitoring.MIT
- AlicenseNot gradedqualityAmaintenanceStripe Billing - MCP server providing AI-powered tools and automation by MEOK AI Labs11MIT
- AlicenseNot gradedqualityCmaintenanceTemplate for creating MCP servers with a server-side paywall gate, enabling free local usage and premium hosted tier with Stripe and x402 payment lanes.MIT
Related MCP Connectors
MCP server integrating with Stripe - tools for customers, products, payments, and more.
Monetize any MCP server: x402 paywall, pay-per-call billing in USDC on Base, agent marketplace.
Stripe MCP Pack — read-only access to Stripe data via API key.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/sapph1re/mcp-billing-gateway-sdk'
If you have feedback or need assistance with the MCP directory API, please join our Discord server