数据 · Crystal DBA
配置 Postgres MCP Pro
提供 Postgres 查询、架构检查、索引调优和健康检查,替代已归档的参考服务器。
- 发布者
- Crystal DBA 社区
- 本地运行
uvx postgres-mcp --access-mode=restricted- 传输方式
- stdio, sse
- 身份验证
- 通过 DATABASE_URI 设置的 Postgres 连接字符串。
- 环境变量
DATABASE_URI- 可访问内容
- 受限模式为只读;不受限模式可读写。
- 许可证
- MIT
- 源码
- github.com/crystaldba/postgres-mcp
- 状态
- 活跃
安装
此服务器会在你的本机上作为客户端的子进程运行。你需要安装其命令所用的运行时,例如 npx 需要 Node.js、uvx 需要 uv,或者使用 Docker;还需要设置 Environment 下列出的变量。
Claude Code
claude mcp add --scope project --env DATABASE_URI='<DATABASE_URI>' postgres-mcp-pro -- uvx postgres-mcp --access-mode=restricted
Cursor
{
"mcpServers": {
"postgres-mcp-pro": {
"command": "uvx",
"args": [
"postgres-mcp",
"--access-mode=restricted"
],
"env": {
"DATABASE_URI": "${env:DATABASE_URI}"
}
}
}
}
Codex
[mcp_servers.postgres-mcp-pro]
command = "uvx"
args = ["postgres-mcp", "--access-mode=restricted"]
env_vars = ["DATABASE_URI"]
对于任何重要数据库,请保留 --access-mode=restricted;不受限模式允许 agent 写入。
数据 中的其他服务器
Airtable
在 Airtable base 中查询、创建和更新记录,访问范围仅限于你授权的 base。
BigQuery
由 Google 托管的 endpoint,可浏览 BigQuery 数据集并运行 SQL。Cloud SQL 和 Spanner 各有独立的 endpoint。
MCP Toolbox for Databases
一个服务器提供预置的工具集,支持 Postgres、MySQL、BigQuery、AlloyDB、Spanner 等数据库。
Supabase
通过代理管理 Supabase 项目:运行 SQL、应用迁移、读取日志和部署 Edge Functions。
Neon
创建 Neon Postgres 项目和分支、执行 SQL,并进行基于分支的迁移。适用于开发环境。
MongoDB
使用连接字符串或 Atlas 服务账号查询和管理 MongoDB 数据库及 Atlas 集群。