Skip to main content
Glama

Supabase MCP Server

by NightTrek

Supabase MCP サーバー

Supabaseデータベースとやり取りするためのモデルコンテキストプロトコル(MCP)サーバー。このサーバーは、MCPインターフェースを介してテーブルをクエリしたり、TypeScript型を生成したりするためのツールを提供します。

特徴

  • クエリ テーブル: 次のサポートを使用して任意のテーブルでクエリを実行します。
    • スキーマの選択
    • 列フィルタリング
    • 複数の演算子を含むWhere句
    • ページネーション
    • エラー処理
  • 型生成: データベースの TypeScript 型を生成します。
    • あらゆるスキーマ (public、auth、api など) のサポート
    • ローカルとリモートの両方の Supabase プロジェクトで動作します
    • コンソールへの直接出力
    • 自動プロジェクト参照検出

前提条件

  1. Node.js (v16 以上)
  2. Supabase プロジェクト (ローカルまたはホスト)
  3. Supabase CLI (型生成用)

インストール

  1. リポジトリをクローンします。
git clone https://github.com/yourusername/supabase-mcp-server.git cd supabase-mcp-server
  1. 依存関係をインストールします:
npm install
  1. Supabase CLI をインストールします (型生成に必要)。
# Using npm npm install -g supabase # Or using Homebrew on macOS brew install supabase/tap/supabase

構成

  1. Supabase の資格情報を取得します。
    • ホストされたプロジェクトの場合:
      1. Supabaseプロジェクトダッシュボードに移動します
      2. プロジェクト設定 > API に移動します
      3. プロジェクト URL と service_role キー (anon キーではありません) をコピーします。
    • ローカルプロジェクトの場合:
      1. ローカルのSupabaseインスタンスを起動する
      2. ローカル URL を使用します (通常はhttp://localhost:54321 )
      3. ローカルのservice_roleキーを使用する
  2. 環境変数を設定します。
# Create a .env file (this will be ignored by git) echo "SUPABASE_URL=your_project_url SUPABASE_KEY=your_service_role_key" > .env
  1. サーバーを構築します。
npm run build

Claude Desktopとの統合

  1. Claude デスクトップの設定を開きます。
    • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
    • Windows: %APPDATA%\Claude\claude_desktop_config.json
    • Linux: ~/.config/Claude/claude_desktop_config.json
  2. サーバー構成を追加します。
{ "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" } } } }

VSCode拡張機能との統合

  1. VSCode 設定を開きます。
    • 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. サーバー構成を追加します (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>

利用可能なツール

クエリテーブル

スキーマ選択と where 句のサポートを使用して特定のテーブルをクエリします。

パラメータ:

  • schema (オプション): データベーススキーマ (デフォルトは public)
  • table (必須): クエリするテーブルの名前
  • select (オプション): カンマ区切りの列リスト
  • where (オプション): 次の条件の配列:
    • column : 列名
    • operator : eq、neq、gt、gte、lt、lte、like、ilike、is のいずれか
    • value : 比較する値

生成型

Supabase データベース スキーマの TypeScript 型を生成します。

パラメータ:

  • schema (オプション): データベーススキーマ (デフォルトは public)

トラブルシューティング

型生成の問題

  1. Supabase CLI がインストールされていることを確認します。
supabase --version
  1. ローカルプロジェクトの場合:
    • ローカルのSupabaseインスタンスが実行中であることを確認してください
    • service_roleキーが正しいことを確認してください
  2. ホストされたプロジェクトの場合:
    • プロジェクト参照が正しいことを確認してください(URL から抽出)
    • anonキーではなくservice_roleキーを使用していることを確認してください

クエリの問題

  1. スキーマとテーブル名を確認してください
  2. SELECT句とWHERE句の列名を確認する
  3. service_role キーに必要な権限があることを確認してください

貢献

  1. リポジトリをフォークする
  2. 機能ブランチを作成します: git checkout -b feature/my-feature
  3. 変更をコミットします: git commit -am 'Add my feature'
  4. ブランチにプッシュする: git push origin feature/my-feature
  5. プルリクエストを送信する

ライセンス

MITライセンス - 詳細はLICENSEファイルを参照

You must be authenticated.

A
security – no known vulnerabilities
F
license - not found
A
quality - confirmed to work

hybrid server

The server is able to function both locally and remotely, depending on the configuration or use case.

Supabase データベースのクエリと、Model Context Protocol インターフェースを介した TypeScript 型の生成を可能にし、スキーマ選択、列フィルタリング、ページ区切りなどの機能をサポートします。

  1. 特徴
    1. 前提条件
      1. インストール
        1. 構成
          1. Claude Desktopとの統合
            1. VSCode拡張機能との統合
              1. 使用例
                1. テーブルのクエリ
                2. 型の生成
              2. 利用可能なツール
                1. クエリテーブル
                2. 生成型
              3. トラブルシューティング
                1. 型生成の問題
                2. クエリの問題
              4. 貢献
                1. ライセンス

                  Related MCP Servers

                  • A
                    security
                    A
                    license
                    A
                    quality
                    A TypeScript-based server to interact with ArangoDB using the Model Context Protocol, enabling database operations and integration with tools like Claude and VSCode extensions for streamlined data management.
                    Last updated -
                    7
                    85
                    18
                    TypeScript
                    MIT License
                    • Apple
                  • A
                    security
                    F
                    license
                    A
                    quality
                    A TypeScript-based template for developing Model Context Protocol servers with features like dependency injection and service-based architecture, facilitating the creation and integration of custom data processing tools.
                    Last updated -
                    1
                    2
                    TypeScript
                  • -
                    security
                    F
                    license
                    -
                    quality
                    A Model Context Protocol server that enables querying feature suggestions from a Supabase database, allowing AI tools like Cursor and Claude to access and display feature request data.
                    Last updated -
                    TypeScript
                  • -
                    security
                    F
                    license
                    -
                    quality
                    A TypeScript template for creating Model Context Protocol servers that enable AI models to utilize external tools, including example operations and simple number addition functionality.
                    Last updated -
                    2
                    TypeScript

                  View all related MCP servers

                  MCP directory API

                  We provide all the information about MCP servers via our MCP API.

                  curl -X GET 'https://glama.ai/api/mcp/v1/servers/NightTrek/Supabase-MCP'

                  If you have feedback or need assistance with the MCP directory API, please join our Discord server