trackmcp
Back to directory
Quegenx

supabase-mcp-server

View on GitHub

Supabase MCP Server

12 stars TypeScriptOthers Updated Dec 18, 2025

Documentation

Supabase MCP Server ๐Ÿš€

TypeScript
Supabase
PostgreSQL
Node.js
MCP
Windsurf

> ๐Ÿ”ฅ A powerful Model Context Protocol (MCP) server that provides full administrative control over your Supabase PostgreSQL database through both Cursor's Composer and Codeium's Cascade. This tool enables seamless database management with comprehensive features for table operations, record management, schema modifications, and more.

๐Ÿ“š Table of Contents

๐Ÿ”ง Prerequisites

  • Node.js >= 16.x
  • npm >= 8.x
  • A Supabase project with:
    • Project ID
    • Database password
    • PostgreSQL connection string
  • Cursor IDE or Codeium's Cascade (for paying users)

๐Ÿš€ Quick Start

๐Ÿ“ฅ Installation

bash
# Clone the repository
git clone https://github.com/Quegenx/supabase-mcp-server.git
cd supabase-mcp-server

# Install dependencies
npm install

# Build the project
npm run build

โš™๏ธ Configuration

1. Install dependencies and build the project:

bash
npm install
   npm run build

2. In Cursor's MCP settings, add the server with this command:

bash
/opt/homebrew/bin/node /path/to/dist/index.js postgresql://postgres.[PROJECT-ID]:[PASSWORD]@aws-0-eu-central-1.pooler.supabase.com:5432/postgres

