MCP Billing Gateway SDK
MCP 결제 게이트웨이
결제 코드를 작성할 필요 없이 모든 MCP 서버에 Stripe 구독, 호출당 크레딧, x402 암호화폐 결제 기능을 추가하세요.
MCP 결제 게이트웨이는 AI 에이전트와 MCP 서버 사이에 위치하는 호스팅된 결제 프록시입니다. 결제 확인, 사용량 추적 및 요금제 강제 적용을 자동으로 처리합니다. 서버를 등록하고 요금제를 설정한 뒤, 호출자에게 프록시 URL을 안내하기만 하면 됩니다. 별도의 결제 코드는 필요하지 않습니다.
라이브 서비스: https://mcp-billing-gateway-production.up.railway.app
설치
pip install mcp-billing-gateway또는 uvx 사용:
uvx mcp-billing-gatewayClaude Desktop 설정
~/Library/Application Support/Claude/claude_desktop_config.json(macOS) 또는 %APPDATA%\Claude\claude_desktop_config.json(Windows)에 추가하세요:
{
"mcpServers": {
"mcp-billing-gateway": {
"command": "uvx",
"args": ["mcp-billing-gateway"]
}
}
}Cursor 설정
프로젝트의 .cursor/mcp.json에 추가하세요:
{
"mcpServers": {
"mcp-billing-gateway": {
"command": "uvx",
"args": ["mcp-billing-gateway"]
}
}
}설정을 추가한 후 에디터를 재시작하여 MCP 서버를 활성화하세요.
Related MCP server: Agent Bazaar
도구
도구 | 설명 |
| 서비스 기능, 지원되는 결제 수단, 특징 및 통합 문서 반환 |
로컬 MCP 서버는 서비스 검색 기능을 제공합니다. 전체 결제 기능은 호스팅된 게이트웨이에서 실행되므로, 운영자로 등록하고 MCP 서버를 해당 게이트웨이를 통해 프록시하세요.
작동 방식
AI Agent → MCP Billing Gateway → Your MCP Server
(billing enforced here)운영자로 등록하고 API 키를 받습니다.
MCP 서버 URL과 요금제를 등록합니다.
호출자에게 프록시 슬러그를 안내합니다:
https://mcp-billing-gateway-production.up.railway.app/proxy/{your-slug}/mcp호출자는 Stripe API 키 또는 x402 USDC를 통해 결제하며, 결제는 투명하게 처리됩니다.
특징
호출당 결제 — 도구 호출당 비용 청구 (법정 화폐 또는 암호화폐)
구독 — 호출 제한이 있는 월간/연간 Stripe 요금제
단계별 요금제 — 사용량에 따른 무료 티어 + 유료 티어
x402 소액 결제 — API 키 없이 AI 에이전트로부터 Base 네트워크의 USDC 수락
운영자 대시보드 — 수익, 사용량 및 호출자를 실시간으로 추적
MCP 전송 —
/mcp/엔드포인트에서 전체 Streamable HTTP MCP 전송 지원
빠른 시작
1. 운영자로 등록
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"}'응답:
{
"operator_id": "op_abc123",
"api_key": "bg_live_xxxxxxxxxxxx",
"message": "Operator registered successfully"
}2. 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. 요금제 생성
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. 호출자를 프록시 서버에 연결
{
"mcpServers": {
"my-server": {
"url": "https://mcp-billing-gateway-production.up.railway.app/proxy/my-server/mcp",
"headers": {
"Authorization": "Bearer CALLER_API_KEY"
}
}
}
}결제 수단
수단 | 권장 대상 | 방법 |
Stripe 구독 | 일반 개발자 | Stripe Checkout을 통한 월간 또는 연간 요금제 |
Stripe 호출당 결제 | 일반 개발자 | 도구 호출당 크레딧 차감 |
x402 소액 결제 | AI 에이전트 | Base 네트워크의 USDC, API 키 불필요 |
예시
게이트웨이 기능 확인
# 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"
# }기존 MCP 서버 등록 및 수익화
# 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/mcp운영자 대시보드
다음 주소에서 대시보드에 액세스하세요:
https://mcp-billing-gateway-production.up.railway.app/dashboard수익, 사용량, 활성 호출자를 추적하고 서버를 실시간으로 구성하세요.
API 참조
운영자 엔드포인트
엔드포인트 | 메서드 | 설명 |
| POST | 운영자 계정 생성 |
| GET | 프로필 및 API 키 보기 |
| GET | 수익 및 사용량 통계 |
서버 관리
엔드포인트 | 메서드 | 설명 |
| POST | MCP 서버 등록 |
| GET | 서버 목록 보기 |
| POST | 요금제 생성 |
프록시
엔드포인트 | 메서드 | 설명 |
| ANY | 결제 강제 적용이 포함된 프록시 호출 |
| ANY | Streamable HTTP MCP 전송 |
아키텍처
┌─────────────┐ ┌──────────────────────┐ ┌──────────────────┐
│ 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게이트웨이는 투명한 프록시입니다. 호출자는 평소처럼 MCP 서버와 상호작용하며, 게이트웨이가 요청을 가로채 결제를 확인하고 사용량을 추적한 뒤 업스트림 서버로 전달합니다.
자체 호스팅
게이트웨이는 위 호스팅 URL에서 바로 사용할 수 있습니다. 자체 호스팅 배포를 원하시면 서버 저장소를 복제하고 Docker를 통해 배포하세요:
docker build -t mcp-billing-gateway .
docker run -p 3000:3000 mcp-billing-gateway라이선스
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