mcpbeat Sign in

PostgreSQL (hardened, read-only) MCP Server

local only

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.

Installs per day peak 61 · avg 19 · +47% w/w
a month agotoday
294
Installs / week
npm · postgres-mcp-hardened
3
Stars
0 open issues
17 Oct 2026
Last commit
10 releases in 90 days
MIT
License
Rust

What the code does

We read the source, 1 d ago · rules 995398eba69f

Evidence

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.

Claims read-only, but the code runs commands npm/bin/cli.js:76, [пакет] bin/cli.js:76
  const child = spawn(bin, process.argv.slice(2), { stdio: 'inherit' });
Capabilities

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.

Runs a command on install [пакет] package.json:1
postinstall: node scripts/postinstall.js
  const child = spawn(bin, process.argv.slice(2), { stdio: 'inherit' });
Builds a file path from a variable npm/lib/install.js:36, [пакет] lib/install.js:36
  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.

We found things in this code

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.

Three servers free · no card

Connect this server

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.

run in your terminal
claude mcp add postgres-mcp-hardened -e 'DATABASE_URL=<DATABASE_URL>' -- npx -y postgres-mcp-hardened
~/Library/Application Support/Claude/claude_desktop_config.json
{
  "mcpServers": {
    "postgres-mcp-hardened": {
      "command": "npx",
      "args": [
        "-y",
        "postgres-mcp-hardened"
      ],
      "env": {
        "DATABASE_URL": "<DATABASE_URL>"
      }
    }
  }
}
~/.codex/config.toml
[mcp_servers.postgres-mcp-hardened]
command = "npx"
args = ["-y", "postgres-mcp-hardened"]
env = { DATABASE_URL = "<DATABASE_URL>" }
.cursor/mcp.json
{
  "mcpServers": {
    "postgres-mcp-hardened": {
      "command": "npx",
      "args": [
        "-y",
        "postgres-mcp-hardened"
      ],
      "env": {
        "DATABASE_URL": "<DATABASE_URL>"
      }
    }
  }
}
.vscode/mcp.json
{
  "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).

Alternatives to PostgreSQL (hardened, read-only)

same job, measured the same way
Pg Readonly MCP
by les-k

A read-only Postgres MCP server that parses SQL rather than pattern-matching it.

78 installs/wk local only
SQL
by abhishekkumar2021

Read-only SQL querying + schema introspection over Postgres & SQLite, with a gated write mode.

46 installs/wk local only
LogCarver
by caiderek

Read-only MCP server that finds deleted SQL Server rows from the transaction log (fn_dblog).

local only
Kaiva Postgres MCP
by kaiv

Read-only PostgreSQL MCP server. Drop-in replacement for the archived server-postgres.

271 installs/wk local only
D
Data
by thinair

PostgreSQL, MySQL, and SQL Server in one session. 26 read-only MCP tools for AI agents.

answering
Postgres MCP
by edelciomolina

PostgreSQL MCP wrapper with .env credential mapping, tool selection, and safe read-only defaults.

147 installs/wk local only
AI2SQL
by ai2sql

Text-to-SQL MCP server: read-only queries on PostgreSQL, MySQL and SQL Server with your real schema

answering
SafeSelect MCP
by antonillos

Fail-closed, read-only PostgreSQL and MongoDB access for AI agents over MCP.

local only

PostgreSQL (hardened, read-only) — questions

Answers built from our own checks of this server.

Why is there no uptime for PostgreSQL (hardened, read-only)?
PostgreSQL (hardened, read-only) runs on your own machine over stdio — there is no network address to reach, so uptime cannot be measured for it by anyone. What can be measured is adoption: the npm package postgres-mcp-hardened was installed 294 times last week.
How do I connect PostgreSQL (hardened, read-only)?
Copy the ready config from this page. We generate it for Claude Code, Claude Desktop, Codex, Cursor and VS Code, each in the form that client actually reads. It runs locally, so the command pulls postgres-mcp-hardened straight from npm; nothing to host, nothing to sign up for.
How many people use PostgreSQL (hardened, read-only)?
The npm package postgres-mcp-hardened was installed 294 times in the last week. Week over week that is +47%. We show installs rather than GitHub stars on purpose: a star is a bookmark, an install is someone actually running it.
Is PostgreSQL (hardened, read-only) open source?
Yes — it is published under the MIT licence, written in Rust and 3 stars on GitHub. The source link is on this page, so you can read exactly what it does with your data before you connect it.