How to Use SupaForge with AI Agents
Find and fix Supabase drift from Cursor, VS Code or Claude, with your approval for every change.
npm install -g @akal/supaforge. A hosted dashboard is on the way - to hear when it opens.Why an Agent?
“Why does this work on staging but not in production?” is a question an agent can now answer for itself. SupaForge runs as an MCP server: the agent compares your environments, reads exactly what differs - a missing policy, a grant, an auth setting - and proposes the SQL that fixes it. Nothing is written until you say so.
1. Give It a Project
The server reads supaforge.config.json in your project. If you don't have one, run supaforge init there, or write it with connection strings taken from the environment:
{
"environments": {
"staging": {
"dbUrl": "$STAGING_DATABASE_URL",
"projectRef": "STAGING_REF",
"accessToken": "$SUPABASE_ACCESS_TOKEN"
},
"production": {
"dbUrl": "$PRODUCTION_DATABASE_URL",
"projectRef": "PROD_REF",
"accessToken": "$SUPABASE_ACCESS_TOKEN"
}
},
"source": "staging",
"target": "production"
}2. Add the Server
Cursor
Add SupaForge to Cursor - one click, then approve it. It uses the folder you have open as the project.
VS Code
Install SupaForge in VS Code for Copilot's agent mode, again using the open folder.
Claude Desktop
Download supaforge-<version>-<platform>.mcpb for your machine from the latest release and open it. Claude asks for your project directory.
Claude Code
Install the plugin - the server, and a skill that teaches Claude to preview fixes and ask before applying them. In Claude Code, type these two commands: the first adds Akal's plugin catalogue to your Claude Code, the second installs SupaForge from it.
/plugin marketplace add akalsoftware/claude-plugins
/plugin install supaforge@akalsoftwareOr just the server:
claude mcp add supaforge -- npx -y @akal/supaforge mcpAny Other Client
{
"mcpServers": {
"supaforge": {
"command": "npx",
"args": ["-y", "@akal/supaforge", "mcp", "--project", "/path/to/project"]
}
}
}It is in the MCP Registry as io.github.akalsoftware/supaforge, so clients that browse the registry find it there.
3. Ask
- “What has drifted between staging and production?”
- “Are there tables in production without RLS?”
- “Show me the SQL to bring production's policies in line, but don't run it.”
- “Snapshot production before we change anything.”
What the Agent Can Do
list_environments,diffandget_check_result- read-only. They compare and report, and write nothing.diffalso returns the plan: the SQLsyncwould run, in order.sync- marked destructive, so your client asks before running it. It takes the same arguments asdiff, so the plan you approved is the plan that runs. Withproveit rehearses on a throwaway copy first and refuses to write if the copy would not match the source. Fixes that drop tables or columns are held back unless you ask for them.take_snapshotandcreate_migration- write local files only.create_migrationwrites the same file assupaforge migrate create, grants included.
Keeping It Safe
- Read the plan before approving. The fixes are plain SQL in the order they would run.
- Keep production credentials out of the agent's reach unless you mean it to act there: point the config at environment variables, and give production a read-only role for scans.
- One project per server. It reads the config in its own project and refuses another path unless started with
--allow-config-path, so a prompt cannot point it at a different project's credentials.
Ready to try SupaForge?
Install the CLI and run your first diff in a minute. Nothing is changed until you add --apply.
npm install -g @akal/supaforge