## MCP (Model Context Protocol) server

The SuperAI Flows MCP (Model Context Protocol) server lets external AI agents and MCP-compatible clients interact with flows programmatically — creating workflows, reading state, managing definitions, and downloading files — without going through the UI.

## Overview

The MCP server exposes a curated subset of the SuperAI Flows API as MCP tools over the **Streamable HTTP** transport. It’s mounted at `/mcp` on the main API service and secured via the service-account API key system.

|  |  |
| --- | --- |
| **Endpoint** | `https://flows.super.ai/mcp` (production) |
| **Transport** | Streamable HTTP (POST) |
| **Authentication** | `X-API-Key` header with a valid service-account key |

## Authentication

All MCP requests require a valid service-account API key passed via the `X-API-Key` header.

1. Navigate to **Settings → Service Accounts** in the SuperAI Flows UI.
2. Create a new service account or use an existing one.
3. Copy the API key (format: `saf_org_...`).

Bearer token (`Authorization` header) authentication is **not supported** for MCP — use API keys only.

## Client configuration

- Claude Code
- Claude Desktop
- Native header support

Add to `.mcp.json` in your project root:

```
{
  "mcpServers": {
    "superai-flows": {
      "command": "npx",
      "args": [\
        "mcp-remote",\
        "https://flows.super.ai/mcp",\
        "--header",\
        "X-API-Key:saf_org_..."\
      ]
    }
  }
}
```

Add `.mcp.json` to `.gitignore` if it contains API keys.

Add to `~/Library/Application Support/Claude/claude_desktop_config.json`:

Some MCP clients support the `url` + `headers` format directly:

```
{
  "mcpServers": {
    "superai-flows": {
      "url": "https://flows.super.ai/mcp",
      "headers": {
        "X-API-Key": "saf_org_..."
      }
    }
  }
}
```

To avoid hardcoding keys, use shell variable expansion — for example, `
