Supabase MCP Server
Supabase MCP サーバー
Supabaseデータベースとやり取りするためのモデルコンテキストプロトコル(MCP)サーバー。このサーバーは、MCPインターフェースを介してテーブルをクエリしたり、TypeScript型を生成したりするためのツールを提供します。
特徴
クエリ テーブル: 次のサポートを使用して任意のテーブルでクエリを実行します。
スキーマの選択
列フィルタリング
複数の演算子を含むWhere句
ページネーション
エラー処理
型生成: データベースの TypeScript 型を生成します。
あらゆるスキーマ (public、auth、api など) のサポート
ローカルとリモートの両方の Supabase プロジェクトで動作します
コンソールへの直接出力
自動プロジェクト参照検出
Related MCP server: SchemaFlow MCP Server
前提条件
Node.js (v16 以上)
Supabase プロジェクト (ローカルまたはホスト)
Supabase CLI (型生成用)
インストール
リポジトリをクローンします。
git clone https://github.com/yourusername/supabase-mcp-server.git
cd supabase-mcp-server依存関係をインストールします:
npm installSupabase CLI をインストールします (型生成に必要)。
# Using npm
npm install -g supabase
# Or using Homebrew on macOS
brew install supabase/tap/supabase構成
Supabase の資格情報を取得します。
ホストされたプロジェクトの場合:
Supabaseプロジェクトダッシュボードに移動します
プロジェクト設定 > API に移動します
プロジェクト URL と service_role キー (anon キーではありません) をコピーします。
ローカルプロジェクトの場合:
ローカルのSupabaseインスタンスを起動する
ローカル URL を使用します (通常はhttp://localhost:54321 )
ローカルのservice_roleキーを使用する
環境変数を設定します。
# Create a .env file (this will be ignored by git)
echo "SUPABASE_URL=your_project_url
SUPABASE_KEY=your_service_role_key" > .envサーバーを構築します。
npm run buildClaude Desktopとの統合
Claude デスクトップの設定を開きます。
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.jsonLinux:
~/.config/Claude/claude_desktop_config.json
サーバー構成を追加します。
{
"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拡張機能との統合
VSCode 設定を開きます。
macOS:
~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.jsonWindows:
%APPDATA%\Code\User\globalStorage\saoudrizwan.claude-dev\settings\cline_mcp_settings.jsonLinux:
~/.config/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json
サーバー構成を追加します (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)
トラブルシューティング
型生成の問題
Supabase CLI がインストールされていることを確認します。
supabase --versionローカルプロジェクトの場合:
ローカルのSupabaseインスタンスが実行中であることを確認してください
service_roleキーが正しいことを確認してください
ホストされたプロジェクトの場合:
プロジェクト参照が正しいことを確認してください(URL から抽出)
anonキーではなくservice_roleキーを使用していることを確認してください
クエリの問題
スキーマとテーブル名を確認してください
SELECT句とWHERE句の列名を確認する
service_role キーに必要な権限があることを確認してください
貢献
リポジトリをフォークする
機能ブランチを作成します:
git checkout -b feature/my-feature変更をコミットします:
git commit -am 'Add my feature'ブランチにプッシュする:
git push origin feature/my-featureプルリクエストを送信する
ライセンス
MITライセンス - 詳細はLICENSEファイルを参照
Available Tools
2 toolsgenerate_typesB
Generate TypeScript types for your Supabase database schema
Inputs: schema.
query_tableC
Query a specific table with schema selection and where clause support
Inputs: table (required), schema, select, where.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 2 tools
The two tools have clearly distinct purposes: generate_types focuses on TypeScript type generation from the database schema, while query_table handles data retrieval from specific tables with filtering. There is no overlap or ambiguity between these functions.
Both tools follow a consistent verb_noun naming pattern (generate_types and query_table), using snake_case throughout. The naming is predictable and readable without any deviations.
With only 2 tools, the server feels under-scoped for a Supabase integration, which typically involves operations like create, update, delete, and schema management beyond just querying and type generation. This limited set may hinder agent workflows.
The server lacks essential CRUD operations (e.g., insert, update, delete) and other Supabase features like authentication or real-time subscriptions, making it severely incomplete for typical database interactions. Agents will face significant gaps in functionality.
Maintenance
Related MCP Connectors
Your Supabase account in natural language: run SQL, apply migrations, manage tables, storage, edge f
Manage Supabase projects end to end across database, auth, storage, realtime, and migrations. Moni…
MCP server for interacting with the Supabase platform
Query Postgres, MySQL, SQL Server, Oracle, BigQuery, ClickHouse and Redshift from your AI client.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceImplements the Model Context Protocol to provide LLMs with tools for interacting with Supabase databases, supporting operations like reading, creating, updating, and deleting records with filtering and pagination capabilities.-
- AlicenseNot gradedqualityDmaintenanceProvides AI-IDEs with real-time access to PostgreSQL and Supabase database schemas through the Model Context Protocol, enabling smarter code generation in tools like Cursor, Windsurf, and VS Code + Cline.10MIT
- AlicenseAqualityDmaintenanceA Model Context Protocol server that enables interaction with self-hosted Supabase instances, allowing developers to query database schemas, manage migrations, inspect statistics, and interact with Supabase features directly from MCP-compatible development environments.211ISC
- AlicenseNot gradedqualityDmaintenanceConnects AI assistants to Supabase projects to manage databases, execute SQL queries, and handle project configurations. It enables tasks like table management, edge function deployment, and log retrieval through the Model Context Protocol.Apache 2.0