# Saga Gateway Saga Gateway is an Out-of-Process MCP (Model Context Protocol) Gateway designed to secure, govern, and audit autonomous AI operations. By acting as a strict middleware layer between an LLM agent and critical external infrastructure (like Stripe or Shopify), it prevents hallucinated and irreversible actions. ## Core Features - **MCP Interception**: Intercepts JSON-RPC tool calls from LLMs. - **Human-In-The-Loop (HITL) Execution**: Forces human approval before executing any critical transaction, ensuring agents do not mutate production state unsupervised. - **Reversal Matrix**: Maps executed actions to guaranteed compensating transactions (e.g., mapping a `create_stripe_charge` tool call to an `issue_stripe_refund` action) acting as a rollback mechanism. - **Strict Multi-Tenant Isolation**: Uses Supabase for secure, isolated environments per user. - **Stateless HTTP Proxy**: Natively supports remote endpoints without persistent stream dropouts using a lightweight CLI proxy (`@sagagateway/mcp-proxy`). ## Links - **Main Website**: https://sagagateway.com - **Documentation**: https://sagagateway.com/docs - **Developer Login**: https://sagagateway.com/login ## Technical Architecture The architecture consists of: 1. **The Core Backend Saga Orchestrator**: A Python/FastAPI backend scaling via PostgreSQL state machines to track transactions (`PENDING` -> `EXECUTED` -> `COMPENSATED`). 2. **The Developer Portal (Frontend)**: A Next.js (App Router) interface for clients to review, approve, or deny transactions. 3. **Billing**: Integrated with Stripe v2 Billing Meters for granular API usage tracking.