Postgres Safe SQL MCP
by benborla · Database
Read-only Postgres MCP with query allowlisting and row-limit guards. Safe for production.
Install
Run this command in your terminal:
claude mcp add --transport stdio mcp-postgres-safe -- npx -y mcp-server-postgres-safe
Before running, set: DATABASE_URL
Authentication
Required environment variables:
- DATABASE_URL
See the setup guide for step-by-step instructions on obtaining these credentials.
Read-only guard rails make this safe for production DB access. Popular community pick.
Skills that use this MCP
postgres (safe SQL)
Safe SQL skill executes read-only Postgres queries through the safe-SQL MCP.
sql-queries
Postgres Safe SQL MCP gives this skill a safe execution environment for generated queries.
Postgres Best Practices
Best-practice validation runs live EXPLAIN and index checks via Postgres Safe SQL MCP.
claude-code-subagents (DB experts)
DB expert subagents can query Postgres via safe-SQL MCP for read-only introspection.

