PostgreSQL (hardened, read-only)
CommunityMCP server by Eszetael · updated · ★ 3 · 80 downloads a week
Read-only PostgreSQL over MCP. Writes refused at the parsed SQL, plus a READ ONLY transaction. PostgreSQL (hardened, read-only) is a community project by Eszetael, not verified by a company domain.
Last commit 5 days ago
MIT: permissive, fine for commercial use
Clear description, published package or server URL, original repository
No risky patterns in the files we checked
What you need
| Setting | Needed | What it is |
|---|---|---|
DATABASE_Environment variable, secret | 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 creat |
MCP_Environment variable | Optional | Server-side statement timeout, e.g. `5s`. A question that would pin the database is cancelled by PostgreSQL, not by hope. |
MCP_Environment variable | 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_Environment variable | 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. |
From the publisher's entry in the official MCP Registry. Required settings are already in the install config below as placeholders.
Install PostgreSQL (hardened, read-only)
Built from the published package, never by AIclaude mcp add postgresql-hardened-read-only -e DATABASE_URL=YOUR_DATABASE_URL -- npx -y postgres-mcp-hardenedRun in your terminal. Add --scope user to use it in every project.
Step-by-step: install PostgreSQL (hardened, read-only) in Claude Code
{
"mcpServers": {
"postgresql-hardened-read-only": {
"command": "npx",
"args": [
"-y",
"postgres-mcp-hardened"
],
"env": {
"DATABASE_URL": "YOUR_DATABASE_URL"
}
}
}
}Settings, Developer, Edit config. Paste into claude_desktop_config.json and restart.
Step-by-step: install PostgreSQL (hardened, read-only) in Claude Desktop
{
"mcpServers": {
"postgresql-hardened-read-only": {
"command": "npx",
"args": [
"-y",
"postgres-mcp-hardened"
],
"env": {
"DATABASE_URL": "YOUR_DATABASE_URL"
}
}
}
}Add to ~/.cursor/mcp.json (all projects) or .cursor/mcp.json (this project).
Step-by-step: install PostgreSQL (hardened, read-only) in Cursor
{
"servers": {
"postgresql-hardened-read-only": {
"command": "npx",
"args": [
"-y",
"postgres-mcp-hardened"
],
"env": {
"DATABASE_URL": "YOUR_DATABASE_URL"
}
}
}
}Add to .vscode/mcp.json. VS Code uses "servers", not "mcpServers".
Step-by-step: install PostgreSQL (hardened, read-only) in VS Code
codex mcp add postgresql-hardened-read-only --env DATABASE_URL=YOUR_DATABASE_URL -- npx -y postgres-mcp-hardenedStep-by-step: install PostgreSQL (hardened, read-only) in Codex
{
"mcpServers": {
"postgresql-hardened-read-only": {
"command": "npx",
"args": [
"-y",
"postgres-mcp-hardened"
],
"env": {
"DATABASE_URL": "YOUR_DATABASE_URL"
}
}
}
}Add to ~/.gemini/config/mcp_config.json (all projects) or .agents/mcp_config.json (this project).
Step-by-step: install PostgreSQL (hardened, read-only) in Antigravity CLI
gemini mcp add postgresql-hardened-read-only npx -y postgres-mcp-hardenedGemini CLI was replaced by Antigravity CLI in June 2026 and remains only for enterprise licences and paid API keys.
Step-by-step: install PostgreSQL (hardened, read-only) in Gemini CLI
MCP servers run with your permissions and can read what you give them access to. Some need an API key: check the README and add it under env in the postgresql-hardened-read-only block.
Weekly newsletter
Like PostgreSQL (hardened, read-only)? Get the best new MCP servers every week
The best new tools, security warnings before you install something risky, and one practical tip. Free, three minute read.
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: README.md. This looks for known risky patterns and is not a full audit. How grades work
Alternatives to PostgreSQL (hardened, read-only)
All alternatives →MCP server for interacting with the Supabase platform
Built-in MCP server for ArcadeDB multi-model database (graph, document, vector, time-series)
MCP Toolbox for Databases enables your agent to connect to your database.
MCP Toolbox for Databases enables your agent to connect to your database.
Real-time Kubernetes network traffic visibility and API analysis for HTTP, gRPC, Redis, Kafka, DNS.
Self-learning vector database for Node.js — hybrid search, Graph RAG, FlashAttention-3, HNSW, 50+ attention mechanisms
PostgreSQL (hardened, read-only): common questions
How do I install PostgreSQL (hardened, read-only)?
In Claude Code run claude mcp add postgresql-hardened-read-only -e DATABASE_URL=YOUR_DATABASE_URL -- npx -y postgres-mcp-hardened. For Claude Desktop, Cursor and VS Code, paste the config shown above and restart. See the install guides.
Is PostgreSQL (hardened, read-only) the official server?
PostgreSQL (hardened, read-only) is a community project by Eszetael, not verified by a company domain.
Is PostgreSQL (hardened, read-only) free?
The code is published under the MIT licence. The service it connects to may have its own pricing.
Is PostgreSQL (hardened, read-only) safe to use?
It scores 73 of 100. Grades: maintenance A, licence A, quality C. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to PostgreSQL (hardened, read-only)?
Similar MCP servers: Supabase, ArcadeDB MCP Server, MCP Toolbox for Databases, MCP Toolbox for Databases.
Does PostgreSQL (hardened, read-only) work with ChatGPT?
Not directly. It runs locally, and ChatGPT only connects to remote servers with a URL. Use it in Claude Code, Claude Desktop, Cursor, VS Code or Codex.
