Production MCP & SSE Edge Gateway Blueprint
Built for teams shipping real-time LLM chat, Streamable HTTP MCP servers, and bounded agent tool loops on Cloudflare Workers, Node, or FastAPI without silent proxy buffering or runaway loop bills.
- Unbuffered SSE Edge Proxy Template: Pre-hardened
X-Accel-Buffering: no, 15s keep-alive heartbeats, UTF-8 chunk-boundary parser, and client abort propagation. - Fail-Closed Streamable HTTP MCP Server Kit: OAuth 2.1 read-only scope enforcement,
Mcp-Session-Idhandling, progress SSE events, and strict JSON Schema validation. - Bounded Tool-Loop & Prompt-Cache Ledger: Max-turn guards, deterministic tool sorting for 80%+ KV cache hits, and authoritative
stream_options.include_usagereconciliation.