PostgreSQL (hardened, read-only) MCP配置与使用教程
io.github.Eszetael/postgres-mcp-hardened · v0.1.10
Read-only PostgreSQL over MCP. Writes refused at the parsed SQL, plus a READ ONLY transaction.
产品介绍
Read-only PostgreSQL over MCP. Writes refused at the parsed SQL, plus a READ ONLY transaction. PostgreSQL (hardened, read-only) 是一个MCP Server,收录自 官方 MCP Registry。支持 stdio、streamable-http 传输。本页提供产品介绍、配置教程、安装命令与适用场景,可复制到 Cursor、Claude Code、VS Code。
适用场景
按平台快速复制
选择你的平台查看安装方式
- 打开项目根目录下的 .cursor/mcp.json(没有就新建)
- 点击「复制配置」粘贴进去;若已有其他 MCP,只合并 mcpServers 里的本条目
- 将 env 中的 <占位符> 替换为真实密钥(见下方「环境变量」)
- 保存后按 Cmd+Shift+P(Windows:Ctrl+Shift+P)→ 输入 Reload Window 并执行
{
"mcpServers": {
"postgres-mcp-hardened": {
"command": "npx",
"args": [
"-y",
"postgres-mcp-hardened"
],
"env": {
"DATABASE_URL": "<DATABASE_URL>"
}
}
}
}