MCP Billing Gateway

io.github.sapph1rePublished by GitHub account sapph1rev0.1.3Updated Oct 27, 2026

Billing proxy for MCP servers. Adds Stripe and x402 crypto payments without writing billing code.

VerifiedStreamable HTTPWeb executableFinanceDeveloper ToolsBusiness & Commerce

Overview

AI-generated overview

Hosted billing proxy that lets an assistant register MCP servers, set pricing plans, and track usage and revenue for Stripe or x402 crypto payments.

What you can do
  • Register and manage operator accounts, including Stripe Connect onboarding and profile status
  • Register, list, inspect, update and soft-delete MCP servers, including upstream URL and public status
  • Create, list and update pricing plans for a server
  • Read usage analytics (calls, revenue, top callers) and revenue summaries with payout history
When to use it
For operators who want to monetize an MCP server with per-call credits, subscriptions or crypto micropayments without writing billing code, and who want an assistant to manage servers, plans and revenue figures.
Requirements
Either the hosted remote endpoint or the local PyPI package run with uvx or pip (Python). An operator account is needed; the README says registration returns an API key used as a Bearer token for server and plan management. Stripe Connect onboarding is required for payouts, and callers pay via Stripe or x402 USDC.
Before you install
The tools create, update and soft-delete servers and plans, and registration starts Stripe Connect onboarding, so changes affect live billing. The operator API key is a credential that grants control of your servers and revenue; keep it out of shared transcripts. Pricing plans set real charges to callers, and payments and payouts run through Stripe and x402 USDC on Base. Server URLs and usage data are sent to the hosted gateway.

Installation

In SourceWeft

  1. Open MCP Billing Gateway in the dashboard and add it to a workspace.
  2. Enable the server for the chats that should use its tools.

Web executable via Streamable HTTP. Remote servers run from the web runtime once configured in a workspace.

Use with an agent

Paste this prompt into Claude Code, Codex, Cursor or another agent — or into SourceWeft chat. The agent reads this server's install guide, shows you its publisher, endpoint and sign-in, and adds it to your client once you agree. Keys never go into a command.

Read https://sourceweft.com/mcp/io.github.sapph1re%2Fmcp-billing-gateway/install.md and connect the MCP server it describes to my client. Before changing any config, show me its publisher, endpoint and sign-in method and wait for my OK. Never put an API key in a command or in a file I would commit; ask me where it should come from.

Read the install guide the agent follows

Other MCP clients

Add this to your client's mcpServers config.

{
  "mcpServers": {
    "billing-gateway": {
      "type": "http",
      "url": "https://mcp-billing-gateway-production.up.railway.app/mcp/"
    }
  }
}

README

MCP Billing Gateway

[Glama MCP Server] [MCP.Directory]

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

bash
pip install mcp-billing-gateway

Or with uvx:

bash
uvx mcp-billing-gateway

Configuration for Claude Desktop

Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):

json
{  "mcpServers": {    "mcp-billing-gateway": {      "command": "uvx",      "args": ["mcp-billing-gateway"]    }  }}

Configuration for Cursor

Add to .cursor/mcp.json in your project:

json
{  "mcpServers": {    "mcp-billing-gateway": {      "command": "uvx",      "args": ["mcp-billing-gateway"]    }  }}

Restart your editor after adding the configuration to activate the MCP server.

Tools

ToolDescription
get_billing_infoReturns 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)
  1. Register as an operator and get an API key
  2. Register your MCP server URL + pricing plan
  3. Point callers to your proxy slug: https://mcp-billing-gateway-production.up.railway.app/proxy/{your-slug}/mcp
  4. Callers 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

bash
curl -X POST https://mcp-billing-gateway-production.up.railway.app/api/v1/operator/register \  -H "Content-Type: application/json" \  -d '{"email": "[email protected]", "name": "Your Name"}'

Response:

