io.github.YawLabs/postgres-mcp · version 0.13.10 · 2,184 weekly npm downloads · audited 2026-11-03
Notes
No hidden-instruction or invisible-character findings in any tool, prompt, or resource description.
Checks the directory's published tool requirements that are visible from tools/list. Passing them does not guarantee acceptance.
pg_killNot a vulnerability by itself. It tells you what an injected prompt could ask this server to do, so you can decide which tools need approval.
| Name | Title | Hint | Description |
|---|---|---|---|
pg_readonly | Run read-only SQL | read-only | Run a SQL statement with no persistent data changes. Always executes inside a `BEGIN READ ONLY` transaction regardless of `ALLOW_WRITES`, so postgres itself rejects any INSERT/UPDATE/DELETE/DDL and the transaction is alw… |
pg_query | Run SQL query | destructive | Run a SQL query against the configured PostgreSQL database. Postgres itself is the primary safety gate: the role in `DATABASE_URL` enforces what queries can succeed. The recommended posture is a least-privileged role (e.… |
pg_list_schemas | List schemas | read-only | List non-system schemas in the database. Excludes `pg_catalog`, `information_schema`, and other `pg_*` internals. |
pg_list_tables | List tables in a schema | read-only | List tables (and optionally views) in a schema. Returns name, type (table/view/materialized view/foreign), and estimated row count (from `reltuples`; null = no ANALYZE yet on PG 14+; 0 may mean empty or unanalyzed on PG … |
pg_describe_table | Describe table | read-only | Describe a relation: kind (table / view / materialized_view / partitioned_table / foreign_table), columns (name, type, nullable, default, `generated`, `identity`), primary key, foreign keys (outgoing), `referenced_by` (o… |
pg_list_views | List views with definitions | read-only | List views and materialized views in a schema with their SQL definitions. Use this over `pg_list_tables` with `includeViews: true` when you want the view body, not just names. |
pg_list_functions | List functions and procedures | read-only | List functions, procedures, and aggregates in a schema. Returns name, arguments, return type, kind (function/procedure/aggregate/window), and implementation language. |
pg_list_extensions | List installed extensions | read-only | List installed PostgreSQL extensions. Returns name, version, schema, and description. Useful to check for pgvector, postgis, pg_stat_statements, uuid-ossp, etc. before writing queries that rely on them. |
pg_search_columns | Search columns by name | read-only | Search for columns by name across all user schemas. Supports SQL LIKE patterns (`%` matches any substring, `_` matches one character). Case-insensitive. Use this instead of iterating `pg_describe_table` when the user ask… |
pg_explain | Explain query plan | destructive | Get the query plan for a SQL statement. By default, this uses plain EXPLAIN (no execution). Set `analyze: true` to run the query with EXPLAIN ANALYZE - for non-SELECT statements, ALLOW_WRITES=1 is required (since ANALYZE… |
pg_index_advisor | Recommend indexes for a workload | read-only | Recommend indexes for a workload, and prove each one pays for itself before recommending it. Give it `statements` (the SQL you care about) or let it take the top N from `pg_stat_statements`; it plans each statement, gene… |
pg_health | Database health snapshot | read-only | Quick health snapshot: server version, database size, connection counts measured against `max_connections`, active queries with their wait events, a pg_stat_database rollup, and table count. Useful as a connection sanity… |
pg_top_queries | Top queries by execution time | read-only | Top N queries by total or mean execution time. Requires the `pg_stat_statements` extension to be installed and enabled (most managed Postgres providers have it on by default). Returns `{rows, stats_reset, stats_reset_age… |
pg_seq_scan_tables | Find tables with heavy sequential scans | read-only | Tables with high sequential-scan counts relative to index scans - the first place to look for missing-index candidates. Returns `{rows, stats_reset, stats_reset_age_seconds}`: each row has seq_scans, idx_scans, live tupl… |
pg_unused_indexes | Find unused indexes | read-only | Indexes that have never been scanned or have very low usage, largest first. Each unused index costs write amplification (every INSERT/UPDATE maintains it) and disk space, so before adding a new index, check whether the f… |
pg_io_stats | I/O statistics and in-flight async I/O | read-only | I/O observability: cumulative per-backend-type I/O from `pg_stat_io` (PostgreSQL 16+), plus in-flight asynchronous I/O handles from `pg_aios` (PostgreSQL 18+). This is the layer underneath `pg_top_queries` and `pg_health… |
pg_inspect_locks | Inspect blocking locks | read-only | Show current lock contention: which sessions are blocked and who is blocking them. Returns blocked PID, blocking PID, lock types, relation being contested, and the queries involved. Use this first when a tool call hangs … |
pg_list_roles | List roles | read-only | List database roles (users and groups) with their login/superuser/createdb/createrole attributes and inherited role memberships. Use this to answer 'who has access to this database?' without needing to read `pg_authid` d… |
pg_table_privileges | Show table privileges | read-only | Show which roles have which privileges (SELECT, INSERT, UPDATE, DELETE, TRUNCATE, REFERENCES, TRIGGER) on a table or on every table in a schema. If `table` is omitted, the result spans every table in `schema`, ordered by… |
pg_kill | Cancel or terminate a backend | destructive | Cancel a running query (SIGINT-equivalent) or terminate a backend connection (SIGTERM-equivalent) by PID. Find the PID via `pg_health` active_queries or `pg_inspect_locks`. Requires ALLOW_WRITES=1 since this changes data… |
pg_replication_status | Replication status | read-only | Replication overview: configured replication slots, connected replicas (from `pg_stat_replication`), and current WAL position. Use on primary to spot lagging or disconnected replicas, on replicas to see upstream status. … |
pg_advisor | Database advisor (DBA lints) | read-only | Rolled-up DBA lint pass. One call returns four categories of findings: - sequence_exhaustion: SERIAL / BIGSERIAL / IDENTITY sequences whose `last_value` is above `seqExhaustionThreshold` of `max_value`. The classic incid… |
pg_table_bloat | Estimate table bloat | read-only | Estimate table bloat (dead tuples + free space) for tables in a schema. Returns live tuples, dead tuples, dead-tuple ratio, last_vacuum / last_autovacuum timestamps, and total relation size. A high dead_ratio with a stal… |
npx mcpvetter scan --liveAdd this to a README:
[](https://mcpvetter.com/servers/yawlabs-postgres-mcp)Get the MCPVetter verified badge, a re-audit within 24 hours of every npm release, and an email whenever tools, findings, or Claude directory readiness change. $29 per server per month. You prove ownership first, free.