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.
Describe a single table or view: columns (name, type, nullability, default), primary key, foreign keys, and indexes. Use list_tables first to find the exact name.
Return the Postgres query plan for a read-only statement using EXPLAIN (FORMAT JSON) WITHOUT executing it (no ANALYZE). Useful for understanding cost, join strategy, and index usage before running a potentially expensive query.
List all non-system schemas in the database with their owner. Use this first to discover where tables live before calling list_tables.
List tables, views, and materialized views in a schema, with APPROXIMATE row counts (from planner statistics — fast, no full scan) and total on-disk size. Defaults to the 'public' schema.
Execute a single read-only SQL statement (SELECT/WITH/TABLE/VALUES/SHOW) against the database. The query runs inside a Postgres READ ONLY transaction with a statement timeout, and results are capped at the configured row limit (a LIMIT is injected if you omit one). Writes, DDL, and multi-statement input are rejected. Returns rows plus a `truncated` flag when the row cap was hit.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-23 | F | 11 | 2025-06-18+ | v2 |