CS

coleam00/supabase-mcp

Developer tools

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

194 stars 96 forks 品質 62 トレンド 17MIT

coleam00/supabase-mcp は、https://github.com/coleam00/supabase-mcp. からインポートされたMCPサーバー候補です。

概要

coleam00/supabase-mcp は、https://github.com/coleam00/supabase-mcp. からインポートされたMCPサーバー候補です。

概要(AI 翻訳)

Supabaseデータベースとやり取りするためのツールを提供するモデルコンテキストプロトコル(MCP)サーバーです。このサーバーにより、AIアシスタントは標準化されたインターフェースを通じてデータベース操作を実行できます。

注:このSupabase MCPサーバーは、私のAI IDEコーディングワークフローのデモンストレーションとして作成されました。まだ開発途中ですが、今後チャンネルの動画で詳しく説明します。

特徴

  • テーブル行を読む:Supabaseテーブルからのクエリで、オプションのフィルタリング、ページ割り当て、列選択が可能です
  • テーブルレコードを作成:Supabaseテーブルに新しいレコードを挿入します
  • テーブルレコードの更新:Supabaseテーブル内の既存レコードをフィルターに基づいて変更する
  • テーブルレコードを削除:フィルターに基づいてSupabaseテーブルからレコードを削除します

前提条件

  • DockerまたはDocker Desktop(Docker Desktop)
  • Supabaseアカウントとプロジェクト

設置

  1. リポジトリのクローン:

Docker セットアップ

  1. Dockerイメージを構築する:

使用法

Docker を使ったMCPサーバーとして動作

Supabase MCPサーバーはモデルコンテキストプロトコルを用いてAIアシスタントと統合可能です。

  1. 以下の構成をMCPの設定(Claude Desktop、Windsurfなど)に含めてください。

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

README

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

Supabase MCP Server

A Model Context Protocol (MCP) server that provides tools for interacting with a Supabase database. This server enables AI assistants to perform database operations through a standardized interface.

NOTE: This Supabase MCP server was created as a demonstration of my AI IDE coding workflow. It is still a work in progress which I will expand on in future videos on my channel.

Features

  • Read Table Rows: Query data from Supabase tables with optional filtering, pagination, and column selection
  • Create Table Records: Insert new records into Supabase tables
  • Update Table Records: Modify existing records in Supabase tables based on filters
  • Delete Table Records: Remove records from Supabase tables based on filters

Prerequisites

  • Docker or Docker Desktop
  • Supabase account and project

Installation

  1. Clone the repository:
    git clone https://github.com/coleam00/supabase-mcp.git
    cd supabase-mcp
    

Docker Setup

  1. Build the Docker image:
    docker build -t mcp/supabase .
    

Usage

Running as an MCP Server with Docker

The Supabase MCP server can be integrated with AI assistants using the Model Context Protocol.

  1. Include the below configuration in your MCP config (in Claude Desktop, Windsurf, etc.)

Be sure to build the container with the installation steps first!

{
  "mcpServers": {
    "supabase": {
      "command": "docker",
      "args": ["run", "--rm", "-i", "-e", "SUPABASE_URL", "-e", "SUPABASE_SERVICE_KEY", "mcp/supabase"],
      "env": {
        "SUPABASE_URL": "YOUR-SUPABASE-URL",
        "SUPABASE_SERVICE_KEY": "YOUR-SUPABASE-SERVICE-ROLE-KEY"
      }
    }
  }
}
  1. Replace YOUR-SUPABASE-URL and YOUR-SUPABASE-SERVICE-ROLE-KEY with your actual Supabase credentials.

  2. The AI assistant can now access the Supabase database through the MCP server using the provided tools.

For more information on the Model Context Protocol, visit modelcontextprotocol.io.

Available Tools

Read Table Rows

read_table_rows(
    table_name: str,
    columns: Optional[List[str]] = None,
    filters: Optional[Dict[str, Any]] = None,
    limit: Optional[int] = None,
    offset: Optional[int] = None
)

Example:

# Read active users
read_table_rows(
    table_name="users",
    columns=["id", "name", "email"],
    filters={"is_active": True},
    limit=10,
    offset=0
)

Create Table Records

create_table_records(
    table_name: str,
    records: Union[Dict[str, Any], List[Dict[str, Any]]]
)

Example:

# Create a new user
create_table_records(
    table_name="users",
    records={
        "name": "John Doe",
        "email": "[email protected]",
        "is_active": True
    }
)

Update Table Records

update_table_records(
    table_name: str,
    updates: Dict[str, Any],
    filters: Dict[str, Any]
GitHub で README 全文を見る

インストール

docker run --rm -i -e SUPABASE_URL -e SUPABASE_SERVICE_KEY mcp/supabase
MCP 初心者?mcpskill.org のガイドから始めましょう →

設定

{ "mcpServers": { "supabase": { "command": "docker", "args": ["run", "--rm", "-i", "-e", "SUPABASE_URL", "-e", "SUPABASE_SERVICE_KEY", "mcp/supabase"], "env": { "SUPABASE_URL": "YOUR-SUPABASE-URL", "SUPABASE_SERVICE_KEY": "YOUR-SUPABASE-SERVICE-ROLE-KEY" } } } }