home / mcp / supabase mcp server
Provides database, storage, auth, and edge-function actions for Supabase via MCP
Configuration
View docs{
"mcpServers": {
"dynamicendpoints-supabase-mcp": {
"command": "node",
"args": [
"path/to/supabase-server/build/index.js"
],
"env": {
"SUPABASE_KEY": "your_service_role_key",
"SUPABASE_URL": "your_project_url",
"SUPABASE_ACCESS_TOKEN": "your_access_token"
}
}
}
}You can use the Supabase MCP Server to interact with your Supabase project through MCP-compatible clients. It exposes database operations, storage management, edge function invocation, and user/role management, enabling you to build applications that drive your Supabase services with a consistent MCP interface.
With an MCP client, connect to the Supabase MCP Server to perform common data and storage operations, invoke edge functions, and manage users and roles. You will interact through the MCP layer, which translates your requests into Supabase API calls and returns structured results or errors.
# Prerequisites
- Node.js 16.x or higher
- Git
# Optional: install via Smithery for Claude Desktop automation
npx -y @smithery/cli install supabase-server --client claude
# Clone the MCP server repository
git clone https://github.com/DynamicEndpoints/supabase-mcp.git
cd supabase-mcp
# Install dependencies
npm install
# Create environment configuration
cp .env.example .env
# Configure environment variables (fill in your values)
# SUPABASE_URL=your_project_url_here
# SUPABASE_KEY=your_service_role_key_here
# SUPABASE_ACCESS_TOKEN=your_access_token_here
# Create server configuration
cp config.json.example config.json
# Build the server (if you will run as a standalone process)
npm run build
# Start the server (example, if you use the built output)
node dist/index.jsThe server can be configured using environment variables and a separate configuration file. You can tune database connections, storage limits, logging, security, and monitoring to fit your deployment. When running, you can point your MCP client to the local server or to a remote endpoint once exposed.
{
"server": {
"name": "supabase-server",
"version": "0.1.0",
"port": 3000,
"host": "localhost"
}
}{
"security": {
"cors": {
"enabled": true,
"origins": ["*"],
"methods": ["GET", "POST", "PUT", "DELETE", "OPTIONS"],
"allowedHeaders": ["Content-Type", "Authorization"]
},
"rateLimit": {
"enabled": true,
"windowMs": 900000,
"max": 100
}
}
}{
"mcpServers": {
"supabase": {
"command": "node",
"args": ["path/to/supabase-server/build/index.js"],
"env": {
"SUPABASE_URL": "your_project_url",
"SUPABASE_KEY": "your_service_role_key",
"SUPABASE_ACCESS_TOKEN": "your_access_token"
},
"config": "path/to/config.json"
}
}
}The server exposes a comprehensive set of capabilities to manage data, storage, functions, and users through MCP endpoints. Key operations include creating, reading, updating, and deleting records; uploading and downloading storage files; invoking edge functions; and managing users and their roles.
If you encounter authentication or permission errors, verify that your Supabase credentials and access tokens are correctly configured in the environment variables. Check network access, CORS settings, and that the MCP server process has the necessary permissions to reach your Supabase project.
Keep your server dependencies up to date and monitor the logs for any errors or slow queries. Adjust the database timeout, max connections, and storage limits to balance performance and resource usage in your deployment.
Create a new record in a table with optional returning fields to fetch specific columns after insertion.
Read records with advanced filtering, joins, and field selection to shape the result set.
Update records with filtering and optional returning fields to retrieve updated values.
Delete records with filtering and optional returning fields to retrieve deleted identifiers.
Upload files to Storage with configurable bucket, path, and options like content type and upsert behavior.
Download files from Storage by bucket and path.
Invoke Supabase Edge Functions with parameters and optional headers and response type.
List users with optional pagination to manage a user base.
Create a new user with optional metadata.
Update user details and metadata.
Delete a user by identifier.
Assign a role to a user to grant permissions.
Remove a role from a user to revoke permissions.