Supabase MCP Server
Enables querying Supabase databases and generating TypeScript types through the Model Context Protocol interface, supporting features like schema selection, column filtering, and pagination.
NightTrek
Tools
query_table
Query a specific table with schema selection and where clause support
generate_types
Generate TypeScript types for your Supabase database schema
README
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:
git clone https://github.com/yourusername/supabase-mcp-server.git
cd supabase-mcp-server
- Install dependencies:
npm install
- Install the Supabase CLI (required for type generation):
# Using npm
npm install -g supabase
# Or using Homebrew on macOS
brew install supabase/tap/supabase
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
-
-
Configure environment variables:
# Create a .env file (this will be ignored by git)
echo "SUPABASE_URL=your_project_url
SUPABASE_KEY=your_service_role_key" > .env
- Build the server:
npm run build
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:
{
"mcpServers": {
"supabase": {
"command": "node",
"args": ["/absolute/path/to/supabase-mcp-server/build/index.js"],
"env": {
"SUPABASE_URL": "your_project_url",
"SUPABASE_KEY": "your_service_role_key"
}
}
}
}
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
// Query with schema selection and where clause
<use_mcp_tool>
<server_name>supabase</server_name>
<tool_name>query_table</tool_name>
<arguments>
{
"schema": "public",
"table": "users",
"select": "id,name,email",
"where": [
{
"column": "is_active",
"operator": "eq",
"value": true
}
]
}
</arguments>
</use_mcp_tool>
Generating Types
// Generate types for public schema
<use_mcp_tool>
<server_name>supabase</server_name>
<tool_name>generate_types</tool_name>
<arguments>
{
"schema": "public"
}
</arguments>
</use_mcp_tool>
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:
supabase --version
-
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
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
MCP Package Docs Server
Facilitates LLMs to efficiently access and fetch structured documentation for packages in Go, Python, and NPM, enhancing software development with multi-language support and performance optimization.
Claude Code MCP
An implementation of Claude Code as a Model Context Protocol server that enables using Claude's software engineering capabilities (code generation, editing, reviewing, and file operations) through the standardized MCP interface.
@kazuph/mcp-taskmanager
Model Context Protocol server for Task Management. This allows Claude Desktop (or any MCP client) to manage and execute tasks in a queue-based system.
Linear MCP Server
Enables interaction with Linear's API for managing issues, teams, and projects programmatically through the Model Context Protocol.

Supabase MCP Server
A Model Context Protocol (MCP) server that provides programmatic access to the Supabase Management API. This server allows AI models and other clients to manage Supabase projects and organizations through a standardized interface.
mermaid-mcp-server
A Model Context Protocol (MCP) server that converts Mermaid diagrams to PNG images.
Jira-Context-MCP
MCP server to provide Jira Tickets information to AI coding agents like Cursor
@kazuph/mcp-gmail-gas
Model Context Protocol server for Gmail integration. This allows Claude Desktop (or any MCP client) to interact with your Gmail account through Google Apps Script.