Mmcp.market

PostgreSQL MCP Server

by YawLabs·io.github.YawLabs/postgres-mcp·v0.13.4

PostgreSQL MCP server - query, schema introspection, explain, and health checks for AI assistants

B83/100grade B
What users say
No reviews yet
Be the first
Safety scan
B83/100

full report

Adoption
Growing

5 stars3.2k downloads/wk

Reviews

Write one

Nobody has reviewed PostgreSQL MCP Server yet.

If you have run it, two minutes of your experience saves the next person an afternoon.

PostgreSQL MCP Server tools (21, 3 write)

write = sends, deletes, buys or posts

Read from the package source without running it. The installed server may list more.

  • pg_describe_table

    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` (other tables whose FKs point at this one), `constraints` (CHECK / UNIQUE non-PK / EXCLUDE), indexes, and partition info (`partition_of` parent, `partitions` children). Works on view

  • pg_explain

    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 actually executes the statement). Writes executed during EXPLAIN ANALYZE are rolled back, so you can inspect a plan for an INSERT/UPDATE/DELETE without persisting the rows -- but

  • pg_health

    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 check and to spot runaway queries, connection-cap pressure, and lock/IO waits. - connections: `total` for the CURRENT database, broken down into `active` / `idle` / `idle_in_trans

  • pg_inspect_locks

    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 or the app feels stuck - it's the fastest way to identify a long-held transaction holding a lock. Row shape: one row per (blocked_pid, blocking_pid) pair. A session waiting on mult

  • pg_io_stats

    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` -- it says WHICH subsystem is doing the I/O (client backends vs autovacuum vs checkpointer vs walwriter) and through which path, which a per-query or per-table view cannot. - io:

  • pg_killwrite action

    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 database session state. The role in DATABASE_URL must have permission - cancelling another user's query needs the `pg_signal_backend` role or superuser. Note: `pg_signal_backend` does

  • pg_list_extensions

    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_list_functions

    List functions, procedures, and aggregates in a schema. Returns name, arguments, return type, kind (function/procedure/aggregate/window), and implementation language.

  • pg_list_roles

    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` directly.

  • pg_list_schemas

    List non-system schemas in the database. Excludes `pg_catalog`, `information_schema`, and other `pg_*` internals.

  • pg_list_tables

    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 <= 13). Paginate via `limit`/`offset` on very large schemas.

  • pg_list_views

    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_querywrite action

    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.g. one granted `pg_read_all_data`), which makes writes server-rejected regardless of any env var. `ALLOW_WRITES=1` is a secondary belt-and-braces gate - it lifts the in-server `BEG

  • pg_readonlywrite action

    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 always rolled back. Use this whenever the goal is to read - SELECT, EXPLAIN, SHOW, VALUES, WITH ... SELECT, etc. Scope caveat for hosts that auto-allow this tool: `READ ONLY` constrai

  • pg_replication_status

    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. Returns empty arrays on a standalone (non-replicated) database rather than erroring.

  • pg_search_columns

    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 asks 'which tables have X'.

  • pg_seq_scan_tables

    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 tuples, and the ratio. A high ratio on a large table usually means a query is reading the whole table where an index would suffice. Pair with `pg_top_queries` to find which query is do

  • pg_table_bloat

    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 stale last_autovacuum is a sign a table needs VACUUM. On PostgreSQL 19+ every row also carries `stats_reset`: the last time THAT relation's counters were reset via `pg_stat_reset_singl

  • pg_table_privileges

    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 table then grantee. Use this to answer 'who can write to this table?' or to audit schema-wide access before a migration. Visibility caveat: backed by `information_schema.table_pri

  • pg_top_queries

    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_seconds, dealloc}`: each row has normalized query text (constants replaced with `?`), call count, total/mean/min/max time in ms, rows returned, and cache hit ratio. Use this to fi

  • pg_unused_indexes

    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 fix is to drop a dead one. Returns `{rows, stats_reset, stats_reset_age_seconds}`. READ THIS BEFORE RECOMMENDING A DROP: `scans` is a counter, not a verdict. It only counts since th

Public scan report

scanner v0.1.5 · 2026-09-19 · same rubric, same numbers if you re-run it

1 medium
  • Code scan3 source files scanned20/25
  • Live reliabilityno gateway calls yet and no remote to proben/a
  • Tool poisoningtools not inspected (local package is not executed); not countedn/a
  • Auth qualitylocal package, no credentials required12/15
  • Maintenancelast push 1 days ago15/15
  • Maintainer identityregistry namespace matches repository owner7/10

Findings (1)

  • mediumeval / new Function usedexec.eval
    dist/index.js: …ourceCode, sch); const validate = new Function(`${names_1.default.self}`, `${names_1.de…
Overall 83/100. Components that don't apply are left out of the denominator. Any critical finding is an F.RubricAppeal a findingJSON

Install directly

Runs npx -y @yawlabs/postgres-mcp on your machine. Read the scan report first; the gateway never runs local packages.

claude mcp add postgres-mcp -- npx -y @yawlabs/postgres-mcp
Add to Cursor

PostgreSQL MCP Server: common questions

Is PostgreSQL MCP Server safe?
Mostly: it is graded B (83/100). Read the PostgreSQL MCP Server safety report
How do I install PostgreSQL MCP Server?
It runs on your machine. Copy the Claude Code, Claude Desktop or Cursor config from the install section.
Does PostgreSQL MCP Server need an API key?
Not as far as the registry entry and our scan can tell: no credentials are declared or required.
Is PostgreSQL MCP Server maintained?
The last commit was in the last day (2026-09-19). The latest release is v0.13.4.
What can I use instead of PostgreSQL MCP Server?
Servers from other publishers that do the same job: PostgreSQL MCP server, Postgres AIops MCP server and Postgres URL Shape MCP server. Compare all PostgreSQL MCP Server alternatives.

Alternatives to PostgreSQL MCP Server

Same job from other publishers: the closest match first, then the best rated.

All PostgreSQL MCP Server alternatives →
  • PostgreSQL
    MCP server for PostgreSQL: local, Docker, RDS, Neon, Supabase, or behind an SSH bastion.
    B
  • Postgres AIops
    Governed PostgreSQL DBA ops: slow-query RCA, bloat/vacuum & blocking-lock analysis; 35 MCP tools.
    A
  • Postgres URL Shape
    Check a Postgres URL shape. Credentials discarded.
    A
  • JDBC MCP Server
    Read-only PostgreSQL, Oracle and SQL Server access for AI agents: SQL, plans, schema, index stats
    A
  • health4ai
    Query your Apple Health data from your own Supabase/Postgres via local MCP.
    B

More from YawLabs