Mmcp.market

PG Bloat Detective MCP server

by r69shabh·io.github.r69shabh/pg-bloat-detective·v0.1.6

Read-only Postgres bloat verdicts: blockers, timelines, REINDEX proof.

A92/100grade A
What users say
No reviews yet
Be the first
Safety scan
A92/100

not scanned yet

Adoption
Growing

0 stars482 downloads/wk

Reviews

Write one

Nobody has reviewed PG Bloat Detective yet.

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

PG Bloat Detective tools

No tool declarations could be read from the package source. They show once the server is installed.

Not scanned yet. New registry listings are scanned within a day of import.

Install PG Bloat Detective in Claude Code, Cursor or VS Code

claude mcp add pg-bloat-detective -- uvx pg-bloat-detective
Add to Cursor

What the publisher says

From the PG Bloat Detective repository's README, as published. We do not edit it. Read it on GitHub

pg-bloat-detective — PostgreSQL Bloat Checker, Vacuum Blocker Finder & Index Bloat Detector

Find why your Postgres database is bloated, who is blocking VACUUM, and which indexes need REINDEX — read-only, with proof.

vacuum-starved · blocked-by-idle-xact · needs-rewrite · index-bloated · index-unused — one verdict per table/index, with PID + query evidence.

mcp-name: io.github.r69shabh/pg-bloat-detective

pip install pg-bloat-detective · Docker ready · MCP server for Claude/Cursor · Prometheus + Grafana · Next.js dashboard

pip install pg-bloat-detective          # or: pip install -e ".[dev]" from source
python -m bloatdetective collect --db timeline.db   # read-only snapshot (5s timeout)
python -m bloatdetective analyze --db timeline.db   # verdicts + evidence
python -m bloatdetective report --db timeline.db --html --out report.html
bloat-mcp                              # MCP server (stdio) for Claude Desktop / Cursor

What this is

A PostgreSQL bloat analysis tool that answers three questions other tools leave open:

  1. Is this table bloated, and why? — dead-tuple timeline (pgstatusertables) + exact pgstattupleapprox confirmation. Verdicts: normal (leave it alone), vacuum-starved (autovacuum losing), blocked-by-idle-xact|slot|prepared|active-xact (named PID + query holding backend_xmin), needs-rewrite (approx dead% >30%, VACUUM can't reclaim).
  1. Who is blocking VACUUM / autovacuum? — oldest backend_xmin holder tracked per snapshot: PID, transaction age, query text, stale replication slots, prepared transactions. Priority: prepared-xact > stale-slot > idle-in-transaction. Kill one, VACUUM, done.
  2. Is the index bloated? (VACUUM never fixes this) — exact pgstatindex on indexes under a 1GB cost guard (tunable --max-bytes, override --allow-large), metric 100 − avgleafdensity. Over 30% → index-bloated, schedule REINDEX. Zero scans across all snapshots → index-unused, DROP candidate. This is the gap pganalyze admits to — our differentiator, proven live: 83.7% → 9.9% after REINDEX while VACUUM did nothing.

One SQLite file = full timeline. One static page = the whole incident. No agents on prod, no writes (read-only transactions, statement timeout 5s), works on RDS / Neon / Supabase / self-hosted PG 12–17.

Quickstart (60-second demo)

docker compose up -d
pip install -e ".[dev]"
python -m bloatdetective collect --db timeline.db   # snapshot prod (read-only)
python workload/churn.py --mode idle-xact --secs 60 &  # create the failure
python -m bloatdetective collect --db timeline.db
python -m bloatdetective report --db timeline.db --html --out report.html
python -m bloatdetective serve --db timeline.db &   # :9187/metrics for Prometheus
pytest
bash scripts/benchmark.sh   # full before/after proof -> REPORT.md

Verdicts (read them as instructions)

Heap: normal (steady-state, leave alone) · vacuum-starved → run VACUUM / tune autovacuum · blocked-by-idle-xact|slot|prepared|active-xact → end the named session, then VACUUM · needs-rewrite → pgrepack / VACUUM FULL. Index: index-bloated (pgstatindex bloat >30% → needs REINDEX, VACUUM can't fix it) · index-unused (idxscan=0 across snapshots → DROP candidate, verify with pgstatstatements first).

Shortened. The full README is on GitHub.

Nothing above is checked by us. What we check is on the safety report.

PG Bloat Detective: common questions

Is PG Bloat Detective MCP server safe?
Yes, by our scan: it is graded A (92/100). Read the PG Bloat Detective safety report
How do I install PG Bloat Detective?
It runs on your machine. Copy the Claude Code, Cursor, VS Code or Claude Desktop config from the install section.
Does PG Bloat Detective need an API key?
No secret keys are declared. It reads 2 settings from the environment.
Is PG Bloat Detective maintained?
The last commit was 5 days ago (2026-10-08). The latest release is v0.1.6.
What can I use instead of PG Bloat Detective?
Servers from other publishers that do the same job: Run402 MCP server, Neon MCP server and PostgreSQL MCP server. Compare all PG Bloat Detective alternatives.

Alternatives to PG Bloat Detective

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

All PG Bloat Detective alternatives →
  • Run402
    x402 pay-per-call infra for agents: $0.03 image generation, Postgres, auth, storage, functions.
    B
  • Neon
    Official Neon MCP server for managing Neon projects and Lakebase Postgres databases.
    A
  • PostgreSQL
    MCP server for PostgreSQL: local, Docker, RDS, Neon, Supabase, or behind an SSH bastion.
    B
  • PostgreSQL MCP Server
    PostgreSQL MCP server - query, schema introspection, explain, and health checks for AI assistants
    B
  • Quarry
    Safety-railed database access: Postgres, MySQL, SQLite, Redis. Read-only by default.
    A

More from r69shabh →