MCP Billing Gateway SDK
The MCP Billing Gateway SDK is a hosted billing proxy that lets you monetize any MCP server with Stripe subscriptions, per-call credits, and x402 crypto payments — without writing billing code.
Service discovery: Use the
get_billing_infotool to retrieve gateway capabilities, supported payment methods, features, and integration docs. This is the only tool exposed by the local SDK; full billing functionality runs on the hosted gateway.Monetize MCP servers: Register as an operator, add your server URL and pricing plan, then point callers to a proxied URL that handles payment verification, usage tracking, and tier enforcement automatically.
Flexible billing models: Per-call billing (fiat or USDC), monthly/annual Stripe subscriptions, tiered pricing, and x402 micropayments for AI agents without API keys.
Transparent proxy: The gateway intercepts requests, verifies payment, tracks usage, and forwards to your upstream MCP server — seamlessly for AI agents and callers.
Operator dashboard: Monitor revenue, usage, and active callers, and configure servers in real time.
API endpoints: Register operators (
/api/v1/operator/*), manage servers and pricing plans (/api/v1/servers/*), and proxy requests (/proxy/{slug}/*).Deployment options: Use the hosted service or self-host via Docker.
Enables Stripe subscriptions and per-call billing for MCP servers, allowing operators to charge for API usage through monthly/annual plans or credit-based pricing.
MCP Billing Gateway
Add Stripe subscriptions, per-call credits, and x402 crypto payments to any MCP server — without writing billing code.
MCP Billing Gateway is a hosted billing proxy that sits between AI agents and your MCP server. It handles payment verification, usage tracking, and tier enforcement automatically. You register your server, set a pricing plan, and point callers to the proxied URL. No billing code required.
Live service: https://mcp-billing-gateway-production.up.railway.app
Tutorial: Monetize any MCP server in 10 minutes — step-by-step demo with working code
Installation
pip install mcp-billing-gatewayOr with uvx:
uvx mcp-billing-gatewayConfiguration for Claude Desktop
Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):
{
"mcpServers": {
"mcp-billing-gateway": {
"command": "uvx",
"args": ["mcp-billing-gateway"]
}
}
}Configuration for Cursor
Add to .cursor/mcp.json in your project:
{
"mcpServers": {
"mcp-billing-gateway": {
"command": "uvx",
"args": ["mcp-billing-gateway"]
}
}
}Restart your editor after adding the configuration to activate the MCP server.
Related MCP server: Agent Bazaar
Tools
Tool | Description |
| Returns service capabilities, supported payment methods, features, and integration docs |
The local MCP server provides service discovery. The full billing functionality runs on the hosted gateway — register as an operator and proxy your MCP servers through it.
How it works
AI Agent → MCP Billing Gateway → Your MCP Server
(billing enforced here)Register as an operator and get an API key
Register your MCP server URL + pricing plan
Point callers to your proxy slug:
https://mcp-billing-gateway-production.up.railway.app/proxy/{your-slug}/mcpCallers pay via Stripe API key or x402 USDC — billing is handled transparently
Features
Per-call billing — charge callers per tool call (fiat or crypto)
Subscriptions — monthly/annual Stripe plans with call limits
Tiered pricing — free tier + paid tiers based on usage
x402 micropayments — accept USDC on Base from AI agents with no API keys
Operator dashboard — track revenue, usage, and callers in real time
MCP transport — full Streamable HTTP MCP transport at
/mcp/endpoint
Quick Start
1. Register as operator
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"}'Response:
{
"operator_id": "op_abc123",
"api_key": "bg_live_xxxxxxxxxxxx",
"message": "Operator registered successfully"
}2. Register your MCP server
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. Create a pricing plan
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. Connect callers to your proxied server
{
"mcpServers": {
"my-server": {
"url": "https://mcp-billing-gateway-production.up.railway.app/proxy/my-server/mcp",
"headers": {
"Authorization": "Bearer CALLER_API_KEY"
}
}
}
}Payment Methods
Method | Best for | How |
Stripe subscription | Human developers | Monthly or annual plan via Stripe Checkout |
Stripe per-call | Human developers | Credits consumed per tool call |
x402 micropayments | AI agents | USDC on Base, no API keys needed |
Examples
Check gateway capabilities
# 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"
# }Register and monetize an existing MCP server
# 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/mcpOperator Dashboard
Access your dashboard at:
https://mcp-billing-gateway-production.up.railway.app/dashboardTrack revenue, usage, active callers, and configure your servers in real time.
API Reference
Operator endpoints
Endpoint | Method | Description |
| POST | Create operator account |
| GET | View profile and API keys |
| GET | Revenue and usage stats |
Server management
Endpoint | Method | Description |
| POST | Register an MCP server |
| GET | List your servers |
| POST | Create pricing plan |
Proxy
Endpoint | Method | Description |
| ANY | Proxied calls with billing enforcement |
| ANY | Streamable HTTP MCP transport |
Architecture
┌─────────────┐ ┌──────────────────────┐ ┌──────────────────┐
│ 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 dashboardThe gateway is a transparent proxy. Callers interact with your MCP server normally — the gateway intercepts requests, verifies payment, tracks usage, and forwards to your upstream server.
Self-hosted
The gateway is open for use at the hosted URL above. For self-hosted deployments, clone the server repository and deploy via Docker:
docker build -t mcp-billing-gateway .
docker run -p 3000:3000 mcp-billing-gatewayLicense
Available Tools
1 toolget_billing_infoBInspect
Get information about the MCP Billing Gateway service and integration options.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool retrieves information, implying a read-only operation, but fails to detail aspects like authentication needs, rate limits, response format, or error handling. This leaves significant gaps in understanding how the tool behaves.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, efficient sentence that directly states the tool's function without unnecessary words. It is front-loaded with the core action and resource, making it easy to parse and understand quickly.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool has zero parameters, 100% schema coverage, and an output schema exists, the description's focus on purpose is adequate. However, it lacks behavioral details (e.g., response structure, error cases) that could enhance completeness, especially since no annotations are provided to fill those gaps.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The tool has zero parameters, and the input schema coverage is 100%, so no parameter documentation is needed. The description appropriately does not discuss parameters, focusing instead on the tool's purpose, which aligns with the baseline expectation for parameterless tools.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action ('Get information') and target resource ('MCP Billing Gateway service and integration options'), making the purpose understandable. It lacks sibling tools for differentiation, but the scope is well-defined. No tautology or misleading elements are present.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance is provided on when to use this tool, such as for setup, troubleshooting, or comparison with other services. The description implies usage for general information retrieval but offers no context, alternatives, or exclusions, leaving the agent without operational direction.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
1 tool update
v0.1.2- First observed
get_billing_info
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
- mcpOAuthcom.stripe
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.
MCP server for Pinchwork - an agent-to-agent task marketplace with credits-based economy
MCP server for Lemon Squeezy — stores, products, orders, subscriptions, license keys.
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 gradedqualityBmaintenanceStripe Billing - MCP server providing AI-powered tools and automation by MEOK AI Labs7 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