MCP Billing Gateway SDK
Pasarela de Facturación MCP
Añade suscripciones de Stripe, créditos por llamada y pagos cripto x402 a cualquier servidor MCP, sin escribir código de facturación.
La Pasarela de Facturación MCP es un proxy de facturación alojado que se sitúa entre los agentes de IA y tu servidor MCP. Gestiona automáticamente la verificación de pagos, el seguimiento de uso y la aplicación de niveles. Registras tu servidor, estableces un plan de precios y diriges a los usuarios a la URL del proxy. No se requiere código de facturación.
Servicio en vivo: https://mcp-billing-gateway-production.up.railway.app
Instalación
pip install mcp-billing-gatewayO con uvx:
uvx mcp-billing-gatewayConfiguración para Claude Desktop
Añade a ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) o %APPDATA%\Claude\claude_desktop_config.json (Windows):
{
"mcpServers": {
"mcp-billing-gateway": {
"command": "uvx",
"args": ["mcp-billing-gateway"]
}
}
}Configuración para Cursor
Añade a .cursor/mcp.json en tu proyecto:
{
"mcpServers": {
"mcp-billing-gateway": {
"command": "uvx",
"args": ["mcp-billing-gateway"]
}
}
}Reinicia tu editor después de añadir la configuración para activar el servidor MCP.
Related MCP server: Agent Bazaar
Herramientas
Herramienta | Descripción |
| Devuelve las capacidades del servicio, métodos de pago soportados, características y documentación de integración |
El servidor MCP local proporciona descubrimiento de servicios. La funcionalidad completa de facturación se ejecuta en la pasarela alojada: regístrate como operador y haz proxy de tus servidores MCP a través de ella.
Cómo funciona
AI Agent → MCP Billing Gateway → Your MCP Server
(billing enforced here)Regístrate como operador y obtén una clave API
Registra la URL de tu servidor MCP + plan de precios
Dirige a los usuarios a tu slug de proxy:
https://mcp-billing-gateway-production.up.railway.app/proxy/{your-slug}/mcpLos usuarios pagan mediante clave API de Stripe o USDC x402: la facturación se gestiona de forma transparente
Características
Facturación por llamada — cobra a los usuarios por llamada a herramienta (fiat o cripto)
Suscripciones — planes mensuales/anuales de Stripe con límites de llamadas
Precios escalonados — nivel gratuito + niveles de pago basados en el uso
Micropagos x402 — acepta USDC en Base de agentes de IA sin necesidad de claves API
Panel de operador — realiza un seguimiento de ingresos, uso y usuarios en tiempo real
Transporte MCP — transporte MCP HTTP completo y transmitible en el endpoint
/mcp/
Inicio rápido
1. Regístrate como operador
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"}'Respuesta:
{
"operator_id": "op_abc123",
"api_key": "bg_live_xxxxxxxxxxxx",
"message": "Operator registered successfully"
}2. Registra tu servidor MCP
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. Crea un plan de precios
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. Conecta a los usuarios a tu servidor proxy
{
"mcpServers": {
"my-server": {
"url": "https://mcp-billing-gateway-production.up.railway.app/proxy/my-server/mcp",
"headers": {
"Authorization": "Bearer CALLER_API_KEY"
}
}
}
}Métodos de pago
Método | Ideal para | Cómo |
Suscripción Stripe | Desarrolladores humanos | Plan mensual o anual vía Stripe Checkout |
Stripe por llamada | Desarrolladores humanos | Créditos consumidos por llamada a herramienta |
Micropagos x402 | Agentes de IA | USDC en Base, no se necesitan claves API |
Ejemplos
Comprobar capacidades de la pasarela
# 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"
# }Registrar y monetizar un servidor MCP existente
# 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/mcpPanel de operador
Accede a tu panel en:
https://mcp-billing-gateway-production.up.railway.app/dashboardRealiza un seguimiento de ingresos, uso, usuarios activos y configura tus servidores en tiempo real.
Referencia de API
Endpoints de operador
Endpoint | Método | Descripción |
| POST | Crear cuenta de operador |
| GET | Ver perfil y claves API |
| GET | Estadísticas de ingresos y uso |
Gestión de servidores
Endpoint | Método | Descripción |
| POST | Registrar un servidor MCP |
| GET | Listar tus servidores |
| POST | Crear plan de precios |
Proxy
Endpoint | Método | Descripción |
| ANY | Llamadas proxy con aplicación de facturación |
| ANY | Transporte MCP HTTP transmitible |
Arquitectura
┌─────────────┐ ┌──────────────────────┐ ┌──────────────────┐
│ 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 dashboardLa pasarela es un proxy transparente. Los usuarios interactúan con tu servidor MCP normalmente: la pasarela intercepta las solicitudes, verifica el pago, rastrea el uso y reenvía al servidor upstream.
Autoalojamiento
La pasarela está abierta para su uso en la URL alojada anteriormente. Para despliegues autoalojados, clona el repositorio del servidor y despliega mediante Docker:
docker build -t mcp-billing-gateway .
docker run -p 3000:3000 mcp-billing-gatewayLicencia
Available Tools
1 toolget_billing_infoBInspect
Get information about the MCP Billing Gateway service and integration options.
Inputs: no named parameters. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 1 tool
With only one tool, there is no possibility of ambiguity or overlap between tools, as there are no other tools to confuse it with. The tool's purpose is clearly defined as retrieving billing information, making disambiguation trivial.
The single tool name 'get_billing_info' follows a clear verb_noun pattern (get + billing_info), which is consistent with itself. Since there are no other tools, there is no inconsistency to evaluate, and the naming is straightforward.
A single tool is too few for a server named 'MCP Billing Gateway SDK', which suggests a broader scope for managing billing operations. This minimal set likely leaves significant gaps in functionality, such as creating, updating, or deleting billing data, making it inappropriate for comprehensive billing tasks.
The tool set is severely incomplete for a billing gateway domain, as it only provides a read operation (get_billing_info) without any support for create, update, delete, or other essential billing workflows. This will cause agent failures when attempting to perform full billing lifecycle management.
Maintenance
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.
Marketplace and infrastructure for MCP servers and skills: deploy, host, monetize, analytics.
Hosted Stripe MCP server for Claude, ChatGPT and Cursor, with each action switched per account.
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
- AlicenseCqualityCmaintenanceStripe Billing - MCP server providing AI-powered tools and automation by MEOK AI Labs813 npmMIT
- 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