PostgreSQL (hardened, read-only) runs on your own machine — the client starts it, so there is no endpoint to ping. 294 installs a week from npm. Last commit 17 Oct 2026.
Read-only PostgreSQL over MCP. Writes refused at the parsed SQL, plus a READ ONLY transaction.
We read the source, 1 d ago · rules 995398eba69f
Things with no honest explanation: a promise that contradicts the code, code that runs at install time while hiding what it does, data leaving the machine.
const child = spawn(bin, process.argv.slice(2), { stdio: 'inherit' });
What this server is able to do. For an MCP server this is often the job itself — a terminal server runs commands because that is what it is for. Listed so you know what you are plugging in, not as an accusation.
postinstall: node scripts/postinstall.js
const child = spawn(bin, process.argv.slice(2), { stdio: 'inherit' });
return path.join(__dirname, '..', 'vendor', exe);
Is this your server and something here is wrong? Tell us — corrections are free and do not require a plan.
Code changes quietly between releases, and nobody reads the diff of a dependency. We do, on every release — watch PostgreSQL (hardened, read-only) and you get told the day something new turns up.
This server runs on your own machine — install it with the package manager and the client starts it for you. Package name taken from the official registry entry.
claude mcp add postgres-mcp-hardened -e 'DATABASE_URL=<DATABASE_URL>' -- npx -y postgres-mcp-hardened
{
"mcpServers": {
"postgres-mcp-hardened": {
"command": "npx",
"args": [
"-y",
"postgres-mcp-hardened"
],
"env": {
"DATABASE_URL": "<DATABASE_URL>"
}
}
}
}
[mcp_servers.postgres-mcp-hardened]
command = "npx"
args = ["-y", "postgres-mcp-hardened"]
env = { DATABASE_URL = "<DATABASE_URL>" }
{
"mcpServers": {
"postgres-mcp-hardened": {
"command": "npx",
"args": [
"-y",
"postgres-mcp-hardened"
],
"env": {
"DATABASE_URL": "<DATABASE_URL>"
}
}
}
}
{
"servers": {
"postgres-mcp-hardened": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"postgres-mcp-hardened"
],
"env": {
"DATABASE_URL": "<DATABASE_URL>"
}
}
}
}
Put your own value in place of
<DATABASE_URL> (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).
The author’s registry entry marks it as required.
Optional settings from the registry entry, left out of the block above:
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).
A read-only Postgres MCP server that parses SQL rather than pattern-matching it.
Read-only SQL querying + schema introspection over Postgres & SQLite, with a gated write mode.
Read-only MCP server that finds deleted SQL Server rows from the transaction log (fn_dblog).
Read-only PostgreSQL MCP server. Drop-in replacement for the archived server-postgres.
PostgreSQL, MySQL, and SQL Server in one session. 26 read-only MCP tools for AI agents.
PostgreSQL MCP wrapper with .env credential mapping, tool selection, and safe read-only defaults.
Text-to-SQL MCP server: read-only queries on PostgreSQL, MySQL and SQL Server with your real schema
Fail-closed, read-only PostgreSQL and MongoDB access for AI agents over MCP.
Answers built from our own checks of this server.