Read-only PostgreSQL over MCP. Writes refused at the parsed SQL, plus a READ ONLY transaction.
registry version 0.1.10
npm
npx -y postgres-mcp-hardenednpm
npx -y postgres-mcp-hardened@0.1.10Docker
docker run -i --rm ghcr.io/eszetael/postgres-mcp-hardened:0.1.10
Pick your client β the config below is generated for this server (local stdio). Copy respects the βPin versionβ switch above.
claude_desktop_config.json
{
"mcpServers": {
"postgres-mcp-hardened": {
"command": "npx",
"args": [
"-y",
"postgres-mcp-hardened"
],
"env": {
"DATABASE_URL": "<YOUR_DATABASE_URL>"
}
}
}
}{
"mcpServers": {
"postgres-mcp-hardened": {
"command": "npx",
"args": [
"-y",
"postgres-mcp-hardened@0.1.10"
],
"env": {
"DATABASE_URL": "<YOUR_DATABASE_URL>"
}
}
}
}Format verified against the official Claude Desktop docs β.
terminal
claude mcp add --env DATABASE_URL=<YOUR_DATABASE_URL> postgres-mcp-hardened -- npx -y postgres-mcp-hardened
claude mcp add --env DATABASE_URL=<YOUR_DATABASE_URL> postgres-mcp-hardened -- npx -y postgres-mcp-hardened@0.1.10
Format verified against the official Claude Code docs β.
.cursor/mcp.json
{
"mcpServers": {
"postgres-mcp-hardened": {
"command": "npx",
"args": [
"-y",
"postgres-mcp-hardened"
],
"env": {
"DATABASE_URL": "<YOUR_DATABASE_URL>"
}
}
}
}{
"mcpServers": {
"postgres-mcp-hardened": {
"command": "npx",
"args": [
"-y",
"postgres-mcp-hardened@0.1.10"
],
"env": {
"DATABASE_URL": "<YOUR_DATABASE_URL>"
}
}
}
}Format verified against the official Cursor docs β.
.vscode/mcp.json
{
"servers": {
"postgres-mcp-hardened": {
"command": "npx",
"args": [
"-y",
"postgres-mcp-hardened"
],
"env": {
"DATABASE_URL": "<YOUR_DATABASE_URL>"
}
}
}
}{
"servers": {
"postgres-mcp-hardened": {
"command": "npx",
"args": [
"-y",
"postgres-mcp-hardened@0.1.10"
],
"env": {
"DATABASE_URL": "<YOUR_DATABASE_URL>"
}
}
}
}Format verified against the official VS Code docs β.
mcp_config.json
{
"mcpServers": {
"postgres-mcp-hardened": {
"command": "npx",
"args": [
"-y",
"postgres-mcp-hardened"
],
"env": {
"DATABASE_URL": "<YOUR_DATABASE_URL>"
}
}
}
}{
"mcpServers": {
"postgres-mcp-hardened": {
"command": "npx",
"args": [
"-y",
"postgres-mcp-hardened@0.1.10"
],
"env": {
"DATABASE_URL": "<YOUR_DATABASE_URL>"
}
}
}
}Format verified against the official Windsurf docs β.
Defined in the server's official registry manifest. Required secrets are shown as <YOUR_β¦> placeholders in the configs above.
DATABASE_URL required secret β Connection string for the role the server connects as. Use a role that cannot write β the server refuses writes twice, but a read-only role is the layer that does not depend on us being correct. `--print-setup-sql` printMCP_STATEMENT_TIMEOUT β Server-side statement timeout, e.g. `5s`. A question that would pin the database is cancelled by PostgreSQL, not by hope.MCP_ALLOW_TABLES β Comma-separated allowlist. A table off the list is refused by name, and hiding it inside a CTE, a view or a join does not help.MCP_AUDIT_LOG β Path to the tamper-evident audit log. Entries are chained by hash and survive a restart; `--verify-audit` checks the chain against an off-host anchor.MCP_ADDR β Address to bind, default 127.0.0.1:8080.β 3 stars Β· ζθΏζ΄ζ°δΊ 18 倩ε Β· MIT license
postgres mcp hardened π§ Version 0.1.10 β the rest of an outside review, and a fix that was too blunt Published: binaries for five platforms with checksums, Sigstore signatures and build provenance; .mcpb bundles for one click install; an image on ghcr.io for amd64 and arm64; a package on npm; and aβ¦
Summary from the project README β github.com/Eszetael/postgres-mcp-hardened
Distributed as npm, Docker, listed under Databases. Review our MCP security guide before granting access to real data.
postgres mcp hardened π§ Version 0.1.10 β the rest of an outside review, and a fix that was too blunt Published: binaries for five platforms with checksums, Sigstore signatures and build provenance; .mcpb bundles for one click install; an image on ghcr.io for amd64 and arm64; a package on npm; and a
Run the install command shown above, then paste the config for your client (Claude Desktop, Claude Code, Cursor, VS Code or Windsurf) into its MCP settings and restart the client.
The MCP server itself is free to install. The source is public on https://github.com/Eszetael/postgres-mcp-hardened. Any third-party service it calls may require its own API key and account.
Any MCP-compatible client can use it, including Claude Desktop, Claude Code, Cursor, VS Code, Windsurf and custom agents.
Publish this server? Link back with a badge on your README or site β copy either snippet.
Markdown
[](https://mcpnav.net/server/postgres-mcp-hardened/)
HTML
<a href="https://mcpnav.net/server/postgres-mcp-hardened/"><img src="https://mcpnav.net/badge/postgres-mcp-hardened.svg" alt="Listed on MCPNav" height="20"></a>