cyberneticlibrary

Monetize MCP servers with per-tool pricing

paygate-mcpmcp_serversetup L30
walker77/paygate-mcp
What it does

Gate any MCP server with API key auth, per-tool pricing, rate limiting, and usage metering

Best for

Monetizing an MCP server with fine-grained per-tool pricing, ACL, quotas, and real-time audit trail.

Inputs
  • · API key (X-API-Key header)
  • · Tool call request with tool name and args
Outputs
  • · Tool result (if authorized and within limits)
  • · 402 Payment Required (insufficient credits)
  • · 403 Forbidden (ACL or rate limit exceeded)
  • · Usage analytics and audit log
Requires
  • · Underlying MCP server (local stdio or remote HTTP)
  • · Optional: Stripe for credit top-ups
  • · Optional: Redis for distributed state (scaling)
Preconditions
  • · Node.js
  • · Underlying server binary or remote URL
  • · paygate.json config or CLI setup
  • · Optional: Redis for multi-process deployments
Failure modes
  • · Redis unavailable → fallback to in-memory (single-process only)
  • · Rate limit collisions on high concurrency (single-process)
  • · Webhook delivery failures queued with DLQ
  • · Stripe sync delay (eventual consistency)
Trust signals
  • · 199+ API endpoints documented
  • · Stripe and OAuth 2.1 integration
  • · Redis horizontal scaling with atomic credit deduction
  • · Comprehensive audit log with retention policies
  • · Prometheus metrics at /metrics
  • · OpenAPI 3.1 spec with interactive Swagger UI