# Run agents with Supabase

Supabase AI agents on Rush: connect Supabase once, then name it on any run. The agent works in its own cloud computer, with a record of every run.

[Connect Supabase](https://cloud.getrush.ai/console/settings/?section=connections) in the console under Settings → Connections.

## What an agent can do in Supabase

Manage a Supabase project: run SQL queries, design and inspect database schemas and tables, manage branches and config.

## Jobs on Rush that use Supabase

- [Review a Supabase Database Schema](https://getrush.ai/run/database-schema-review/supabase/)
- [Find Slow Postgres Queries in a Supabase App](https://getrush.ai/run/investigate-slow-queries/supabase/)
- [Review Supabase Migrations in Every Pull Request](https://getrush.ai/run/review-database-migrations/supabase/)
- [Audit Row-Level Security in a Supabase Project](https://getrush.ai/run/row-level-security-audit/supabase/)

## Code changes on a Supabase codebase

These change the code of an app built on Supabase. They run on your repository in a Project and need no Supabase connection.

- [Add Account Deletion to a Supabase App from a Linear Issue](https://getrush.ai/run/add-account-deletion/supabase/)
- [Add an Audit Log of Row Changes to a Supabase Project](https://getrush.ai/run/add-audit-log/supabase/)
- [Schedule Database Jobs With pg_cron on Supabase](https://getrush.ai/run/add-cron-jobs/supabase/)
- [Add Missing Indexes to a Supabase Database](https://getrush.ai/run/add-database-indexes/supabase/)
- [Add a Postgres Trigger to a Supabase Project With a Migration](https://getrush.ai/run/add-database-triggers/supabase/)
- [Add a Database Webhook to a Supabase App](https://getrush.ai/run/add-database-webhooks/supabase/)
- [Add an Edge Function to a Supabase Project](https://getrush.ai/run/add-edge-function/supabase/)
- [Add Full-Text Search to a Supabase App](https://getrush.ai/run/add-full-text-search/supabase/)
- [Set Up GitHub Actions CI for a Supabase Project](https://getrush.ai/run/add-github-actions-ci/supabase/)
- [Add Magic Link Sign-In to a Supabase App](https://getrush.ai/run/add-magic-link-auth/supabase/)
- [Add a Password Policy to a Supabase App](https://getrush.ai/run/add-password-policy/supabase/)
- [Add Realtime Updates to a Supabase Todo List](https://getrush.ai/run/add-realtime-updates/supabase/)
- [Add Row Level Security Policies to a Supabase Project from a Linear Issue](https://getrush.ai/run/add-rls-policies/supabase/)
- [Write a Seed File for a Supabase Project](https://getrush.ai/run/add-seed-data/supabase/)
- [Add Soft Delete to a Supabase Table](https://getrush.ai/run/add-soft-delete/supabase/)
- [Add Vector Search to a Supabase App](https://getrush.ai/run/add-vector-search/supabase/)
- [Keep Supabase TypeScript Types in Sync With Your Migrations](https://getrush.ai/run/generate-database-types/supabase/)
- [Investigate Slow Vector Search in Supabase](https://getrush.ai/run/investigate-slow-vector-search/supabase/)
- [Write pgTAP Tests for a Supabase Database](https://getrush.ai/run/write-pgtap-tests/supabase/)

## How Supabase connects

Supabase is a remote MCP server, published by Supabase, at `https://mcp.supabase.com/mcp`. Connecting it signs in through the MCP OAuth flow on Supabase's side.

From Supabase: [Supabase's MCP documentation](https://supabase.com/docs/guides/getting-started/mcp) · [source code](https://github.com/supabase-community/supabase-mcp).

Connect it once in the console under Settings → Connections, or from your server with `POST /me/connections`. The sign-in finishes in a browser signed in to the console as the same person, and a link not finished within 10 minutes expires.

After that, a run that names `supabase` in `connections`, or runs a saved agent that names it, gets it; your connections reach no run that does not name them.

```http
POST https://api.phoenix.so/me/connections

{
  "type": "mcp",
  "name": "Supabase",
  "url": "https://mcp.supabase.com/mcp"
}
```

## Whose Supabase account the agent uses

Your Supabase connection is personal: it belongs to the person who signed in. A run started in the console uses that person's Supabase, and a run started with an API key uses the Supabase of the member who created the key.

To act for your own app's users, make each user an agent from your template and show them, signed in to your app, the sign-in link `POST /o/{org}/agents/{agent}/connections` returns. They sign in to their own Supabase, and that agent's runs use their account and nothing else: never yours, never another user's.

## More Database integrations

- [Neon](https://getrush.ai/integrations/neon/)
- [Prisma](https://getrush.ai/integrations/prisma/)
- [PlanetScale](https://getrush.ai/integrations/planetscale/)

## Frequently asked questions

### How do I connect Supabase to Rush?

Open Settings → Connections in the console and connect Supabase, or send `POST /me/connections` with `{"type":"mcp","name":"Supabase","url":"https://mcp.supabase.com/mcp"}` and open the `authorize_url` it returns while signed in to the console. The connection reads `pending` until the sign-in finishes, then `connected`.

### Does every run get my Supabase account?

No. A run gets your Supabase connection only when it names it in `connections` (`"connections": ["supabase"]`), or runs a saved agent that names it. A saved agent names its connections once, and every run of it gets them.

### What can an agent do in Supabase?

Manage a Supabase project: run SQL queries, design and inspect database schemas and tables, manage branches and config. 4 published jobs use it; this page lists them.

### Can my app's users connect their own Supabase?

Yes. Make each user an agent from your template, and they sign in to their own Supabase through the link `POST /o/{org}/agents/{agent}/connections` returns. That agent's runs use their account alone.

## Keep reading

- [AI agents for engineering teams: every job and app for them](https://getrush.ai/solutions/engineering/)
- [How connections work: sign in once, then every run that names a connection gets it](https://getrush.ai/docs/concepts/connections/)
- [Start your first run from the developer API quickstart](https://getrush.ai/docs/quickstart/)
- [Pricing: one price per member, hours shared by the team](https://getrush.ai/pricing/)
- [How Rush compares with other cloud agents](https://getrush.ai/compare/)
- [Every app and MCP server Rush connects to](https://getrush.ai/integrations/)
