PostgreSQL (hardened, read-only) MCP Server
Read-only PostgreSQL over MCP. Writes refused at the parsed SQL, plus a READ ONLY transaction.
PostgreSQL (hardened, read-only) scores 44 (Fair), licensed MIT and written in Rust. It installs as a local process. It declares 5 tools. Filed under Databases. GitHub shows 3 stars. Package registries report about 781 downloads a week. Install configs are generated for 12 clients. Being listed in the registry is not the same as being vendor-official.
Fair trust
44 of 100 from six public signals. Nobody can buy a point.
- OSI-style license: mit.
License, quality and maintenance
Quality: Grade B
70/100 for listing completeness. Lost points: no README, short summary.
How quality is graded
Where the 44 comes from
0 + 20 + 7 + 10 + 4 + 3 = 44. Each factor is capped, so no single signal can carry a listing.
Active in the official MCP registry, plus a known vendor namespace.
Registry: 0 of 30 points.How recently the repository saw a commit or release.
Maintenance: 20 of 20 points.GitHub stars and weekly downloads, on a log scale.
Popularity: 7 of 20 points.A clear, OSI-style open-source license.
License: 10 of 10 points.Not archived, a secure install path, a pinned version.
Security: 4 of 10 points.A real summary, a README with depth, listed tools.
Docs: 3 of 10 points.Install
Pick your client, copy the config, paste it in.
Needs Cursor or VS Code installed on this device. The button opens the app and asks you to confirm before it adds the server.
{ "mcpServers": { "eszetael-postgres-mcp-hardened": { "command": "npx", "args": [ "-y", "postgres-mcp-hardened@0.1.12" ], "env": { "DATABASE_URL": "YOUR_DATABASE_URL", "MCP_STATEMENT_TIMEOUT": "", "MCP_ALLOW_TABLES": "", "MCP_AUDIT_LOG": "" } } }}
Environment variables
| Name | Required | Notes |
|---|---|---|
DATABASE_URLSecret | Required | 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 | Optional | Server-side statement timeout, e.g. `5s`. A question that would pin the database is cancelled by PostgreSQL, not by hope. |
MCP_ALLOW_TABLES | Optional | 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 | Optional | 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. |
DATABASE_URLSecret | Required | Connection string for a role that cannot write. |
MCP_ADDR | Optional | Address to bind, default 127.0.0.1:8080. |
Tools5Tool docs quality grade D
All capabilitiesanalyze_indexestoolunused indexes, duplicates, and tables scanned sequentially often enough
database_healthtoolcache hit ratio, connections (this database and the cluster), the longest
explain_querytoolthe execution plan; with analyze it runs the statement and reports real
security_posturetoolwhat this deployment is actually able to do to your database, asked of
top_queriestoolthe heaviest statements, from pgstatstatements.
About
Secure read-only PostgreSQL MCP server in Rust — a hardened alternative to the deprecated @modelcontextprotocol/server-postgres.
Frequently asked questions
What is PostgreSQL (hardened, read-only) MCP Server?
Read-only PostgreSQL over MCP. Writes refused at the parsed SQL, plus a READ ONLY transaction.
How do I install PostgreSQL (hardened, read-only) MCP Server in Claude Desktop, Cursor, or VS Code?
Pick your client in the Install section on this page and copy the generated config into the client's config file. Step-by-step guides: Claude Desktop, Cursor, and VS Code. PostgreSQL (hardened, read-only) MCP Server runs locally from the npm package postgres-mcp-hardened with the command npx -y postgres-mcp-hardened@0.1.12.
Is PostgreSQL (hardened, read-only) MCP Server free and open source?
Yes. PostgreSQL (hardened, read-only) MCP Server is released under the MIT license, an OSI-approved open-source license, so you can use, modify, and self-host it under those terms.
What tools does PostgreSQL (hardened, read-only) MCP Server provide?
PostgreSQL (hardened, read-only) MCP Server provides 5 tools, including analyze_indexes, database_health, explain_query, and security_posture. See the full tool list for descriptions and parameters.
How is PostgreSQL (hardened, read-only) MCP Server's trust score calculated?
PostgreSQL (hardened, read-only) MCP Server scores 44 out of 100 (Fair). The score adds six capped public signals: registry status, maintenance, popularity, license, documentation, and security. Nobody can pay for points. Read the methodology for the full formula.
Reviews
No reviews yet—Be the first to review
No published reviews yet. Used it? Tell the next person how it went.
Sign inA verified email is required to review this server.
Add badge to your README
Paste either snippet into the repository README. The image links to this listing.