A session sitting idle inside a transaction holds its locks, prevents VACUUM from reclaiming dead tuples, and looks completely normal in a connection count. It is a specific piece of operational knowledge encoded as a tool, and the same instinct runs through the rest: unused indexes and missing indexes as separate analyses because they are separate decisions, bloat measured differently per engine because the engines fragment differently. The pairing of analyze_vacuum with bloat and idle-in-transaction is the whole PostgreSQL maintenance story in three calls. Read-only, which is the right scope for a diagnostic.
A database diagnostic layer covering the problems that accumulate silently: index usage, bloat, query plans, slow-query statistics, connection state, foreign-key structure and PostgreSQL maintenance.
- analyze_indexes finds unused indexes wasting space alongside the misuse cases, and suggest_missing_indexes works the other direction — tables with high sequential scan counts and no index usage at all.
- analyze_table_bloat handles both engines properly, checking dead tuple ratios on PostgreSQL and InnoDB fragmentation on MySQL.
- analyze_slow_queries reads pg_stat_statements or the MySQL performance schema, so the answer comes from the server's own accounting rather than from sampling.
- explain_query returns a formatted plan with cost estimates rather than raw EXPLAIN output.
- analyze_connections detects idle-in-transaction sessions specifically — the state that holds locks and blocks VACUUM while looking harmless.
- analyze_vacuum checks dead tuple ratios and vacuum status on PostgreSQL.
- analyze_table_relationships builds the foreign-key dependency graph.
- inspect_schema lists tables with row counts and sizes, or inspects one in detail.
DATABASE_URL. Everything here reads — the tools inspect and analyse, and none of them alter the schema or the data.
One command plus a key — npx -y mcp-db-analyzer, then supply credentials
