home / mcp / supabase mcp server

Supabase MCP Server

Provides MCP-based CRUD access to Supabase data with safety checks, type validation, and flexible querying.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "cloudmediaservices-supabase-mcp-server": {
      "command": "python",
      "args": [
        "src/server.py"
      ],
      "env": {
        "SUPABASE_URL": "https://your-project-id.supabase.co",
        "SUPABASE_SERVICE_ROLE_KEY": "your-service-role-key"
      }
    }
  }
}

You run a dedicated MCP server that lets AI assistants perform CRUD operations on your Supabase data with safety checks, type safety, and flexible querying. It supports reading, creating, updating, and deleting records across tables, with optional upsert, pagination, and filtering to empower intelligent workflows while protecting your data.

How to use

You connect an MCP client to the Supabase MCP Server and use its tools to perform data operations from your AI workflows. Start by running the local server, then configure your MCP client to point at the local process. You can issue read, create, update, and delete requests against any table in your Supabase project. Safety checks require confirmation for destructive actions, and youโ€™ll receive detailed responses and errors to guide you.

Key capabilities you can leverage include reading table rows with filtering, creating new records, updating existing records based on conditions, and deleting records with safeguards. You can also combine operations with upsert behavior to insert or update in a single step, and tailor queries with pagination, ordering, and column selection.

How to install

Prerequisites: You need Python 3.11 or higher and a Supabase project with a service role key.

1) Install Python dependencies for the server.

2) Run the MCP server locally.

3) Configure your MCP client to connect to the server and supply your Supabase credentials.

Configuration and usage notes

Environment variables you must provide locally include the URL of your Supabase instance and the service role key. These credentials enable the server to access your database with proper permissions.

The server exposes a single, local process that you run with Python. Use environment variables to supply your connection details, and keep your keys secure.

Security and testing

Safety checks guard destructive operations. Input validation and comprehensive error handling help you diagnose issues quickly. Use the test suite to verify CRUD paths and edge cases.

Troubleshooting

Common issues include missing environment variables, invalid Supabase credentials, or permission problems with the service role key. Double-check your .env values and ensure the service role has access to the targeted tables.

Tools and endpoints

The server provides a set of practical operations you can call from your MCP client to interact with Supabase data.

Available tools

Read Table Rows

Query data from a table with support for filtering, ordering, and pagination.

Create Table Records

Insert new records into a table with optional upsert behavior.

Update Table Records

Update existing records using specified conditions.

Delete Table Records

Delete records with safety checks and explicit confirmation when required.