PostgreSQL (hardened, read-only)
io.github.Eszetael/postgres-mcp-hardened
v0.1.12Updated Nov 24, 2026stdio · npmstdio · Docker
Read-only PostgreSQL over MCP. Writes refused at the parsed SQL, plus a READ ONLY transaction.
Install
Needs 1 secret. Replace 1 placeholder with your own values.
Run in your terminal. Replace 1 placeholder.
claude mcp add postgres-mcp-hardened -e 'DATABASE_URL=<your-database-url>' -- npx -y [email protected]The registry lists extra launch arguments or environment variables for this server that could change what runs. They are left out here; check its repository before adding any.
Configuration
5 settings, 1 required secret. Snippets use placeholders; keep real values out of shared config.
DATABASE_URLEnv var· required· secretConnection 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_TIMEOUTEnv var· optionalServer-side statement timeout, e.g. `5s`. A question that would pin the database is cancelled by PostgreSQL, not by hope.MCP_ALLOW_TABLESEnv var· optionalComma-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_LOGEnv var· optionalPath 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_ADDREnv var· optionalAddress to bind, default 127.0.0.1:8080.
Links
Listed in the official MCP Registry since Nov 24, 2026. Mirrored daily; last checked Nov 26, 2026.