Supabase MCP Server
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
Integrations
Allows querying tables and generating TypeScript types for Supabase databases with support for schema selection, column filtering, where clauses, and pagination
Enables generating TypeScript types for Supabase database schemas, supporting both local and remote Supabase projects
Supabase MCP Server
A Model Context Protocol (MCP) server for interacting with Supabase databases. This server provides tools for querying tables and generating TypeScript types through the MCP interface.
Features
- Query Tables: Execute queries on any table with support for:
- Schema selection
- Column filtering
- Where clauses with multiple operators
- Pagination
- Error handling
- Type Generation: Generate TypeScript types for your database:
- Support for any schema (public, auth, api, etc.)
- Works with both local and remote Supabase projects
- Direct output to console
- Automatic project reference detection
Prerequisites
- Node.js (v16 or higher)
- A Supabase project (either local or hosted)
- Supabase CLI (for type generation)
Installation
- Clone the repository:
- Install dependencies:
- Install the Supabase CLI (required for type generation):
Configuration
- Get your Supabase credentials:
- For hosted projects:
- Go to your Supabase project dashboard
- Navigate to Project Settings > API
- Copy the Project URL and service_role key (NOT the anon key)
- For local projects:
- Start your local Supabase instance
- Use the local URL (typically http://localhost:54321)
- Use your local service_role key
- For hosted projects:
- Configure environment variables:
- Build the server:
Integration with Claude Desktop
- Open Claude Desktop settings:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json
- Windows:
%APPDATA%\Claude\claude_desktop_config.json
- Linux:
~/.config/Claude/claude_desktop_config.json
- macOS:
- Add the server configuration:
Integration with VSCode Extension
- Open VSCode settings:
- macOS:
~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json
- Windows:
%APPDATA%\Code\User\globalStorage\saoudrizwan.claude-dev\settings\cline_mcp_settings.json
- Linux:
~/.config/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json
- macOS:
- Add the server configuration (same format as Claude Desktop).
Usage Examples
Querying Tables
Generating Types
Available Tools
query_table
Query a specific table with schema selection and where clause support.
Parameters:
schema
(optional): Database schema (defaults to public)table
(required): Name of the table to queryselect
(optional): Comma-separated list of columnswhere
(optional): Array of conditions with:column
: Column nameoperator
: One of: eq, neq, gt, gte, lt, lte, like, ilike, isvalue
: Value to compare against
generate_types
Generate TypeScript types for your Supabase database schema.
Parameters:
schema
(optional): Database schema (defaults to public)
Troubleshooting
Type Generation Issues
- Ensure Supabase CLI is installed:
- For local projects:
- Make sure your local Supabase instance is running
- Verify your service_role key is correct
- For hosted projects:
- Confirm your project ref is correct (extracted from URL)
- Verify you're using the service_role key, not the anon key
Query Issues
- Check your schema and table names
- Verify column names in select and where clauses
- Ensure your service_role key has necessary permissions
Contributing
- Fork the repository
- Create your feature branch:
git checkout -b feature/my-feature
- Commit your changes:
git commit -am 'Add my feature'
- Push to the branch:
git push origin feature/my-feature
- Submit a pull request
License
MIT License - see LICENSE file for details
This server cannot be installed
Enables querying Supabase databases and generating TypeScript types through the Model Context Protocol (MCP) interface.
- Features
- Prerequisites
- Installation
- Configuration
- Integration with Claude Desktop
- Integration with VSCode Extension
- Usage Examples
- Available Tools
- Troubleshooting
- Contributing
- License