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:
- No native transport auth: otherwise you hardcode master API keys or leave endpoints exposed
- Recursive tool loops: a confused agent can hammer a tool 50 times in seconds; standard rate-limiters drop connections, crashing or hallucinating the LLM client
- Unmetered compute drain: hosting a useful public MCP server means footing everyone's agent bills
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.
More from coding & agent
- AI Agents O'Reilly Book Companion Code Open Source — tom_doerr · 2026-08-26
- AI Agent governance may become the next IAM security challenge — ingliguori · 2026-08-26
- Startup Runable demo: Agents can analyze business churn autonomously — HaktanSuren · 2026-08-26
- Goliath: Agent-first Headless Browser Automation Server with Persistent Firefox Sessions — ccerrato147 · 2026-08-26
- MemMiner: an MCP service giving AI agents shared memory via a rated knowledge graph — AdSpecialist4695 · 2026-08-26
- Archify: Agent Skill for Beautiful, Verifiable Architecture Diagrams — tt-a1i · 2026-08-26