# Supabase MCP for AI Agents AI Agent Connect

> Supabase MCP lets your AI client interact directly with your database. You can run queries, manage user accounts, and trigger PostgreSQL functions using plain English. It gives your agent full-privileged access to your backend infrastructure for faster debugging and data management.

## Overview
- **Category:** loved-by-devs
- **Price:** Free
- **Endpoint:** https://edge.vinkius.com/vk_preview_FP0ge4xEx4qBf4t9J73WhJFmRYGy102qt1vYxGMm/ai-agent-connect
- **Tags:** postgresql, backend-as-a-service, database-management, api-generation, row-level-security

## Description

This Supabase MCP lets you handle database operations without constantly switching tabs. Instead of manually writing SQL queries or hunting through the Supabase dashboard to find a specific user, you can just tell your agent what to do. It uses your service role key to act as a privileged admin, meaning it can run complex PL/pgSQL functions, audit your user roster, or check your storage buckets on the fly. This makes it way faster to debug your environment and iterate on your data because you stay in your terminal or IDE. You can find this connection along with thousands of others in the Vinkius catalog to keep your tools in sync. It handles the heavy lifting of the backend infrastructure so you can focus on building features instead of managing rows.

## Tools

### list_auth_users
List all authenticated users from Supabase Auth. Use this to see who has an account in your system.

### db_count
Count rows in a database table for pagination or analytics. This helps you get quick totals on your data.

### db_delete
Remove rows from a database table based on a mandatory match query. This helps you clear out old data quickly.

### db_insert
Add a new row to a database table by providing a JSON payload. This is perfect for populating your tables with mock data.

### db_rpc
Execute a Supabase Postgres Function with dynamic JSON arguments. This lets you run your own custom backend logic using natural language.

### db_select
Query records from any PostgreSQL database table using PostgREST syntax. This helps you pull specific data sets into your chat instantly.

### db_update
Modify existing rows in a database table using a match query. Use this to update specific records without writing manual SQL.

### list_storage_buckets
See all available storage containers in your project. This helps you audit your file architecture.

### delete_auth_user
Permanently remove an authenticated user from the system. Use this to clean up your user roster.

### create_storage_bucket
Create a new storage bucket with optional public access. This is great for setting up new asset folders.

### delete_storage_file
Delete specific files from a storage bucket using a path list. Use this to manage your storage space.

### get_auth_user
Retrieve detailed information for a specific authenticated user. This helps you debug account-specific issues.

### list_storage_files
View the files currently stored inside a specific bucket. Use this to check your storage contents.

## Prompt Examples

**Prompt:** 
```
Can you show me the last 5 users who signed up?
```

**Response:** 
```
Checking your Supabase Auth roster now...

| User ID | Email | Created At |
| :--- | :--- | :--- |
| user_882 | dev_test@example.com | 2026-07-14 10:00:00 |
| user_881 | admin_test@example.com | 2026-07-14 09:45:00 |
| user_880 | guest_user@example.com | 2026-07-14 09:30:00 |
| user_879 | beta_tester@example.com | 2026-07-14 09:15:00 |
| user_878 | early_adopter@example.com | 2026-07-14 09:00:00 |

Found 5 recent registrations.
```

**Prompt:** 
```
Run the restock function for product IDs 50 and 60.
```

**Response:** 
```
Executing the `restock_items` RPC with the requested IDs...

**Request Payload**:
- Target IDs: `[50, 60]`
- Function: `restock_items`

**Response**:
✅ Success. The inventory for products 50 and 60 has been updated in the database.
```

**Prompt:** 
```
Are there any buckets in my storage that are set to public?
```

**Response:** 
```
Scanning your storage buckets...

| Bucket Name | Public Access | 
| :--- | :--- | 
| profile_images | ✅ Public |
| internal_assets | ❌ Private |
| user_uploads | ❌ Private |

Only the `profile_images` bucket is currently set for unauthenticated public reads.
```

## Capabilities

### Query database records
Pull specific data sets into your chat using natural language.

### Insert new data rows
Add new records to your tables to populate your database.

### Update existing records
Modify specific rows in your database without writing manual SQL.

### Delete specific rows
Remove old or unnecessary data from your tables instantly.

### Execute custom PostgreSQL functions
Trigger complex backend logic using your pre-compiled RPCs.

### Manage storage buckets
Audit and organize your file architecture in your storage containers.

### Audit authenticated users
Fetch and manage your user roster from Supabase Auth.

## Use Cases

### Finding stuck accounts
A user can't log in, so you ask the agent to list all users. It uses list_auth_users to find the account and check its status.

### Restocking inventory
You need to update inventory. You ask the agent to run the restock function, and it uses db_rpc to update the values.

### Verifying storage
You want to make sure your images are uploaded. The agent uses list_storage_buckets to check the status of your files.

### Data cleanup
You need to remove old test data. The agent uses db_delete to wipe out the specific rows you identify.

## Benefits

- Pull data instantly using db_select to see records without writing manual SQL.
- Populate your tables with mock data using db_insert to speed up development.
- Trigger complex logic with db_rpc to run existing PostgreSQL functions.
- Audit your user base with list_auth_users to find and manage accounts.
- Organize your files using list_storage_buckets to see your entire storage map.
- Clear out old assets with delete_storage_file to keep your buckets clean.

## How It Works

The bottom line is you get a conversational interface for your entire Supabase backend.

1. Add the Supabase MCP to your AI client configuration.
2. Enter your SUPABASE_URL and SUPABASE_SERVICE_ROLE_KEY.
3. Ask your agent to perform database actions or check storage.

## Frequently Asked Questions

**How does the Supabase MCP help with database tasks?**
It lets you perform database actions like querying, inserting, and updating records using natural language. Instead of writing SQL, you just ask your agent to do it for you.

**Can I use the Supabase MCP to manage my users?**
Yes, you can audit your user roster, get details on specific accounts, or remove users from your system directly through your AI client.

**Is it safe to use the Supabase MCP for backend edits?**
It uses your service role key to perform actions, which gives it administrative access. It is designed for backend developers and DBAs who need to manage the infrastructure securely.

**Can the Supabase MCP help with my storage buckets?**
Yes, it can list all your buckets, show you the files inside them, and even create new buckets or delete specific files.

**How do I connect my Supabase backend to my AI client?**
You just need to add the Supabase MCP to your configuration and provide your Supabase URL and service role key. From there, your agent can start interacting with your data.

**What kind of queries can the Supabase MCP run?**
It can run any query that your Supabase backend supports, including standard row lookups, complex filters, and custom PostgreSQL functions via RPC.

**Why do I need to use the service role key instead of the safe public anon key?**
The Connector integration operates inherently as an administration module properly securely autonomously. Utilizing the `service_role` actively gracefully securely circumvents logical Row Level Security settings globally, empowering correct system manipulation properly dynamically successfully without error friction organically.

**Is there a safety measure preventing unintended whole table destructive deletions?**
Yes. Commands mutating or destroying rows, such as accurately calling `db_delete`, rigorously mandate explicit logical matching definitions (like exact ID tracking) seamlessly inherently systematically mitigating risk effectively fully locally organically efficiently properly.

**Can the AI call custom PostgreSQL functions (RPC)?**
Yes. Use `db_rpc` to invoke any server-side PL/pgSQL function by name, passing JSON arguments. This lets the AI trigger stored procedures, computed views, or custom business logic directly.