Supabase MCP Server

Supabase MCP Server

A Model Context Protocol server that enables AI tools to interact with Supabase databases, providing tools for reading, creating, updating, and deleting records in Supabase tables.

Category
Visit Server

README

Supabase MCP Server

A Model Context Protocol (MCP) server that enables AI tools to interact with Supabase databases. This server provides tools for reading, creating, updating, and deleting records in Supabase tables.

Features

  • Read rows from any Supabase table with filtering and column selection
  • Create single or multiple records in tables
  • Update records based on filter conditions
  • Delete records based on filter conditions
  • Comprehensive tool descriptions for AI model understanding
  • Type-safe request/response handling with Pydantic
  • Docker support for easy deployment

Prerequisites

  • Python 3.9+
  • Docker and Docker Compose
  • Supabase project with service role key
  • FastMCP-compatible AI IDE

Installation

  1. Clone the repository:
git clone https://github.com/yourusername/supabase-mcp.git
cd supabase-mcp
  1. Create a .env file with your Supabase credentials:
cp .env.example .env
# Edit .env with your Supabase credentials:
# SUPABASE_URL=your-project-url
# SUPABASE_KEY=your-service-role-key
  1. Build and start the container:
# Build and start in detached mode
docker-compose up --build -d

# To view logs
docker-compose logs -f

# To stop the container
docker-compose down

The server will be available at http://localhost:8000.

Docker Management Commands

# Start the container
docker-compose up

# Start in detached mode (background)
docker-compose up -d

# Stop the container
docker-compose down

# View logs
docker-compose logs -f

# Rebuild the container
docker-compose up --build

# Check container status
docker-compose ps

# Restart the container
docker-compose restart

Troubleshooting Docker Issues

  1. If the container fails to start:

    # Check logs
    docker-compose logs -f
    
    # Check container status
    docker-compose ps
    
    # Remove and rebuild
    docker-compose down
    docker-compose up --build
    
  2. If you get port conflicts:

    # Stop any existing containers using port 8000
    docker-compose down
    
    # Or modify the port in docker-compose.yml
    # ports:
    #   - "8000:8000"  # Change the first number to an available port
    
  3. If environment variables aren't loading:

    # Verify .env file exists and has correct values
    cat .env
    
    # Check environment variables in container
    docker-compose exec mcp-server env
    

Configuring MCP in Your AI IDE

General Configuration Steps

  1. Open your AI IDE's settings/preferences
  2. Navigate to the MCP or AI settings section
  3. Add a new MCP server with the following configuration:
{
  "name": "Supabase MCP",
  "command": "docker-compose",
  "args": ["up"],
  "cwd": "/path/to/supabase-mcp"
}

IDE-Specific Instructions

Cursor

  1. Open Settings (⌘, or Ctrl+,)
  2. Go to "AI" section
  3. Under "MCP Servers", click "Add Server"
  4. Use the configuration above
  5. Restart Cursor to apply changes

VS Code with AI Extensions

  1. Open Command Palette (⌘⇧P or Ctrl+Shift+P)
  2. Search for "MCP" or "AI Settings"
  3. Add new MCP server configuration
  4. Use the configuration above
  5. Reload VS Code window

JetBrains IDEs with AI Plugins

  1. Open Settings (⌘, or Ctrl+Alt+S)
  2. Navigate to "Tools" → "AI" → "MCP Servers"
  3. Click "+" to add new server
  4. Use the configuration above
  5. Restart IDE to apply changes

Verifying MCP Connection

  1. Check your IDE's status bar for MCP server status
  2. Look for a green indicator or "MCP Connected" message
  3. Try using AI features that require database access
  4. Check Docker logs for any connection issues:
    docker-compose logs -f
    

Usage

  1. Start the MCP server:
docker-compose up
  1. Configure your AI tool to use the MCP server:
{
  "mcpServers": {
    "supabase": {
      "command": "docker-compose",
      "args": ["up"]
    }
  }
}

Available Tools

read_rows

Read rows from a Supabase table with optional filtering and column selection.

Example usage:

{
  "table_name": "users",
  "columns": ["id", "name"],
  "filters": { "age": { "gt": 18 } },
  "limit": 10
}

create_records

Create one or more records in a Supabase table.

Example usage:

{
  "table_name": "users",
  "records": [
    { "name": "John", "age": 30 },
    { "name": "Jane", "age": 25 }
  ]
}

update_records

Update records in a Supabase table based on filter conditions.

Example usage:

{
  "table_name": "users",
  "filters": { "status": "inactive" },
  "updates": { "status": "active" }
}

delete_records

Delete records from a Supabase table based on filter conditions.

Example usage:

{
  "table_name": "users",
  "filters": { "id": 1 }
}

Security Considerations

  • Always use the service role key in a secure environment
  • Never expose the service role key in client-side code
  • Use appropriate row-level security policies in Supabase
  • Consider implementing rate limiting for production use

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Commit your changes
  4. Push to the branch
  5. Create a Pull Request

License

MIT

Recommended Servers

playwright-mcp

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.

Official
Featured
TypeScript
Magic Component Platform (MCP)

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.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured