About Safe Postgres
Safe Postgres is an MCP server published by samuel-cabral in the Data category: safety-first, read-only PostgreSQL MCP server. Read-only isn't a regex — it's enforced by Postgres itself (READ ONLY transactions, statement timeouts, row caps). One npx command to give AI agents safe access to your database.
Recent commit activity is the strongest signal that reported issues will get attention.
Install
claude mcp add safe-postgres -- npx -y safe-postgres-mcpnpx -y safe-postgres-mcpThis server has no ConduID identity, so agent calls to it are not receipted. Pin the version you install and review the source before granting it credentials.
Tools (5)
describe_tableFull description of one table/view: columns (type, nullability, default), primary key, foreign keys, and indexes.
Parameters not published.
explain_queryReturn the query plan via `EXPLAIN (FORMAT JSON)` **without** running the query. `ANALYZE`/`ANALYSE` is rejected (it would execute the target), and the statement is sent as a prepared statement inside a `READ ONLY` transaction. Inspect cost/joins/index usage before paying for the query.
Parameters not published.
list_schemasList all non-system schemas with their owner.
Parameters not published.
list_tablesList tables, views, and materialized views in a schema with **approximate** row counts (from planner stats — fast, no full scan) and on-disk size.
Parameters not published.
queryRun a single read-only SQL statement inside a `READ ONLY` transaction. A `LIMIT` is injected if you omit one; returns rows, field types, and a `truncated` flag.
Parameters not published.
Ask AI
Ask AI about Safe Postgres
Powered by Claude · Grounded in docs
Security checks
6 checks have not been run yet.