
Kaiva Postgres MCP
ai.kaiv由 kaiv.ai 发布v0.1.1更新于 Oct 26, 2026
Read-only PostgreSQL MCP server. Drop-in replacement for the archived server-postgres.
发布方自己的服务:Kaiva Bridge
概览
只读的 PostgreSQL MCP 服务器,让助手执行单条只读 SQL 语句并查看表结构。
- 可以做什么
- 执行一条只读 SQL 语句(SELECT、WITH、VALUES、TABLE、SHOW 或 EXPLAIN),以 JSON 返回结果行
- 列出该登录可读取的表和视图,含类型、估算行数与注释
- 描述单张表的列、主键、唯一键与外键、引用它的表以及索引
- 按归档版 server-postgres 的方式,把每张表的列作为资源提供
- 适用场景
- 适合让助手在不写入数据库的前提下回答 PostgreSQL 数据问题,或用于替换已归档的 server-postgres,同时保留相同的 query 工具与表结构资源。
- 运行要求
- 通过 npm 包 @kaiva/postgres-mcp 以 stdio 在本机运行(npx 或 Docker 镜像)。需要 PostgreSQL 连接 URL,作为第一个参数或放在 DATABASE_URL 中,TLS 选项如 sslmode 写在 URL 里。建议使用只读登录。仅支持桌面客户端。
安装
在 SourceWeft 中
- 打开 控制台中的 Kaiva Postgres MCP,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
Kaiva Postgres MCP
The Postgres MCP server that stays read-only. A drop-in replacement for the archived
@modelcontextprotocol/server-postgres.
Switch in one line
Where your AI client starts the archived server today:
change the package name:
In Claude Code:
The query tool, its sql input and the table schema resources are the same, so nothing else
changes.
Other ways in, with DATABASE_URL set in your environment:
- Claude Code plugin:
/plugin install postgres-mcp --marketplace ai-kaiva/postgres-mcp - Gemini CLI extension:
gemini extensions install https://github.com/ai-kaiva/postgres-mcp, thengemini extensions config kaiva-postgres-mcpto enter the database URL - Docker:
docker run -i --rm -e DATABASE_URL ghcr.io/ai-kaiva/postgres-mcponce the image is published
Why switch
The archived server is no longer maintained: Anthropic archived it in 2025 as a reference example
rather than production software, and npm marks it "Package no longer supported". It runs whatever
text it is given inside BEGIN TRANSACTION READ ONLY, and that is not enough:
COMMIT; DROP SCHEMA public CASCADEends the read-only transaction and drops the schema (reported by Datadog Security Labs in August 2025; the fix never reached npm, where 0.6.2 is still the latest version).- With a superuser login, which is what most local and Docker installs start with, one statement
can run a shell command on the database server: PostgreSQL runs
COPY ... TO PROGRAMinside a read-only transaction.
We checked both against version 0.6.2 on PostgreSQL 14: both ran. Kaiva Postgres MCP refuses both.
Tools
query: run one read-only SQL statement (SELECT,WITH,VALUES,TABLE,SHOWorEXPLAIN) and get the rows as JSON.list_tables: the tables and views this login can read, with type, estimated row count and comment.describe_table: one table's columns, primary key, unique and foreign keys, the tables that reference it, and its indexes.
Resources: each table's columns, as the archived server listed them.
How read-only is enforced
On every call:
- The SQL is checked before it is sent: one statement, starting with
SELECT,WITH,VALUES,TABLE,SHOWorEXPLAIN, calling no function that reaches past the transaction (dblink, server file functions,lo_importandlo_export,pg_terminate_backend, advisory locks, and functions that run SQL given to them as text). - It runs alone, through PostgreSQL's extended query protocol, which refuses a second statement,
inside a
READ ONLYtransaction with a statement time limit and a lock time limit. - The transaction is always rolled back, and
DISCARD ALLresets the session, so nothing a statement sets up outlives it.
Only the first 1,000 rows are fetched from the database (one more is read, to know whether more exist), so a query over a large table returns quickly.
Use a login that can only read
The strongest guard is a login that cannot write. Run this once as an administrator, then put
mcp_readonly in the connection URL:
To see what a login can do:
Options
Give the connection URL as the first argument, or set DATABASE_URL. TLS settings go in the URL
(sslmode, sslrootcert), as with psql.
What it does not protect
- Anything the login can read, the AI can read: tables, views and foreign tables, and with a
superuser the system catalogs too (
pg_authidholds password hashes). Use a login that sees only the tables you mean to share. - The refused-function list is a second guard, not a sandbox. It sees the SQL the AI sends, not what
a view, a foreign table (
file_fdw) or a function already defined in your database does when it is read. With a superuser login such an object can still read a file on the database server. With a login that can only read, PostgreSQL itself refuses (checked: a view overpg_read_filereads the file as a superuser and is refused as a read-only login). - "This machine" means localhost, 127.x, ::1, a Unix socket,
*.localhostandhost.docker.internal(the Docker host). Anywhere else, Docker Compose service names and private network addresses included, a superuser is refused unless--allow-superuseris given.
In Claude.ai, ChatGPT or for your team
This package runs on your machine. To use the same database from Claude.ai or ChatGPT, or share it
with your team behind sign-in, Kaiva Bridge serves it as a managed MCP server. In a project folder
whose .env holds DATABASE_URL:
Your database must be reachable from the internet. https://kaiv.ai/bridge?utm_source=postgres-mcp&utm_medium=readme
License
MIT
来源:README.md,提交 bcb5e90
工具
0版本历史
2- v0.1.1最新Oct 21, 2026
- v0.1.0Oct 19, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分
其他 Kaiv 集成

Kaiva Bridge
ai.kaiv官方发布者
Kaiva Bridge 是一个托管型 MCP 服务器,让助手列出、查看、起草并刷新由 OpenAPI 规范、数据库或文档生成的托管 MCP 服务器。
Version Truth
ai.kaiv官方发布者
让助手查询 300 多个产品的最新版本、LTS 支持期与终止支持(EOL)日期。
Is It Down
ai.kaiv官方发布者
一个远程 MCP 服务器,用于查询 GitHub、npm 等常见开发者服务当前是正常、降级还是故障。
Email Check
ai.kaiv官方发布者
远程 MCP 服务器,让助手检查域名的邮件配置:MX 可投递性、SPF 与 DMARC 防伪造状况。
Docker Facts
ai.kaiv官方发布者
一个远程 MCP 服务器,让助手查询 Docker Hub 镜像信息:镜像与标签是否存在、大小、支持的平台以及仓库状态。