# Saga Gateway - Full Documentation 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. This file contains the full documentation for Saga Gateway, concatenated for LLM consumption. --- ## Getting Started Guide # 🚀 Getting Started with Saga Gateway (For AI Users) Welcome! If you use AI agents (like Claude Desktop, Cursor, or your own custom assistants) and want them to interact with real-world apps like Stripe without worrying about them making costly mistakes, you're in the right place. ## What is this? Normally, if you give an AI agent access to your Stripe account, it can instantly charge cards, issue refunds, or cancel subscriptions. If the AI hallucinates or misunderstands you, it could cause irreversible damage. **Saga Gateway acts as a safety net.** It sits between your AI agent and the real world. Here is how it works: 1. **The Agent Tries to Act:** Your AI agent decides it needs to issue a refund. 2. **The Gateway Intercepts:** Instead of the refund happening instantly, our Gateway catches the request and pauses it. 3. **You Approve or Deny:** You log into your Gateway Dashboard. You see exactly what the AI is trying to do. If it looks correct, you click **Approve** and the action goes through. If the AI made a mistake, you click **Deny**, and nothing happens. 4. **The Undo Button:** If you approve something but change your mind later, the Gateway automatically knows how to "Undo" (reverse) the transaction. --- ## How to Get Started (No Coding Required) You don't need to install any code, run servers, or know how to program to use this. We host everything for you. ### Step 1: Get Your API Key 1. Go to [SagaGateway.com](https://sagagateway.com) and click **Start Building - Pay As You Go**. 2. Complete the checkout process. 3. Once logged in, go to the **Developer Portal**. 4. Choose **Path A: Hosted Gateway (AWS)**. 5. Click **Generate Standard Key**. Save the `Access Token` and the `Base URL` (e.g., `https://api.sagagateway.com/v1/mcp`). ### Step 2: Connect Your AI Agent Most modern AI agents support **MCP (Model Context Protocol)**. This is just a standard way for them to connect to external tools. **For Claude Desktop:** 1. Open your Claude Desktop MCP configuration file (`claude_desktop_config.json`). 2. Add a new MCP server using the Base URL and Access Token you got in Step 1. It typically looks like this: ```json "mcpServers": { "saga-gateway": { "command": "npx", "args": ["-y", "@sagagateway/mcp-proxy", "https://api.sagagateway.com/v1/mcp"], "env": { "SAGA_API_KEY": "your_access_token_here" } } } ``` **For Cursor, Kimi, and other MCP Clients:** 1. Open your agent's settings and navigate to the **MCP / Tools** section. 2. Add a new MCP Server and configure it as follows: - **Type**: `command` - **Command**: `npx -y @sagagateway/mcp-proxy https://api.sagagateway.com/v1/mcp` - **Environment Variables**: Add `SAGA_API_KEY` and set it to your Access Token. *(Note: If your client natively supports direct SSE URLs without the npx proxy, simply paste your Base URL and pass the API key in the headers).* **For Autonomous Workspaces (OpenHands, Cline, Roo, etc.):** 1. Locate your workspace's MCP settings file (e.g., `cline_mcp_settings.json` for Cline). 2. Add the Gateway just like a standard Claude Desktop server: ```json "mcpServers": { "saga-gateway": { "command": "npx", "args": ["-y", "@sagagateway/mcp-proxy", "https://api.sagagateway.com/v1/mcp"], "env": { "SAGA_API_KEY": "your_access_token_here" } } } ``` ### Step 3: Let the AI Work Safely Now, when you ask your AI agent to do something in Stripe: - The agent will attempt the action, but it will be intercepted. - The agent will tell you: *"I've sent the request, but it is pending your approval."* - Go to your **Saga Gateway Dashboard**. - Review the transaction's before/after state, and click **Approve**. That's it! You now have a fully autonomous AI worker that cannot make permanent mistakes without your explicit permission. ---