Supabase Database Interface
STDIOMCP server for interacting with Supabase databases and generating TypeScript types.
MCP server for interacting with Supabase databases and generating TypeScript types.
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.
Query Tables: Execute queries on any table with support for:
Type Generation: Generate TypeScript types for your database:
git clone https://github.com/yourusername/supabase-mcp-server.git cd supabase-mcp-server
npm install
# Using npm npm install -g supabase # Or using Homebrew on macOS brew install supabase/tap/supabase
Get your Supabase credentials:
For hosted projects:
For local projects:
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
npm run build
Open Claude Desktop settings:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.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" } } } }
Open VSCode settings:
~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json
%APPDATA%\Code\User\globalStorage\saoudrizwan.claude-dev\settings\cline_mcp_settings.json
~/.config/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json
Add the server configuration (same format as Claude Desktop).
// 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>
// 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>
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 againstGenerate TypeScript types for your Supabase database schema.
Parameters:
schema
(optional): Database schema (defaults to public)supabase --version
For local projects:
For hosted projects:
git checkout -b feature/my-feature
git commit -am 'Add my feature'
git push origin feature/my-feature
MIT License - see LICENSE file for details