Supabase
MCP server for interacting with the Supabase platform
作者提供的说明(英文原文)
Drop-in replacement for @modelcontextprotocol/server-postgres that is actually read-only.
这三项永远不会合并成一个分数:意见、测量和人气是不同的东西。
我们还没有为它写通俗的介绍。下面是我们从注册中心读取到的事实。
选择你使用的 AI 应用,然后复制设置。
你需要
你用的是哪个应用?
在上方选择你的应用。我们会记住它,下次按钮会显示“安装到 …”。
打开 Claude Desktop → Settings → Developer → Edit Config,把下面的内容粘贴到 claude_desktop_config.json
{
"mcpServers": {
"postgres-safe": {
"command": "npx",
"args": [
"-y",
"postgres-mcp-safe"
]
}
}
}在终端中运行这条命令
claude mcp add postgres-safe -- npx -y postgres-mcp-safe这个服务器需要在启动命令中填入值,请复制设置后自行填写。
粘贴到项目中的 .cursor/mcp.json,或 ~/.cursor/mcp.json
{
"mcpServers": {
"postgres-safe": {
"command": "npx",
"args": [
"-y",
"postgres-mcp-safe"
]
}
}
}浏览器会先询问是否打开应用,然后应用会显示设置并请你确认。密钥的值会留空,由你自己填写。
这个服务器需要在启动命令中填入值,请复制设置后自行填写。
粘贴到项目中的 .vscode/mcp.json
{
"servers": {
"postgres-safe": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"postgres-mcp-safe"
]
}
}
}浏览器会先询问是否打开应用,然后应用会显示设置并请你确认。密钥的值会留空,由你自己填写。
这个服务器在你的电脑上运行,而 ChatGPT 只能连接互联网上的服务器。请选择其他应用。
你的选择通过 Cookie 保存在这台设备上,无需账户。
这些设置是根据作者在注册中心的条目生成的。如果 README 的写法不同,请以 README 为准。
它在你的电脑上运行;安装后,工具列表会显示在你的 AI 应用中。
我们检查的是任何人都能看到的信息;我们没有阅读代码。不适用的检查项不计入总数。 · 检查于 2026年11月6日
注册名称已通过 GitHub 账户 Poudel0 验证,该账户拥有此仓库
我们还没有从 GitHub 读取这个仓库
我们还没有从 GitHub 读取这个仓库
它在你的电脑上运行,没有互联网端点
在你的电脑上运行,改用本地设置
它在你的电脑上运行;我们只能读取互联网端点的工具列表
与注册中心里这个分类中所有活跃的服务器比较。只有当发布者拥有该仓库时,星标数才计入。
它在 1 项适用的基础检查中通过了 1 项。我们没有阅读代码。在添加密钥或令牌之前,请先看看这个服务器要求哪些权限,并使用只具备所需权限的密钥。
注册中心没有列出必需的密钥,不过有些服务器会在首次使用时要求你登录。
它在你的电脑上运行。你的 AI 应用会在需要时启动它,数据不会经过作者的服务器(除非它自己调用在线服务)。
GitHub 仓库最后更新于–,最新版本(0.1.3)于3天前进入注册中心。
支持 MCP 的应用,例如 Claude Desktop、Claude Code、Cursor 和 VS Code。你的电脑上还需要有 Node.js, Docker。
同一分类中有:Supabase, MongoDB MCP Server, Elasticsearch MCP Server
同一分类中其他作者的服务器,按星标数排序。
如何看卡片:★ GitHub 星标i三大支柱:评价 · 检查 · 使用情况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 drop-in replacement for the deprecated @modelcontextprotocol/server-postgres, but actually read-only.
Lets AI tools (Claude, Cursor, Zed, ...) query a Postgres database, read its schema and explain queries. Swap the package name in your MCP config and keep everything else.
{
"mcpServers": { "postgres": { "command": "npx",
}
Docker: docker run -i --rm ghcr.io/poudel0/postgres-mcp-safe postgresql://host.docker.internal:5432/mydb. Binaries for Linux, macOS and Windows are on the releases page.
One catch: if your URL logs in as a superuser (like Docker's default postgres user), every call is refused until you either create a read-only role (recommended) or add --allow-superuser before the URL. A superuser can get around a read-only transaction, so we won't pretend otherwise.
The old server's query tool and postgres://.../ /schema resources work the same. See Differences for the small, deliberate changes.
The old server's "read-only" mode can be broken with COMMIT; DROP TABLE ... (Datadog Security Labs, 2025-08-21). A fix was merged upstream but never published, and the package is deprecated with no official successor.
Flags go before the URL.
| Flag | Default | |
|---|---|---|
--timeout | 30s | Time limit per call. |
--max-rows | 1000 | Rows returned per call. Extra rows are cut off with a note. |
--max-bytes | 262144 | JSON bytes returned per call, and the max size of a single row. |
--allow-explain-analyze | off | Lets explain run EXPLAIN ANALYZE, which executes the query. |
--allow-superuser | off | Allows a superuser role, or a member of one. Read-only is then not guaranteed. |
Each call opens a fresh connection (that's part of the safety model). Against a remote database over TLS that costs a few round trips: about 0.5 s per call at 50 ms latency. On Postgres 17+ you can save one round trip by adding sslnegotiation=direct to the URL.
Limits can't be turned off; 0 is an error. The URL can also be a keyword DSN (host=db dbname=app), and the standard PG* environment variables (PGPASSWORD, ...) are read as libpq would.
| Tool | Input | |
|---|---|---|
query | sql | One read-only statement. Returns a JSON array of rows. |
list_tables | schema? | Tables and views with schema and type. |
describe_table | table, schema? (public) | Columns, constraints and indexes. |
explain | sql, analyze? | Query plan. analyze needs --allow-explain-analyze. |
Postgres enforces it, not a SQL parser. Every call:
READ ONLY transaction.COMMIT; ... fails before anything runs.COMMIT, SET, DO, COPY, CALL, PREPARE and friends are rejected without running.statement_timeout, a client deadline, and row and byte caps.The bypass suite runs every known payload against a real database and checks a canary table after each one:
| Payload | Result |
|---|---|
COMMIT; DROP SCHEMA public CASCADE; | Rejected: multiple statements |
COMMIT / SET TRANSACTION READ WRITE / DO $$...$$ / CALL p() | Rejected: returns no rows |
COPY (SELECT 1) TO PROGRAM '...' (as superuser) | Rejected: returns no rows |
DELETE ... RETURNING * / WITH d AS (DELETE ...) SELECT ... | Read-only transaction error |
SELECT nextval('s') | Read-only transaction error |
SELECT set_config('transaction_read_only','off',true) | Error |
SELECT pg_sleep(600), even after set_config('statement_timeout','0') | Cancelled at --timeout |
SELECT pg_advisory_lock(1) | Released when the call ends |
SELECT generate_series(1,10000000) / repeat('x', 10000000) | Capped / rejected, memory stays bounded |
explain with ANALYZE SELECT ... | Syntax error: can't smuggle ANALYZE |
Found a bypass? Open an issue. It becomes a test row before the fix.
This server makes each call read-only at the transaction level. Some things are out of a transaction's reach, and only the database role stops them:
dblink_exec(...) opens a *separate* session that isn't read-only.pg_terminate_backend(...) kills other connections.pg_read_file, pg_ls_dir): read-only stops writes, not reads.lo_export, even inside a read-only transaction.So connect as a role that can only read:
CREATE ROLE mcp_ro LOGIN PASSWORD '...';
GRANT pg_read_all_data TO mcp_ro; -- PG 14+; or GRANT SELECT on what it needs ALTER ROLE mcp_ro SET default_transaction_read_only = on;
Because of the last two, the server refuses superuser roles (and members of them) unless you pass --allow-superuser.
isError: true and the Postgres message and SQLSTATE, so the model can fix its SQL. The old server sent a JSON-RPC error.resources/read only shows columns of the public table, in column order. The old one mixed in columns from same-named tables in other schemas.bigint and numeric) and json are JSON values; everything else is a string such as "2026-01-02 03:04:05+00", "\\x0102" or "{x,y}". NaN is "NaN" (the old server gave null).SET, DO, COPY, ...) are rejected. The old server ran them and returned [].docker run -d --name pg-mcp-test -e POSTGRES_PASSWORD=postgres -p 127.0.0.1:5434:5432 postgres:17-alpine
export DATABASE_URL='postgresql://postgres:postgres@127.0.0.1:5434/postgres?sslmode=disable' make test # all tests, including the bypass suite make golden # re-record the old server's output (needs npx)
DATABASE_URL must be a superuser: the fixture resets the public schema and creates the mcp_ro role. Use a throwaway database.