json
{  "operator_id": "op_abc123",  "api_key": "bg_live_xxxxxxxxxxxx",  "message": "Operator registered successfully"}

2. Register your MCP server

bash
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

bash
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

json
{  "mcpServers": {    "my-server": {      "url": "https://mcp-billing-gateway-production.up.railway.app/proxy/my-server/mcp",      "headers": {        "Authorization": "Bearer CALLER_API_KEY"      }    }  }}

Payment Methods

MethodBest forHow
Stripe subscriptionHuman developersMonthly or annual plan via Stripe Checkout
Stripe per-callHuman developersCredits consumed per tool call
x402 micropaymentsAI agentsUSDC on Base, no API keys needed

Examples

Check gateway capabilities

python
# Using the MCP clientresult = 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

bash
# 1. RegisterAPI_KEY=$(curl -s -X POST .../api/v1/operator/register \  -H "Content-Type: application/json" \  -d '{"email": "[email protected]", "name": "Dev"}' | jq -r .api_key)
# 2. Add your serverSERVER_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/monthcurl -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/mcp

Operator Dashboard

Access your dashboard at:

https://mcp-billing-gateway-production.up.railway.app/dashboard

Track revenue, usage, active callers, and configure your servers in real time.

API Reference

Operator endpoints

EndpointMethodDescription
/api/v1/operator/registerPOSTCreate operator account
/api/v1/operator/profileGETView profile and API keys
/api/v1/operator/statsGETRevenue and usage stats

Server management

EndpointMethodDescription
/api/v1/serversPOSTRegister an MCP server
/api/v1/serversGETList your servers
/api/v1/servers/{id}/plansPOSTCreate pricing plan

Proxy

EndpointMethodDescription
/proxy/{slug}/*ANYProxied calls with billing enforcement
/mcp/ANYStreamable 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 dashboard

The 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:

bash
docker build -t mcp-billing-gateway .docker run -p 3000:3000 mcp-billing-gateway

License

MIT

Source: README.md at commit 7e6e2e3

Tools

12

register_operator

Register a new operator account with Stripe Connect onboarding

Parametersnamerequiredemailrequired

get_operator_info

Get current operator profile and status

Parametersapi_keyrequired

list_servers

List all MCP servers registered by the operator

Parametersapi_keyrequired

create_server

Register a new MCP server for billing

Parametersnamerequiredapi_keyrequiredauth_modeis_publictransportproxy_slugrequireddescriptionupstream_urlrequired

get_server

Get server details including pricing plans

Parametersapi_keyrequiredserver_idrequired

update_server

Update server settings (name, description, upstream_url, is_public, status)

Parametersnamestatusapi_keyrequiredis_publicserver_idrequireddescriptionupstream_url

delete_server

Soft-delete a server (can be restored)

Parametersapi_keyrequiredserver_idrequired

create_plan

Create a pricing plan for a server

Parametersnamerequiredapi_keyrequiredserver_idrequiredis_defaultbilling_modelrequiredfree_calls_per_monthsubscription_intervalsubscription_call_limitprice_per_call_usd_microsubscription_price_usd_cents

list_plans

List pricing plans for a server

Parametersapi_keyrequiredserver_idrequired

update_plan

Update a pricing plan

Parametersnameapi_keyrequiredplan_idrequiredis_activeis_defaultfree_calls_per_monthprice_per_call_usd_micro

get_usage

Get usage analytics for a server (calls, revenue, top callers)

Parameterstofromapi_keyrequiredserver_idrequired

get_revenue

Get revenue summary and payout history

Parametersapi_keyrequired

Version history

1
  1. v0.1.3LatestSep 16, 2026

Score

100% of the applicable checks met

How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.

  • Reached in the last 30 daysRequired25 pts
  • Auth declaredRequired10 pts
  • Tools listedRequired15 pts
  • DescriptionRequired15 pts
  • Logo10 pts
  • Documentation15 pts
  • License10 pts