Skip to content
Claude Code

PostgreSQL (hardened, read-only) for Claude Code

io.github.eszetael/postgres-mcp-hardened

Read-only PostgreSQL over MCP. Writes refused at the parsed SQL, plus a READ ONLY transaction.

client:Claude Code transport:stdio runtime:npm

Install PostgreSQL (hardened, read-only) in Claude Code

run in your project directory

Held in this page only — never stored, logged, or sent anywhere but back to your screen.

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 postgres-mcp-hardened

Adds it for this project only. Append --scope user to make it available everywhere. Claude Code docs

PostgreSQL (hardened, read-only) in other clients