Skip to main content
Connect your sandbox to Supabase for database, authentication, and storage capabilities. The AI can then directly interact with your backend.

Endpoint

POST /api/seemodo-cloud

Authentication

All requests require a Supabase API token in the header:
-H "X-Supabase-Token: your-supabase-access-token"
Get your access token from: Supabase Dashboard → Account → Access Tokens

Actions

The endpoint supports three actions:
ActionDescription
activateConnect a Supabase project to the sandbox
create-projectCreate a new Supabase project
statusCheck connection status

Activate Cloud

Connect an existing Supabase project to your sandbox.

Request Body

action
string
required
Must be "activate"
projectRef
string
required
Your Supabase project reference ID (e.g., abcdefghijklmnop).
sandboxId
string
required
The ID of the active sandbox.
sandboxApiUrl
string
required
The API URL of the sandbox backend.

Example Request

curl -X POST http://app.seemodo.ai/api/seemodo-cloud \
  -H "Content-Type: application/json" \
  -H "X-Supabase-Token: sbp_your_token_here" \
  -d '{
    "action": "activate",
    "projectRef": "abcdefghijklmnop",
    "sandboxId": "modal-sandbox-1234",
    "sandboxApiUrl": "https://seemodo--sandbox-backend.modal.run"
  }'

Success Response

{
  "success": true,
  "project": {
    "ref": "abcdefghijklmnop",
    "name": "My Project",
    "region": "eu-central-1",
    "endpoint": "https://abcdefghijklmnop.supabase.co"
  },
  "apiKeys": {
    "anon": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
    "service_role": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
  },
  "mcpServerName": "supabase_abcdefghijklmnop",
  "mcpAuthUrl": null,
  "mcpAuthNeeded": false
}

What Activation Does

1

Verify Project

Confirms you have access to the Supabase project.
2

Get API Keys

Retrieves anon and service_role keys.
3

Configure MCP

Sets up the Supabase MCP server in Seemodo AI.
4

Install Client

Adds @supabase/supabase-js to the sandbox.
5

Create Config

Generates src/lib/supabase.ts with connection details.
6

Add Rules

Copies Supabase best practice rules for the AI.

Create Project

Create a new Supabase project.

Request Body

action
string
required
Must be "create-project"
name
string
required
Name for the new project.
organizationId
string
required
Your Supabase organization ID.

Example Request

curl -X POST http://app.seemodo.ai/api/seemodo-cloud \
  -H "Content-Type: application/json" \
  -H "X-Supabase-Token: sbp_your_token_here" \
  -d '{
    "action": "create-project",
    "name": "My New App",
    "organizationId": "org-abc123"
  }'

Success Response

{
  "success": true,
  "projectRef": "newprojectref123",
  "project": {
    "ref": "newprojectref123",
    "name": "My New App",
    "region": "eu-central-1",
    "endpoint": "https://newprojectref123.supabase.co"
  }
}

Check Status

Check if a project is connected and accessible.

Request Body (POST)

{
  "action": "status",
  "projectRef": "abcdefghijklmnop"
}

Query Parameters (GET)

GET /api/seemodo-cloud?projectRef=abcdefghijklmnop

Success Response

{
  "activated": true,
  "project": {
    "ref": "abcdefghijklmnop",
    "name": "My Project",
    "status": "ACTIVE_HEALTHY",
    "region": "eu-central-1"
  }
}

Files Created in Sandbox

After activation, these files are created:

/src/lib/supabase.ts

import { createClient } from '@supabase/supabase-js';

const supabaseUrl = 'https://abcdefghijklmnop.supabase.co';
const supabaseAnonKey = 'eyJhbGciOiJIUzI1NiIs...';

export const supabase = createClient(supabaseUrl, supabaseAnonKey);

/AGENTS.md

Contains instructions for the AI about:
  • Using pnpm (not npm)
  • Supabase configuration details
  • MCP server usage examples
  • Best practices for database, auth, storage

/.opencode/opencode.json

Configures the Supabase MCP server for direct database access.

Using with AI

After activation, you can ask the AI to:
Create a users table with id, email, name, and created_at columns.
Add RLS policies so users can only read their own data.
Set up authentication with email/password and Google OAuth.
Create a storage bucket for user avatars with size limits.
The AI uses the MCP server to execute these directly on Supabase.

Error Responses

Invalid Token

{
  "message": "API token required"
}

Project Not Found

{
  "message": "Project not found or access denied"
}

Setup Failed

{
  "message": "Failed to set up Supabase in sandbox: Connection refused"
}

Flow Diagram