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. 159 installs a week from npm. Last commit 5 Sep 2026.

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

Installs per day peak 734 · avg 24
a month agotoday
159
Installs / week
npm · postgres-mcp-hardened
3
Stars
0 open issues
5 Sep 2026
Last commit
0 releases in 90 days
MIT
License
Rust

What the code does

We read the source, 21 h ago · rules 3dff92dd89df

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
File ships in the package but is absent from the source [пакет] bin/cli.js:1
этот файл ставится пользователю, но в репозитории его нет
  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 -- npx -y postgres-mcp-hardened
~/Library/Application Support/Claude/claude_desktop_config.json
{
  "mcpServers": {
    "postgres-mcp-hardened": {
      "args": [
        "-y",
        "postgres-mcp-hardened"
      ],
      "command": "npx"
    }
  }
}
~/.codex/config.toml
[mcp_servers.postgres-mcp-hardened]
command = "npx"
args = ["-y", "postgres-mcp-hardened"]
.cursor/mcp.json
{
  "mcpServers": {
    "postgres-mcp-hardened": {
      "args": [
        "-y",
        "postgres-mcp-hardened"
      ],
      "command": "npx"
    }
  }
}
.vscode/mcp.json
{
  "mcpServers": {
    "postgres-mcp-hardened": {
      "args": [
        "-y",
        "postgres-mcp-hardened"
      ],
      "command": "npx"
    }
  }
}

This one needs environment variables set before it will start: 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.), 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.). The author declared them in the registry entry; get the values from the project itself.

Alternatives to PostgreSQL (hardened, read-only)

same job, measured the same way
SQL
by abhishekkumar2021

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

45 installs/wk local only
C
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.

92 installs/wk local only
SafeSelect MCP
by antonillos

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

local only
AI2SQL
by ai2sql

Generate, fix, explain and run read-only SQL on PostgreSQL, MySQL and SQL Server

answering
Dbmcp
by haymon

Database MCP server for MySQL, MariaDB, PostgreSQL & SQLite with PII redaction and write-prevention

local only
Mcpg
by devopam

Production-grade PostgreSQL MCP server — 254 tools for query, tuning & ops, read-only by default.

1 099 installs/wk local only
MySQL MCP
by gistrec

MCP server for one MySQL database: schema, read-only queries and guarded writes.

27 installs/wk 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 159 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 with the file path 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 159 times in the last week. 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.