
Product
PHP and Composer Support Is Now in Beta
Socket’s PHP and Composer support is now in Beta for all customers, with PHP reachability analysis generally available.
postgres-mcp-hardened
Advanced tools
Secure read-only PostgreSQL MCP server in Rust — a maintained alternative to the deprecated @modelcontextprotocol/server-postgres. Blocks writes at the AST, not with regexes.
A maintained, read-only PostgreSQL MCP server — the drop-in replacement for
@modelcontextprotocol/server-postgres,
which was deprecated by its authors and last released in December 2024.
Writes are refused by walking the parsed SQL, not by matching strings. Comments, dollar-quoting and Unicode tricks do not survive the parse, so they cannot smuggle a statement past the check.
Try to break it without installing anything — the guard has an offline mode:
npx postgres-mcp-hardened --validate "/* comment */ DROP TABLE users"
# REJECT: non-read-only statement: Drop
If something that writes comes back ALLOW, that is the most useful thing anyone can report. The
design and the defects found so far are written up in
Rebuilding the Deprecated PostgreSQL MCP Server in Rust.
{
"mcpServers": {
"postgres": {
- "command": "npx",
- "args": ["-y", "@modelcontextprotocol/server-postgres", "postgresql://localhost/mydb"]
+ "command": "npx",
+ "args": ["-y", "postgres-mcp-hardened", "--stdio"],
+ "env": { "DATABASE_URL": "postgres://readonly_user:PASSWORD@localhost:5432/mydb" }
}
}
}
The connection string moves from an argument to DATABASE_URL on purpose: arguments show up in
ps output and in shell history on a shared machine, and a database password does not belong there.
READ ONLY transaction — so a gap in the first layer is not a breach.npx -y postgres-mcp-hardened --stdio # no install
npm install -g postgres-mcp-hardened # or keep it around
The package fetches a prebuilt binary for your platform from the matching GitHub release:
Linux (x64, arm64), macOS (Intel, Apple Silicon) and Windows (x64). Alpine/musl is not among them —
the Linux builds link against glibc; use the container image ghcr.io/eszetael/postgres-mcp-hardened
or build from source with cargo build --release in a clone.
Full documentation, configuration reference and the security model: https://github.com/Eszetael/postgres-mcp-hardened
MIT licensed.
FAQs
Secure read-only PostgreSQL MCP server in Rust — a maintained alternative to the deprecated @modelcontextprotocol/server-postgres. Blocks writes at the AST, not with regexes.
We found that postgres-mcp-hardened demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.

Product
Socket’s PHP and Composer support is now in Beta for all customers, with PHP reachability analysis generally available.

Product
Socket is bringing experimental protection to Firefox, scanning 97,000+ extensions in Mozilla's official directory for malware and risky updates.

Research
/Security News
Three compromised Rust crates pulled in a malicious dependency that downloaded and executed cross-platform malware during Cargo builds.