Supabase-MCP
A model context protocol implementation granting LLMs access to make database queries and learn about supabase types.
Documentation
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
1. Node.js (v16 or higher)
2. A Supabase project (either local or hosted)
3. Supabase CLI (for type generation)
Installation
1. Clone the repository:
git clone https://github.com/yourusername/supabase-mcp-server.git
cd supabase-mcp-server2. Install dependencies:
npm install3. Install the Supabase CLI (required for type generation):
# Using npm
npm install -g supabase
# Or using Homebrew on macOS
brew install supabase/tap/supabaseConfiguration
1. Get your Supabase credentials:
1. Go to your Supabase project dashboard
2. Navigate to Project Settings > API
3. Copy the Project URL and service_role key (NOT the anon key)
1. Start your local Supabase instance
2. Use the local URL (typically http://localhost:54321)
3. Use your local service_role key
2. 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" > .env3. Build the server:
npm run buildIntegration with Claude Desktop
1. Open Claude Desktop settings:
2. 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
1. Open VSCode settings:
2. Add the server configuration (same format as Claude Desktop).
Usage Examples
Querying Tables
// Query with schema selection and where clause
supabase
query_table
{
"schema": "public",
"table": "users",
"select": "id,name,email",
"where": [
{
"column": "is_active",
"operator": "eq",
"value": true
}
]
}Generating Types
// Generate types for public schema
supabase
generate_types
{
"schema": "public"
}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 query
- `select` (optional): Comma-separated list of columns
- `where` (optional): Array of conditions with:
- `column`: Column name
- `operator`: One of: eq, neq, gt, gte, lt, lte, like, ilike, is
- `value`: 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
1. Ensure Supabase CLI is installed:
supabase --version2. For local projects:
3. For hosted projects:
Query Issues
1. Check your schema and table names
2. Verify column names in select and where clauses
3. Ensure your service_role key has necessary permissions
Contributing
1. Fork the repository
2. Create your feature branch: `git checkout -b feature/my-feature`
3. Commit your changes: `git commit -am 'Add my feature'`
4. Push to the branch: `git push origin feature/my-feature`
5. Submit a pull request
License
MIT License - see LICENSE file for details
Frequently asked questions
What is Supabase-MCP?
Supabase-MCP is A model context protocol implementation granting LLMs access to make database queries and learn about supabase types.
How do I install Supabase-MCP?
Open the GitHub repository and follow its README. Most MCP servers are added to your client's MCP config, then called by your agent.
Is Supabase-MCP open source?
Yes — it is hosted on GitHub at https://github.com/NightTrek/Supabase-MCP and has 14 stars.
Related MCP tools
🔥 Official Firecrawl MCP Server - Adds powerful web scraping and search to Cursor, Claude and any other LLM clients.
Use any LLMs (Large Language Models) for Deep Research. Support SSE API and MCP server.
Enhanced MCP server for interactive user feedback and command execution in AI-assisted development, featuring dual interface support (Web UI and Desktop Application) with intelligent environment detection and cross-platform compatibility.
A powerful Zotero AI and MCP plugin with ChatGPT, Gemini 3.7, Claude Fable 5, Claude Opus 5, DeepSeek V4, Grok, OpenRouter, Kimi k3, GLM 5.3, SiliconFlow, GPT-oss, Gemma 4, Qwen 3.8
Connect your browser to AI models. Just use Dia on Chrome, Arc or Firefox.
文颜 MCP Server 可以让 AI 自动将 Markdown 文章排版后发布至微信公众号。
Run your own MCP server? See who uses it and what to fix.
Measure it with TrackMCP