NS

nighttrek/supabase-mcp

Developer tools

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る

14 stars 7 forks 品質 60 トレンド 20

A model context protocol implementation granting LLMs access to make database queries and learn about supabase 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. - : Execute queries on any table with support for: - Schema selection - Column filtering - Where clauses with multiple operators - Pagination - Error handling - : 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 1. Node.js (v16 or higher) 2. A Supabase project (either local or hosted) 3. Supabase CLI (for type generation) 3. Install the Supabase CLI (required for type generation): 1. Get your Supabase credentials: - For hosted projects: 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) - For local projects: 1.

README

以下は原文 README の抜粋です。原文を見る。

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-server
  1. Install dependencies:
npm install
  1. Install the Supabase CLI (required for type generation):
# Using npm
npm install -g supabase

# Or using Homebrew on macOS
brew install supabase/tap/supabase

Configuration

  1. Get your Supabase credentials:

    • For hosted projects:

      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)
    • For local projects:

      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" > .env
  1. Build the server:
npm run build

Integration with Claude Desktop

  1. Open Claude Desktop settings:

    • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
    • Windows: %APPDATA%\Claude\claude_desktop_config.json
    • Linux: ~/.config/Claude/claude_desktop_config.json
  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:

    • macOS: ~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json
    • Windows: %APPDATA%\Code\User\globalStorage\saoudrizwan.claude-dev\settings\cline_mcp_settings.json
    • Linux: ~/.config/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json
  2. Add the server configuration (same format as Claude Desktop).

Usage Examples

Querying Tables

// Query with schema selection and where clause

supabase
GitHub で README 全文を見る

インストール

This server does not publish a one-line install command.

Open the repository installation guide MCP 初心者?mcpskill.org のガイドから始めましょう →

設定

{ "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" } } } }