←Back to Skill Directory

MCP Server

Database & AuthBackend-as-a-ServiceService Role Key Required

Supabase MCP Server

by Supabase · Official Model Context Protocol Server

Supabase MCP Server gives your AI coding assistant complete access to your Supabase project — the open-source Firebase alternative that combines a PostgreSQL database, built-in Auth, file Storage, and Realtime subscriptions in one platform. Agents can run SQL queries, read and write table data, manage auth users, and access Storage buckets through structured MCP tool calls.

Whether you need an agent to analyze your application database, manage user accounts, process uploaded files, or maintain data integrity across tables, Supabase MCP makes your entire backend stack available as agent capabilities. It's the MCP server for teams that build on Supabase and want agents that can do real backend work.

Full CRUD
Tables
read, create, update, delete
Built-in
Auth
user & session management
Buckets
Storage
file upload & retrieval
Supported
Realtime
live data subscriptions

Quick Install

claude mcp add supabase -- npx @supabase/mcp-server-supabase@latest --supabase-url $URL --supabase-service-role-key $KEY

Key Features

SQL Query Execution

Run arbitrary PostgreSQL queries against your Supabase database. Perform complex joins, aggregations, window functions, and CTEs that go beyond simple record-level operations. Agents can analyze data relationships, compute business metrics, inspect table structures, and debug data integrity issues using the full power of SQL.

Full CRUD Table Operations

Read, insert, update, and delete records in any Supabase table. Filter reads by any column, batch insert multiple records, update rows by ID or matching criteria, and delete records safely. The service role key ensures agents have unrestricted access regardless of RLS policies configured for your application users.

Auth User Management

List all auth users in your Supabase project, retrieve individual user profiles, look up users by email, and perform administrative operations like account creation, email confirmation, and user deletion. Ideal for support agents, admin dashboards, and workflows that need to manage user lifecycle programmatically.

Storage Bucket Access

List available Storage buckets, upload files to specific paths, retrieve file metadata and download URLs, and delete files from Storage. Agents can process user-uploaded files, generate processed outputs and store them back to Storage, and manage file lifecycle — move files between buckets, archive old assets, clean up temporary uploads.

Schema Inspection

Query the information schema to discover table structures, column types, constraints, indexes, and foreign key relationships. This lets agents understand your data model before constructing queries — useful for agents that need to work with unfamiliar databases or that adapt their behavior based on what tables and columns are available.

Official Supabase Support

The Supabase MCP server is maintained by the Supabase team, ensuring it stays up to date with API changes, new features, and best practices. Official support means reliable maintenance, clear documentation, and compatibility with the latest Supabase platform capabilities as they are released.

Execution Brief

Use this page as a rollout checklist, not just reference text.

Suggest update

Tool Mapping Lens

Organize Tools by Workflow Phase

Catalog-oriented pages work best when users can map discovery, evaluation, and rollout in a clear path instead of reading an undifferentiated list.

  • Define the job-to-be-done first
  • Group tools by stage
  • Prioritize by adoption friction

Actionable Utility Module

Skill Implementation Board

Use this board for Supabase MCP Server before rollout. Capture inputs, apply one decision rule, execute the checklist, and log outcome.

Input: Objective

Deliver one measurable improvement with supabase mcp server claude code database auth storage sql queries agent backend

Input: Baseline Window

20-30 minutes

Input: Fallback Window

8-12 minutes

Decision TriggerActionExpected Output
Input: one workflow objective and release owner are definedRun preview execution with fixed acceptance criteria.Go or hold decision backed by repeatable evidence.
Input: output quality below baseline or retries increaseLimit scope, isolate root issue, and rerun controlled test.One confirmed correction path before wider rollout.
Input: checks pass for two consecutive replay windowsPromote to broader traffic with fallback path active.Stable rollout with low operational surprise.

Execution Steps

  1. Record objective, owner, and stop condition.
  2. Execute one controlled preview run.
  3. Measure quality, latency, and correction burden.
  4. Promote only when pass criteria are stable.

Output Template

tool=supabase mcp server claude code database auth storage sql queries agent backend
objective=
preview_result=pass|fail
primary_metric=
next_step=rollout|patch|hold

What Is Supabase MCP Server?

Supabase MCP Server is an official Model Context Protocol integration that gives AI coding assistants complete access to a Supabase project. It exposes database queries, table CRUD operations, Auth user management, and Storage file operations as structured MCP tools that Claude Code or any compatible client can call during agent workflows.

Supabase is one of the most popular Backend-as-a-Service platforms for developers, combining a fully managed PostgreSQL database with built-in authentication, file storage, and realtime subscriptions. Teams building web and mobile applications on Supabase have their entire backend in one place — and the MCP server makes that entire backend accessible to AI agents.

Authentication uses the Supabase service role key, which has admin-level access to all project resources and bypasses Row Level Security policies. This makes it appropriate for backend agent workflows where the agent needs unrestricted data access, but it requires careful key management. The service role key should be treated like a database root password — stored securely in environment variables and never exposed in client-side code or version control.

Supabase MCP is particularly powerful for teams that use Supabase as their primary application backend, because agents can work with real production data in the same environment as the application. An agent can query the actual users table, inspect real orders, process genuine uploaded files, and make actual database changes — enabling automation workflows that operate on live application data rather than a separate data copy.

How to Calculate Better Results with supabase mcp server claude code database auth storage sql queries agent backend

Retrieve your Supabase project URL and service role key from your project settings in the Supabase dashboard at supabase.com — navigate to Settings > API. The project URL looks like https://your-project-id.supabase.co. Set both values as environment variables (SUPABASE_URL and SUPABASE_SERVICE_ROLE_KEY) before starting the MCP server.

Install the official Supabase MCP server using the npx command with your project URL and service role key passed as arguments. The server connects to your Supabase project immediately and makes all database, auth, and storage operations available as MCP tools.

Begin by asking the agent to list available tables and describe their schemas to understand your database structure. Then test a simple read query on a non-critical table before progressing to write operations. This familiarizes the agent with your specific data model and validates the connection.

For write-heavy workflows, consider running initial tests against a staging Supabase project before enabling the MCP server against production. Create a staging project that mirrors your production schema, run your agent workflows against it first, verify the behavior is correct, then switch the environment variables to point to your production project.

Treat this page as a decision map. Build a shortlist fast, then run a focused second pass for security, ownership, and operational fit.

When a team keeps one shared selection rubric, tool adoption speeds up because evaluators stop debating criteria every time a new option appears.

Worked Examples

Automated user account audit and cleanup

  1. The agent is tasked with identifying and handling inactive user accounts that have not logged in for more than 90 days
  2. The agent uses Supabase MCP to run a SQL query joining the auth.users table with your application's profiles table to find users with last_sign_in_at older than 90 days
  3. The agent queries the subscriptions table to identify which inactive users are on paid plans that should not be auto-deleted
  4. For free-tier inactive users, the agent generates a list of account IDs for review and writes a summary report to a reporting table in Supabase
  5. After reviewing the report, the agent sends re-engagement emails via Resend MCP to inactive free-tier users with a reactivation link
  6. For users who do not reactivate within the follow-up period, the agent updates their account status to "inactive" in the profiles table for downstream handling

Outcome: A systematic user account audit that identifies inactive accounts, excludes paying customers, attempts re-engagement, and flags truly dormant accounts — all operating directly on your Supabase Auth and application database.

File processing pipeline with Storage and database updates

  1. Users upload CSV files to a Supabase Storage bucket named "imports" through your application
  2. The agent monitors the imports bucket using Supabase MCP storage list operations to find newly uploaded files
  3. For each new file, the agent retrieves the file content from Storage and parses the CSV data
  4. The agent validates the data structure against the expected schema by querying the target table definition from the information schema
  5. Valid rows are batch-inserted into the target Supabase table using the CRUD insert operation with conflict handling for duplicate records
  6. The agent updates an import_jobs table with the processing result (rows processed, errors encountered, completion timestamp) and moves the processed file to a "processed" storage bucket path

Outcome: An end-to-end file import pipeline that monitors a Storage bucket, validates and processes uploads, inserts data into the database, and maintains a complete audit log of every import job.

Frequently Asked Questions

What is the Supabase MCP Server?

Supabase MCP Server is a Model Context Protocol integration that gives AI coding assistants complete access to a Supabase project — including its PostgreSQL database, built-in Auth system, and Storage buckets. It exposes SQL query execution, table CRUD operations, user management, and file operations as MCP tools that Claude Code or any compatible client can call. Supabase is an open-source Firebase alternative that provides a full backend stack, and the MCP server makes every part of that stack accessible to agents.

What Supabase features are accessible through the MCP server?

The Supabase MCP server provides access to four main areas: database operations (run SQL queries, read and write table data, manage schemas), Auth management (list users, look up user details, create and delete auth accounts), Storage operations (list buckets, upload and retrieve files, manage file metadata), and Realtime subscriptions in some implementations. The service role key used for authentication bypasses Row Level Security (RLS), giving agents unrestricted access — which is powerful but means access control must be managed carefully at the configuration level.

How do I authenticate with Supabase MCP?

The Supabase MCP server requires two environment variables: your project URL (SUPABASE_URL) and a service role key (SUPABASE_SERVICE_ROLE_KEY). Both are available in your Supabase project settings under Project API. The service role key has admin-level access and bypasses Row Level Security — never expose it in client-side code or public repositories. Keep it in environment variables and restrict access to the MCP server process itself. For read-only agent use cases, consider whether an anon key with appropriate RLS policies is sufficient instead.

Does Supabase MCP bypass Row Level Security (RLS)?

Yes. The service role key used by the Supabase MCP server bypasses RLS policies. This is by design — agents typically need unrestricted access to perform their work, and managing RLS policies for agent access adds significant complexity. However, this also means the MCP server has unrestricted read and write access to all data in your Supabase project. Protect the service role key carefully, limit which systems can start the MCP server, and consider whether a dedicated Supabase project for agent operations (separate from your user-facing project) is appropriate for your security model.

Can the agent run arbitrary SQL through Supabase MCP?

Yes. The Supabase MCP server exposes a SQL execution tool that lets agents run arbitrary PostgreSQL queries against your database. This is powerful for complex data analysis, aggregations, joins across multiple tables, and schema inspection — operations that are difficult or impossible through a simple record-level API. Use this capability thoughtfully: provide agents with clear instructions about which tables they should query, and consider whether agent-facing database roles with limited table access are appropriate for your production environment.

What are the most valuable use cases for Supabase MCP?

Supabase MCP is most valuable when agents need full backend access rather than just data reads. Key use cases include: user management agents that audit accounts, reset credentials, and manage roles; data analysis agents that run complex SQL queries across your application database for business intelligence; content management agents that read and write structured content stored in Supabase tables; file processing agents that retrieve files from Storage, process them, and write results back; and debugging agents that inspect database state, query logs, and user activity to diagnose application issues.

Missing a better tool match?

Send the exact workflow you are solving and we will prioritize a new comparison or rollout guide.