Supabase
MCP server for interacting with the Supabase platform
作者による説明(英語の原文)
Read-only SQL for PostgreSQL, MySQL and SQLite: schema, safe SELECTs, EXPLAIN, index advice
この3つを1つのスコアにまとめることはしません。意見、測定、人気はそれぞれ別のものだからです。
このサーバーのやさしい解説はまだ書いていません。以下はレジストリから読み取った事実です。
使っているAIアプリを選んで、設定をコピーしてください。
DATABASE_URL「秘密」と表示された値は、あなたのアカウントの鍵です。絶対に人に教えたり、チャットに貼り付けたりしないでください。
必要なもの
どのアプリを使っていますか?
上でアプリを選んでください。選んだアプリを覚えておくので、次からはボタンに「…にインストール」と表示されます。
Claude Desktop → Settings → Developer → Edit Config を開き、claude_desktop_config.json にこれを貼り付けます
{
"mcpServers": {
"db-explorer": {
"command": "uvx",
"args": [
"db-explorer-mcp-server"
],
"env": {
"DATABASE_URL": "your-value"
}
}
}
}ターミナルでこれを実行します
claude mcp add db-explorer --env DATABASE_URL=your-value -- uvx db-explorer-mcp-server動かす前に、空欄の値を入力してください。
プロジェクトの .cursor/mcp.json、または ~/.cursor/mcp.json に貼り付けます
{
"mcpServers": {
"db-explorer": {
"command": "uvx",
"args": [
"db-explorer-mcp-server"
],
"env": {
"DATABASE_URL": "your-value"
}
}
}
}ブラウザがアプリを開いてよいか確認し、そのあとアプリが設定を表示して確認を求めます。キーの値は空欄のままなので、自分で入力してください。
プロジェクトの .vscode/mcp.json に貼り付けます
{
"servers": {
"db-explorer": {
"type": "stdio",
"command": "uvx",
"args": [
"db-explorer-mcp-server"
],
"env": {
"DATABASE_URL": "your-value"
}
}
}
}ブラウザがアプリを開いてよいか確認し、そのあとアプリが設定を表示して確認を求めます。キーの値は空欄のままなので、自分で入力してください。
これはパソコンで動くサーバーですが、ChatGPTがつなげるのはインターネット上のサーバーだけです。ほかのアプリを選んでください。
選んだアプリは、この端末のCookieに保存されます。アカウントは不要です。
この設定は、作者のレジストリ登録情報から作成しています。READMEと違う場合は、READMEに従ってください。
パソコンで動くサーバーです。インストールすると、ツール一覧がAIアプリに表示されます。
誰でも見られる情報をチェックしており、コードは読んでいません。当てはまらない項目は数に入れていません。 · 2026年11月7日にチェック
レジストリ名は、リポジトリを所有するGitHubアカウント AYUSH-148 で確認済みです
このリポジトリはまだGitHubから読み取っていません
このリポジトリはまだGitHubから読み取っていません
これはパソコンで動くため、インターネット上のエンドポイントはありません
パソコンで動き、代わりにローカルの設定を使います
パソコンで動くサーバーです。ツール一覧を読み取れるのは、インターネット上のエンドポイントがある場合だけです
レジストリでこのカテゴリにある有効なすべてのサーバーと比較しています。スターは、公開者がリポジトリの所有者である場合だけ数えます。
当てはまる基本チェック1項目のうち1項目に合格しました。コードは読んでいません。キーやトークンを追加する前に、サーバーがどんなアクセスを求めているかを確認し、必要な権限だけを持つキーを使ってください。
入力が必要なもの:DATABASE_URL
あなたのパソコンで動きます。必要なときにAIアプリが起動し、データは作者のサーバーを通りません(サーバー自体がオンラインサービスを呼び出す場合を除きます)。
GitHubリポジトリの最終更新は–、最新バージョン(0.1.0)がレジストリに届いたのは17 日前です。
Claude Desktop、Claude Code、Cursor、VS CodeなどのMCP対応アプリで使えます。パソコンにPython (uv)も必要です。
同じカテゴリには:Supabase, MongoDB MCP Server, Elasticsearch MCP Server
同じカテゴリで、ほかの作者が作ったサーバー。スターの多い順。
カードの見方:★ GitHubスターi3つの柱:レビュー · チェック · 利用状況i更新=最新バージョンをレジストリに公開した日i
MCP server for interacting with the Supabase platform
MongoDB Model Context Protocol Server
MCP server for interacting with Elasticsearch
作者のリポジトリから書かれたとおりにコピーしたものです。PopNx MCPは内容を確認・推奨していません。HTML、画像、スクリプトは取り除いています。リンクはこのサイトの外へ移動します。
A read-only Model Context Protocol (MCP) server for PostgreSQL, MySQL, and SQLite that lets an AI coding assistant explore, query, and audit a relational database without ever being able to write to it.
Point your MCP client at a database and ask questions in plain language. The client's LLM writes the SQL; this server parses it, refuses anything that is not a single read-only SELECT, executes it with a row cap, and returns structured results. Schema inspection, execution plans, index recommendations, and migration review come along with it.
MCP client LLM -> FastMCP tools -> safety layer -> SQLAlchemy -> database
(writes SQL) (7 tools) (rejects writes) (any dialect)
The server makes no LLM API calls of its own, so there is no API key to configure — reasoning happens in whichever client you connect. Works with SQLite, PostgreSQL, and MySQL through SQLAlchemy.
Tested and evaluated. 336 tests run on every push and pull request, plus 26 more against real PostgreSQL and MySQL in CI (Tests). In an agent evaluation, Claude completed 14 of 14 realistic database tasks through these tools with no failed tool calls, an average of 2 calls per task, and a mean independent judge score of 4.6 / 5 (Agent evals).
Giving an assistant raw database credentials means one confused or prompt-injected turn can drop a table. Handing it a read-only replica loses schema context and plan analysis. This server takes the middle path: full introspection and query power, with mutation made structurally impossible at the parser level rather than by asking the model to behave.
┌──────────────────────────────────────────────────────────────┐
│ MCP client (Claude Code / Claude Desktop / Inspector) │ │ owns the LLM: reads schema, authors SQL, interprets results │ └───────────────────────────┬──────────────────────────────────┘ │ MCP · stdio (local) │ · streamable HTTP + bearer token (remote) ┌───────────────────────────▼──────────────────────────────────┐ │ server.py — FastMCP instance + one engine per token group │ │ │ │ explore_schema execute_query explain_query │ │ validate_schema suggest_index migration_context │ │ validate_migration │ └──────┬───────────────────────┬───────────────────┬───────────┘ │ │ │ │ read path │ metadata path │ review path │ │ │ ┌──────▼────────────┐ ┌───────▼─────────┐ ┌──────▼──────────┐ │ safety.py │ │ inspector.py │ │ migration.py │ │ ── trust boundary │ │ schema_health.py│ │ parses up/down, │ │ sqlparse AST │ │ index_suggest.py│ │ never executes │ │ SELECT-only │ │ explain.py │ │ │ │ 1 stmt · no cmnts │ │ │ │ │ │ denylist · LIMIT │ │ │ │ │ └──────┬────────────┘ └───────┬─────────┘ └─────────────────┘ │ │ └───────────┬───────────┘ │ SQLAlchemy Core ┌──────────────────▼───────────────────────────────────────────┐ │ Target database · PostgreSQL / MySQL / SQLite │ └──────────────────────────────────────────────────────────────┘
The SQL arriving at safety.py is written by the client's model and therefore untrusted, so it is parsed rather than pattern-matched, and a rejected query never reaches the database.
| Mode | Transport | Auth |
|---|---|---|
| Local | stdio | none needed; the client spawns the server |
| Remote | streamable HTTP | bearer tokens, or OAuth at the platform edge on Prefect Horizon |
Both modes run identical tool code — only MCP_TRANSPORT changes.
Requires Python 3.11+ and uv.
No clone needed. uvx downloads the package and runs it in its own environment:
claude mcp add db-explorer --env DATABASE_URL="postgresql+psycopg2://user:pass@localhost:5432/example" -- uvx db-explorer-mcp-server
Leave out --env to try it against the bundled demo database first. In any other client's config, use "command": "uvx" and "args": ["db-explorer-mcp-server"].
git clone https://github.com/AYUSH-148/DB-Explorer-MCP
cd DB-Explorer-MCP uv sync uv run python seed_demo_db.py # creates sample.db, a small shop with deliberate schema flaws uv run pytest # 336 tests on SQLite; 26 more with TEST_*_URL set
On Windows, if uv is not on PATH, prefix with py -m (py -m uv sync).
You don't start the server yourself: your MCP client launches it over stdio, so go on to Connect a client. Run by hand, uv run server.py prints nothing and waits for a client on stdin; stop it with Ctrl+C.
The default database is sample.db. Point at your own with DATABASE_URL, either in the client config below or in a .env file copied from .env.example:
postgresql+psycopg2://user:password@localhost:5432/example
mysql+pymysql://user:password@localhost:3306/example sqlite:///C:/data/example.db
Percent-encode special characters in passwords (@ → %40, # → %23, / → %2F).
claude mcp add db-explorer --env DATABASE_URL="postgresql+psycopg2://user:pass@localhost:5432/example" -- uv --directory "C:/path/to/DB-Explorer-MCP" run server.py
Then run /mcp in a session to confirm the 7 tools are listed. Add -s user to make it available in every project.
claude mcp add --transport http db-explorer https://your-deployment.fastmcp.app/mcp
Run /mcp → Authenticate for the OAuth flow; tokens are cached and refreshed automatically.
For a server you host yourself with a bearer token, send it as a header. Read it from an environment variable, so a .mcp.json committed for the team holds no secret:
{
"mcpServers": { "db-explorer": { "type": "http", "url": "https://dbx.example.com/mcp", "headers": { "Authorization": "Bearer ${DBX_TOKEN}" } } } }
Local, in claude_desktop_config.json:
{
"mcpServers": { "db-explorer": { "command": "uv", "args": ["--directory", "C:/path/to/DB-Explorer-MCP", "run", "server.py"], "env": { "DATABASE_URL": "postgresql+psycopg2://user:pass@localhost:5432/example" } } } }
To reach a remote deployment without a custom connector, proxy it over stdio:
{
"mcpServers": { "db-explorer": { "command": "npx", "args": ["-y", "mcp-remote", "https://your-deployment.fastmcp.app/mcp"] } } }
.vscode/mcp.json is checked in and starts the server over stdio through the Windows py launcher. On macOS or Linux, change its command to uv and its args to ["run", "server.py"].
npx @modelcontextprotocol/inspector
Use transport Streamable HTTP with your /mcp URL, or stdio with uv run server.py. The Inspector shows raw tool responses and unparaphrased errors, which makes it the fastest way to tell a server problem from a client problem.
import asyncio
from fastmcp import Client
async def main(): async with Client("https://your-deployment.fastmcp.app/mcp", auth="oauth") as client: print([tool.name for tool in await client.list_tools()]) print(await client.call_tool("explore_schema", {}))
asyncio.run(main())
Once connected to the demo sample.db from Quickstart, prompts like these work directly:
orders with the highest total."*SELECT * FROM orders WHERE created_at >= '2026-01-01'"*CREATE INDEX statements."*shipped_at column to orders, then validate the up and down scripts."*To watch the guardrails work, ask it to run DELETE FROM users. The call fails with Unsafe query blocked: Only SELECT queries are allowed. Got: DELETE and the database is untouched.
skill/db-explorer/SKILL.md is an optional agent skill that teaches the model to use these tools well: read the schema once before querying, compute totals in SQL rather than from returned rows, say when a result is truncated, and follow error hints instead of retrying. It guides the model only; the server must still be connected.
For Claude Code, copy the skill/db-explorer folder to ~/.claude/skills/db-explorer/ for every project, or to .claude/skills/db-explorer/ inside one project.
| Tool | Arguments | Returns |
|---|---|---|
explore_schema | table_name?, include_sample_data=false, name_pattern?, detail=false, limit=200, offset=0 | The dialect to write SQL in, plus a listing of tables and views (each with a kind and column count), or one relation's kind, columns, PK, FKs, indexes, row count (tables only), and up to 3 sample rows. One relation, or a page with detail=true, also carries any table and column comment the database stores |
execute_query | sql, row_limit=100 (max 1000) | columns, rows, count, truncated, and the effective row_limit for one validated SELECT; plus duplicate_columns and a note when a result repeats a column name (the repeats are labelled id:1, which is not valid SQL), and a note when rows were cut to stay under the size budget |
explain_query | sql | Native execution plan plus the resolved dialect |
validate_schema | table_name?, name_pattern?, limit=200, offset=0 | Schema issues with severity, code, message, suggestion; without table_name, one page of tables (views skipped), paged like explore_schema |
suggest_index | query? xor table_name? | CREATE INDEX recommendations with reasons |
migration_context | name_pattern?, limit=200, offset=0 | Dialect plus one page of columns, keys, and indexes (no row counts), for client-side migration drafting; pages like explore_schema |
validate_migration | up_sql, down_sql | Parsed statement types per script; rejects SELECT, comments and unbalanced parentheses. Not a syntax check, and never executed |
validate_schema reports four codes: missing_primary_key, unindexed_foreign_key, wide_table (50+ columns), and no_indexes. A foreign key counts as indexed when any index, the primary key, or a unique constraint starts with its columns; partial, GIN/GiST/BRIN and FULLTEXT/SPATIAL indexes do not count.
explore_schema is cheap by default: with no arguments it returns table names and column counts. Row counts arrive only with table_name (tables only, capped at 100,000 with row_count_capped: true). Narrow a large schema with name_pattern (order matches any name containing it, order_* is a glob), page with limit/offset, and use detail=true for the colu
冒頭だけを表示しています。続きはリポジトリで読めます