Home › Databases & Data › PostgreSQL (hardened, read-only)
PostgreSQL (hardened, read-only)
Read-only PostgreSQL over MCP. Writes refused at the parsed SQL, plus a READ ONLY transaction.
Topics: Databases
Connect
Review any command before running it. Package names and URLs come from the server's own registry entry.
Package (npm 0.1.10)
npx -y [email protected]
Or add to your MCP client config:
{
"mcpServers": {
"postgres-mcp-hardened": {
"command": "npx",
"args": [
"-y",
"[email protected]"
],
"env": {
"DATABASE_URL": "<YOUR_VALUE>",
"MCP_STATEMENT_TIMEOUT": "<YOUR_VALUE>",
"MCP_ALLOW_TABLES": "<YOUR_VALUE>",
"MCP_AUDIT_LOG": "<YOUR_VALUE>"
}
}
}
}
DATABASE_URLrequired 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— 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.
This server takes extra arguments — see its repository.
Package (oci)
Package: oci ghcr.io/eszetael/postgres-mcp-hardened:0.1.10
DATABASE_URLrequired secret — Connection string for a role that cannot write.MCP_ADDR— Address to bind, default 127.0.0.1:8080.
Related servers
MCP Toolbox for Databases
MCP Toolbox for Databases enables your agent to connect to your database.
baserow
Baserow database integration with table search, list, and row create, read, update, and delete capabilities.
postgres-mcp
All-in-one MCP server for Postgres development and operations, with tools for performance analysis, tuning, and health checks
Supabase
MCP server for interacting with the Supabase platform
mcp-server-mysql
MySQL database integration in NodeJS with configurable access controls and schema inspection
mcp-server-qdrant
A Qdrant MCP server
Listed in punkpeye/awesome-mcp-servers (MIT)
Data from the Official MCP Registry