Replace:

    Note: Keep your database credentials secure and never commit them to version control.

    ๐ŸŽฏ Integrations

    Cursor MCP Integration

    The Model Context Protocol (MCP) allows you to provide custom tools to agentic LLMs in Cursor. This server can be integrated with Cursor's Composer feature, providing direct access to all database management tools through natural language commands.

    Setting up in Cursor

    1. Open Cursor Settings > Features > MCP

    2. Click the "+ Add New MCP Server" button

    3. Fill in the modal form:

      4. Build the project first:

      bash
      npm install
         npm run build

      5. Get your Node.js path:

      bash
      # On Mac/Linux
         which node
         # On Windows
         where node

      6. Add the server command:

      bash
      /path/to/node /path/to/dist/index.js postgresql://postgres.[PROJECT-ID]:[PASSWORD]@aws-0-eu-central-1.pooler.supabase.com:5432/postgres

      Replace:

        7. Click "Add Server" and then click the refresh button in the top right corner

        Using the Tools in Cursor

        The Composer Agent will automatically detect and use relevant tools when you describe your database tasks. For example:

        • "List all tables in my database"
        • "Create a new users table"
        • "Add an index to the email column"

        When the agent uses a tool, you'll see:

        1. A prompt to approve/deny the tool call

        2. The tool call arguments (expandable)

        3. The response after approval

        Note: For stdio servers like this one, the command should be a valid shell command. If you need environment variables, consider using a wrapper script.

        Windsurf/Cascade Integration

        This MCP server also supports Codeium's Cascade (Windsurf) integration. Note that this feature is currently only available for paying individual users (not available for Teams or Enterprise users).

        Setting up with Cascade

        1. Create or edit `~/.codeium/windsurf/mcp_config.json`:

        json
        {
             "mcpServers": {
               "supabase-mcp": {
                 "command": "/path/to/node",
                 "args": [
                   "/path/to/dist/index.js",
                   "postgresql://postgres.[PROJECT-ID]:[PASSWORD]@aws-0-eu-central-1.pooler.supabase.com:5432/postgres"
                 ]
               }
             }
           }

        2. Quick access to config:

          3. Replace in the configuration:

            4. In Cascade:

              Important Notes for Cascade Users

              • Only tools functionality is supported (no prompts or resources)
              • MCP tool calls will consume credits regardless of success or failure
              • Image output is not supported
              • Only stdio transport type is supported
              • Tool calls can invoke code written by arbitrary server implementers
              • Cascade does not assume liability for MCP tool call failures

              โœจ Features

              ๐ŸŽฏ Available Database Tools

              Table Management

              • Tables: `list_tables`, `create_table`, `drop_table`, `rename_table`
              • Columns: `add_column`, `drop_column`, `alter_column`
              • Records: `fetch_records`, `create_record`, `update_record`, `delete_record`

              Indexes & Constraints

              • Indexes: `list_indexes`, `create_index`, `delete_index`, `update_index`
              • Constraints: `list_constraints`, `add_constraint`, `remove_constraint`, `update_constraint`

              Database Functions & Triggers

              • Functions: `list_functions`, `create_function`, `update_function`, `delete_function`
              • Triggers: `list_triggers`, `create_trigger`, `update_trigger`, `delete_trigger`

              Security & Access Control

              • Policies: `list_policies`, `create_policy`, `update_policy`, `delete_policy`
              • Roles: `list_roles`, `create_role`, `update_role`, `delete_role`

              Storage Management

              • Buckets: `list_buckets`, `create_bucket`, `delete_bucket`
              • Files: `delete_file`, `bulk_delete_files`
              • Folders: `list_folders`

              Data Types & Publications

              • Enumerated Types: `list_enumerated_types`, `create_enumerated_type`, `update_enumerated_type`, `delete_enumerated_type`
              • Publications: `list_publications`, `create_publication`, `update_publication`, `delete_publication`

              Realtime Features

              • Policies: `list_realtime_policies`, `create_realtime_policy`, `update_realtime_policy`, `delete_realtime_policy`
              • Channels: `list_realtime_channels`, `manage_realtime_channels`, `send_realtime_message`, `get_realtime_messages`
              • Management: `manage_realtime_status`, `manage_realtime_views`

              User Management

              • Auth: `list_users`, `create_user`, `update_user`, `delete_user`

              Direct SQL Access

              • Query: `query` - Execute custom SQL queries

              ๐Ÿš€ Key Benefits

              • Natural Language Control: Manage your Supabase database through simple conversational commands
              • Comprehensive Coverage: Full suite of tools covering tables, records, indexes, functions, security, and more
              • Seamless Integration: Works directly within Cursor's Composer and Codeium's Cascade
              • Developer Friendly: Reduces context switching between IDE and database management tools
              • Secure Access: Maintains your database security with proper authentication

              ๐Ÿ“ Project Structure

              code
              supabase-mcp-server/
              โ”œโ”€โ”€ dist/                    # Compiled JavaScript files
              โ”‚   โ”œโ”€โ”€ index.d.ts          # TypeScript declarations
              โ”‚   โ””โ”€โ”€ index.js            # Main JavaScript file
              โ”œโ”€โ”€ src/                    # Source code
              โ”‚   โ””โ”€โ”€ index.ts           # Main TypeScript file
              โ”œโ”€โ”€ package.json           # Project configuration
              โ”œโ”€โ”€ package-lock.json      # Dependency lock file
              โ””โ”€โ”€ tsconfig.json         # TypeScript configuration

              ๐Ÿ’ก Usage

              Once configured, the MCP server provides all database management tools through Cursor's Composer. Simply describe what you want to do with your database, and the AI will use the appropriate commands.

              Examples:

              • ๐Ÿ“‹ "Show me all tables in my database"
              • โž• "Create a new users table with id, name, and email columns"
              • ๐Ÿ” "Add an index on the email column of the users table"

              ๐Ÿ”’ Security Notes

              • ๐Ÿ” Keep your database connection string secure
              • โš ๏ธ Never commit sensitive credentials to version control
              • ๐Ÿ‘ฎ Use appropriate access controls and permissions
              • ๐Ÿ›ก๏ธ Validate and sanitize all inputs to prevent SQL injection

              ๐Ÿ› ๏ธ Troubleshooting

              Common Connection Issues

              1. Node.js Path Issues

                2. File Path Issues

                  3. MCP Not Detecting Tools

                    4. Permission Issues

                      Debug Mode

                      Add `DEBUG=true` before your command to see detailed logs:

                      bash
                      DEBUG=true /usr/local/bin/node /path/to/dist/index.js [connection-string]

                      Platform-Specific Notes

                      Windows Users

                      bash
                      # Use this format for the command
                      "C:\\Program Files\\nodejs\\node.exe" "C:\\path\\to\\dist\\index.js" "postgresql://..."

                      Linux Users

                      bash
                      # Find Node.js path
                      which node
                      
                      # Make script executable
                      chmod +x /path/to/dist/index.js

                      If you're still experiencing issues, please open an issue with:

                      • Your operating system
                      • Node.js version (`node --version`)
                      • Full error message
                      • Steps to reproduce

                      ๐Ÿค Contributing

                      Contributions are welcome! Please feel free to submit a Pull Request.

                      ๐Ÿ“„ License


                      Frequently asked questions

                      What is supabase-mcp-server?

                      supabase-mcp-server is Supabase MCP Server

                      How do I install supabase-mcp-server?

                      Open the GitHub repository and follow its README. Most MCP servers are added to your client's MCP config, then called by your agent.

                      Is supabase-mcp-server open source?

                      Yes โ€” it is hosted on GitHub at https://github.com/Quegenx/supabase-mcp-server and has 12 stars.

                      Related MCP tools

                      Run your own MCP server? See who uses it and what to fix.

                      Measure it with TrackMCP