Supabase MCP Server
The Supabase MCP Server enables interaction with Supabase databases through:
Query Tables: Execute queries with schema selection, column filtering, where clauses with operators (eq, neq, gt, etc.), and pagination
TypeScript Type Generation: Automatically generate TypeScript types for database schemas, supporting both public and custom schemas, local and remote projects
Integration: Works seamlessly with Claude Desktop and VSCode for streamlined usage
Error Handling: Built-in error handling ensures robust query execution and type generation
Enables querying Supabase database tables with filtering options and generating TypeScript types from database schemas
Generates TypeScript type definitions from Supabase database schemas for use in development
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Supabase MCP Servershow me the last 10 users from the public.users table"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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
Related MCP server: SchemaFlow MCP Server
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-serverInstall dependencies:
npm installInstall the Supabase CLI (required for type generation):
# Using npm
npm install -g supabase
# Or using Homebrew on macOS
brew install supabase/tap/supabaseConfiguration
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" > .envBuild the server:
npm run buildIntegration with Claude Desktop
Open Claude Desktop settings:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.jsonLinux:
~/.config/Claude/claude_desktop_config.json
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.jsonWindows:
%APPDATA%\Code\User\globalStorage\saoudrizwan.claude-dev\settings\cline_mcp_settings.jsonLinux:
~/.config/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json
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 --versionFor 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-featureCommit your changes:
git commit -am 'Add my feature'Push to the branch:
git push origin feature/my-featureSubmit a pull request
License
MIT License - see LICENSE file for details
Available Tools
2 toolsgenerate_typesB
Generate TypeScript types for your Supabase database schema
| Name | Required | Description | Default |
|---|---|---|---|
| schema | No | Database schema (optional, defaults to public) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries full burden for behavioral disclosure. It states what the tool does but doesn't describe how it works - whether it connects to a live database, reads from configuration files, requires authentication, has rate limits, or what format the output takes. The description is functional but lacks operational context.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, efficient sentence that communicates the core functionality without any wasted words. It's appropriately sized for a tool with one simple parameter and gets straight to the point.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a tool that presumably generates code/types from a database schema, the description is minimal. With no annotations and no output schema, it doesn't explain what the output looks like (TypeScript files? Inline code?), how errors are handled, or any dependencies or requirements. The description is functional but lacks important context for effective use.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
With 100% schema description coverage, the input schema already documents the single optional 'schema' parameter with its default value. The description doesn't add any parameter-specific information beyond what's in the schema, so it meets the baseline expectation but doesn't provide additional value.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the specific action ('Generate TypeScript types') and target resource ('your Supabase database schema'), providing a complete purpose statement. It distinguishes from the sibling tool 'query_table' which appears to be for data querying rather than schema type generation.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives, nor any context about prerequisites or constraints. While it's clear what the tool does, there's no information about appropriate use cases or limitations.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
query_tableC
Query a specific table with schema selection and where clause support
| Name | Required | Description | Default |
|---|---|---|---|
| schema | No | Database schema (optional, defaults to public) | |
| table | Yes | Name of the table to query | |
| select | No | Comma-separated list of columns to select (optional, defaults to *) | |
| where | No | Array of where conditions (optional) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries full burden for behavioral disclosure. It states the tool queries a table but doesn't mention whether this is read-only (likely but not confirmed), what permissions are required, whether it supports pagination/limits, error handling, or what the output format looks like. The description adds minimal behavioral context beyond the basic action.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, efficient sentence that communicates the core functionality without unnecessary words. It's appropriately sized for the tool's complexity and front-loads the main purpose immediately.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a database query tool with 4 parameters and no annotations or output schema, the description is insufficient. It doesn't address key contextual elements like: whether this is a safe read operation, what authentication/permissions are needed, how results are returned (format, size limits), error conditions, or relationship to the sibling tool. The 100% schema coverage helps with parameters but doesn't compensate for missing behavioral context.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the schema already documents all 4 parameters thoroughly. The description mentions 'schema selection and where clause support' which aligns with parameters in the schema but doesn't add meaningful semantic context beyond what's already in the parameter descriptions. Baseline 3 is appropriate when schema does the heavy lifting.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action ('Query') and resource ('a specific table'), with additional functionality mentioned ('schema selection and where clause support'). It distinguishes from the sibling 'generate_types' by focusing on data retrieval rather than type generation. However, it doesn't specify if this is a read-only query or might modify data.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance is provided on when to use this tool versus alternatives. The description mentions functionality but doesn't indicate scenarios where this tool is appropriate, prerequisites for use, or limitations compared to other query methods. The sibling tool 'generate_types' serves a completely different purpose, so no comparative guidance is needed.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
2 tool updates
v1.0.0- First observed
generate_types - First observed
query_table
TDQS
The two tools have clearly distinct purposes: generate_types focuses on TypeScript type generation from the database schema, while query_table handles data retrieval from specific tables with filtering. There is no overlap or ambiguity between these functions.
Both tools follow a consistent verb_noun naming pattern (generate_types and query_table), using snake_case throughout. The naming is predictable and readable without any deviations.
With only 2 tools, the server feels under-scoped for a Supabase integration, which typically involves operations like create, update, delete, and schema management beyond just querying and type generation. This limited set may hinder agent workflows.
The server lacks essential CRUD operations (e.g., insert, update, delete) and other Supabase features like authentication or real-time subscriptions, making it severely incomplete for typical database interactions. Agents will face significant gaps in functionality.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Your Supabase account in natural language: run SQL, apply migrations, manage tables, storage, edge f
Manage Supabase projects end to end across database, auth, storage, realtime, and migrations. Moni…
- SupabaseOAuthcom.supabase
MCP server for interacting with the Supabase platform
Query PostgreSQL databases in plain English — LLM-generated, safety-validated SQL.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceImplements the Model Context Protocol to provide LLMs with tools for interacting with Supabase databases, supporting operations like reading, creating, updating, and deleting records with filtering and pagination capabilities.-
- AlicenseNot gradedqualityFmaintenanceProvides AI-IDEs with real-time access to PostgreSQL and Supabase database schemas through the Model Context Protocol, enabling smarter code generation in tools like Cursor, Windsurf, and VS Code + Cline.9MIT
- FlicenseAqualityDmaintenanceA Model Context Protocol server that enables interaction with self-hosted Supabase instances, allowing developers to query database schemas, manage migrations, inspect statistics, and interact with Supabase features directly from MCP-compatible development environments.211-
- AlicenseNot gradedqualityDmaintenanceConnects AI assistants to Supabase projects to manage databases, execute SQL queries, and handle project configurations. It enables tasks like table management, edge function deployment, and log retrieval through the Model Context Protocol.Apache 2.0
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/NightTrek/Supabase-MCP'
If you have feedback or need assistance with the MCP directory API, please join our Discord server