Supabase

A model context protocol implementation granting LLMs access to make database queries and learn about supabase types.
  • javascript

14

GitHub Stars

javascript

Language

6 months ago

First Indexed

2 months ago

Catalog Refreshed

Documentation & install

Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.

Installation

Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "nighttrek-supabase-mcp": {
      "command": "node",
      "args": [
        "/absolute/path/to/supabase-mcp-server/build/index.js"
      ],
      "env": {
        "SUPABASE_KEY": "your_service_role_key",
        "SUPABASE_URL": "your_project_url"
      }
    }
  }
}

You run an MCP server that lets you interact with a Supabase database through a unified interface. You can query tables with flexible schema selection and filtering, and you can generate TypeScript types directly from your database schema, enabling faster development and safer type-aware queries.

How to use

You use an MCP client to connect to the Supabase MCP Server and perform two core actions: querying table data and generating TypeScript types. When you run a query, you can specify the schema, table, which columns to return, and apply where-like filters. When you generate types, you can request TypeScript interfaces that mirror the chosen schema so your codebase stays in sync with your database.

How to install

Prerequisites you need before installing and running the server:

  • Node.js 16 or higher
  • A Supabase project (local or hosted)
  • Supabase CLI for type generation

Step 1: Install dependencies

npm install

Step 2: (Optional) Install the Supabase CLI for type generation

# Using npm
npm install -g supabase

# Or using Homebrew on macOS
brew install supabase/tap/supabase

Step 3: Build the server

npm run build

Step 4: Prepare credentials for your Supabase project. Create a .env file with your project URL and service role key, then start using the server configuration details shown in the configuration section.

Configuration and running

The server relies on environment variables to connect to your Supabase project. Set these values in a local environment file or your deployment environment.

SUPABASE_URL=your_project_url
SUPABASE_KEY=your_service_role_key

To run the server locally, you typically start the runtime with Node and point to the built entry file. The configuration example below shows how to launch the server with your credentials.

node /absolute/path/to/supabase-mcp-server/build/index.js

Notes on integration with clients

Two common integration targets are Claude Desktop and VSCode. You provide a server configuration that tells the client how to start the MCP server and what environment variables to supply. This lets the client send queries or request type generation against your Supabase instance.

Troubleshooting

If you run into issues generating types or querying data, verify your credentials and permissions. For local projects, ensure the local Supabase instance is running and the service_role key is correct. For hosted projects, confirm the project URL and service_role key are valid and that the project has the necessary access.

  • Check SUPABASE_URL and SUPABASE_KEY are correct
  • Ensure the target schema and table exist
  • Validate the where clause operators and column names
  • Confirm the server process has permission to access the database

Security considerations

Treat your service key with care. Avoid exposing SUPABASE_KEY in public client configurations. Use environment isolation in production and restrict access to the MCP server to trusted clients.

Examples of common actions

Query a table with a schema and a simple filter, then generate TypeScript types for the same schema to keep your types in sync with the database.

Available tools

query_table

Query a specific table with optional schema selection, column filtering, and where-like conditions supporting operators like eq, neq, gt, gte, lt, lte, like, ilike, is

generate_types

Generate TypeScript types for a given schema to reflect your database structure

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational