MCPay: a pay-per-call Go gateway to tame runaway agents on remote MCP servers

TooDu0 · reddit · 2026-08-26

A team open-sourced MCPay, a Go reverse proxy that sits at the transport layer in front of any MCP server, tackling three pain points of remote MCP hosting:

How it works: the proxy intercepts JSON-RPC tools/call over SSE, validates bearer tokens and quotas pre-execution, micro-meters credits per invocation (e.g. $0.005 per search), and applies token-bucket rate limiting tuned for agent traffic — returning clean JSON-RPC errors so the LLM understands throttling instead of crashing. Proxy overhead stays under 1ms. The Go core is open-sourced under BSL-1.1, with a managed cloud option. The breaking point: an agent stuck parsing an auth wall burned their entire compute quota in under two minutes.

Original post →

More from coding & agent

coding & agent channel →