mcp-server-supabase

walshe/mcp-server-supabase

3.1

If you are the rightful owner of mcp-server-supabase and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

This project demonstrates the integration of the Model Context Protocol (MCP) with a Supabase backend, providing a local development environment for MCP, Supabase, and Postgres.

mcp-server-supabase Example

This project demonstrates how to use the Model Context Protocol (MCP) with a Supabase backend. It provides a local development environment for experimenting with MCP, Supabase, and Postgres.

Features

  • Local Supabase stack (Postgres, Auth, Storage, Studio, etc.)
  • Example schema and seed data for users, teams, and posts
  • MCP server configuration for direct database access
  • Ready-to-use with Cursor or any MCP-compatible client

Getting Started

Prerequisites

  • Docker (for running Supabase locally)
  • Supabase CLI (brew install supabase/tap/supabase)
  • Node.js (for MCP server via npx)
  • Cursor (optional, for conversational database access)

Setup

  1. Clone the repository:

    git clone https://github.com/walshe/mcp-server-supabase.git
    cd mcp-server-supabase
    
  2. Start Supabase locally:

    supabase start
    
  3. Apply migrations and seed data:

    supabase db reset
    
  4. Configure MCP server:

    • The .cursor/mcp.json file is pre-configured to use the Postgres MCP server:
      {
        "mcpServers": {
          "supabase": {
            "command": "npx",
            "args": [
              "-y",
              "@modelcontextprotocol/server-postgres",
              "postgresql://postgres:postgres@127.0.0.1:54322/postgres"
            ]
          }
        }
      }
      
  5. Connect with Cursor:

    • Open Cursor and ensure the MCP tool is green (connected).
    • You can now use conversational commands like:
      how many users are in my users table?
      

Example Schema

  • public.users: User profiles
  • public.teams: Teams
  • public.team_members: Team membership
  • public.posts: Posts

Seed data is provided in supabase/seed.sql.

Troubleshooting

  • If the MCP tool in Cursor is yellow or red, check your Supabase instance and .cursor/mcp.json configuration.
  • Make sure Docker is running and ports are not in use by other services.

License

MIT