NestDaddy

PostgreSQL (hardened, read-only)

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.

Connect Runs on your machine

Terminal
claude mcp add postgres-mcp-hardened -e DATABASE_URL=<DATABASE_URL> -e MCP_STATEMENT_TIMEOUT=<MCP_STATEMENT_TIMEOUT> -e MCP_ALLOW_TABLES=<MCP_ALLOW_TABLES> -e MCP_AUDIT_LOG=<MCP_AUDIT_LOG> -- npx -y [email protected]
claude_desktop_config.json
{
  "mcpServers": {
    "postgres-mcp-hardened": {
      "command": "npx",
      "args": [
        "-y",
        "[email protected]"
      ],
      "env": {
        "DATABASE_URL": "<DATABASE_URL>",
        "MCP_STATEMENT_TIMEOUT": "<MCP_STATEMENT_TIMEOUT>",
        "MCP_ALLOW_TABLES": "<MCP_ALLOW_TABLES>",
        "MCP_AUDIT_LOG": "<MCP_AUDIT_LOG>"
      }
    }
  }
}
~/.cursor/mcp.json
{
  "mcpServers": {
    "postgres-mcp-hardened": {
      "command": "npx",
      "args": [
        "-y",
        "[email protected]"
      ],
      "env": {
        "DATABASE_URL": "<DATABASE_URL>",
        "MCP_STATEMENT_TIMEOUT": "<MCP_STATEMENT_TIMEOUT>",
        "MCP_ALLOW_TABLES": "<MCP_ALLOW_TABLES>",
        "MCP_AUDIT_LOG": "<MCP_AUDIT_LOG>"
      }
    }
  }
}
.vscode/mcp.json
{
  "servers": {
    "postgres-mcp-hardened": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "[email protected]"
      ],
      "env": {
        "DATABASE_URL": "<DATABASE_URL>",
        "MCP_STATEMENT_TIMEOUT": "<MCP_STATEMENT_TIMEOUT>",
        "MCP_ALLOW_TABLES": "<MCP_ALLOW_TABLES>",
        "MCP_AUDIT_LOG": "<MCP_AUDIT_LOG>"
      }
    }
  }
}

Replace the values in angle brackets with your own. Keys stay on your machine; we never see them.

Tools

This server runs locally, so its tools are listed by your MCP client once it starts.

Environment variables

NameDescription
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` prints the SQL that creates one.
MCP_STATEMENT_TIMEOUT
Optional
Server-side statement timeout, e.g. `5s`. A question that would pin the database is cancelled by PostgreSQL, not by hope.
MCP_ALLOW_TABLES
Optional
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
Optional
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.

Details

Package[email protected] (NPM, stdio)
Packageghcr.io/eszetael/postgres-mcp-hardened:0.1.10 (OCI, streamable-http)
First published4 Sep 2026
Last updated4 Sep 2026
Registry nameio.github.Eszetael/postgres-mcp-hardened

More databases servers See all

Listing data from the official MCP registry. Status and tools from NestDaddy's daily check. Browse all MCP servers.