PostgreSQL performance Tuner MCP Server
AI-assisted PostgreSQL tuning over a live database: slow queries, plans, indexes, bloat, and health.
- CCM score
- 78 of 100
- GitHub stars
- 31
- tools
- 16
- transport
- STDIO
- last updated
- Dec 13, 2025
Own this MCP server? Claim it
What it does
- Reads performance data with
get_slow_queries,analyze_query,get_table_stats, andanalyze_disk_io_patterns, plusget_active_queriesandanalyze_wait_eventsfor live sessions - Recommends and tests indexes with
get_index_recommendations,explain_with_indexes, andmanage_hypothetical_indexesvia HypoPG, and flags cleanup candidates withfind_unused_indexes - Requires a PostgreSQL user with pg_stat_statements, pgstattuple, and HypoPG privileges, configured through the DATABASE_URI environment variable
- Designed for DBAs and developers who want guided tuning, bloat checks, and vacuum monitoring without writing the diagnostic queries by hand
Tools
16 toolsPublic tool metadata for what this MCP can expose to an agent.
get_slow_queriesRetrieve slow queries from pg_stat_statements with detailed stats (total time, mean time, calls, cache hit ratio). Excludes system catalog queries.
Retrieve slow queries from pg_stat_statements with detailed stats (total time, mean time, calls, cache hit ratio). Excludes system catalog queries.
No parameter schema in public metadata yet.
analyze_queryAnalyze a query's execution plan with EXPLAIN ANALYZE, including automated issue detection
Analyze a query's execution plan with EXPLAIN ANALYZE, including automated issue detection
No parameter schema in public metadata yet.
get_table_statsGet detailed table statistics including size, row counts, dead tuples, and access patterns
Get detailed table statistics including size, row counts, dead tuples, and access patterns
No parameter schema in public metadata yet.
analyze_disk_io_patternsAnalyze disk I/O read/write patterns, identify hot tables, buffer cache efficiency, and I/O bottlenecks. Supports filtering by analysis type (all, buffer_pool, tables, indexes, temp_files, checkpoints).
Analyze disk I/O read/write patterns, identify hot tables, buffer cache efficiency, and I/O bottlenecks. Supports filtering by analysis type (all, buffer_pool, tables, indexes, temp_files, checkpoints).
No parameter schema in public metadata yet.
get_index_recommendationsAI-powered index recommendations based on query workload analysis
AI-powered index recommendations based on query workload analysis
No parameter schema in public metadata yet.
explain_with_indexesRun EXPLAIN with hypothetical indexes to test improvements without creating real indexes
Run EXPLAIN with hypothetical indexes to test improvements without creating real indexes
No parameter schema in public metadata yet.
manage_hypothetical_indexesCreate, list, drop, or reset HypoPG hypothetical indexes. Supports hide/unhide existing indexes.
Create, list, drop, or reset HypoPG hypothetical indexes. Supports hide/unhide existing indexes.
No parameter schema in public metadata yet.
find_unused_indexesFind unused and duplicate indexes that can be safely dropped
Find unused and duplicate indexes that can be safely dropped
No parameter schema in public metadata yet.
check_database_healthComprehensive health check with scoring (connections, cache, locks, replication, wraparound, disk, checkpoints)
Comprehensive health check with scoring (connections, cache, locks, replication, wraparound, disk, checkpoints)
No parameter schema in public metadata yet.
get_active_queriesMonitor active queries, find long-running transactions and blocked queries. By default excludes system processes.
Monitor active queries, find long-running transactions and blocked queries. By default excludes system processes.
No parameter schema in public metadata yet.
analyze_wait_eventsAnalyze wait events to identify I/O, lock, or CPU bottlenecks. Focuses on client backend processes.
Analyze wait events to identify I/O, lock, or CPU bottlenecks. Focuses on client backend processes.
No parameter schema in public metadata yet.
review_settingsReview PostgreSQL settings by category with optimization recommendations
Review PostgreSQL settings by category with optimization recommendations
No parameter schema in public metadata yet.
analyze_table_bloatAnalyze table bloat using pgstattuple extension. Shows dead tuple counts, free space, and wasted space percentage.
Analyze table bloat using pgstattuple extension. Shows dead tuple counts, free space, and wasted space percentage.
No parameter schema in public metadata yet.
analyze_index_bloatAnalyze B-tree index bloat using pgstatindex. Shows leaf density, fragmentation, and empty/deleted pages. Also supports GIN and Hash indexes.
Analyze B-tree index bloat using pgstatindex. Shows leaf density, fragmentation, and empty/deleted pages. Also supports GIN and Hash indexes.
No parameter schema in public metadata yet.
get_bloat_summaryGet a comprehensive overview of database bloat with top bloated tables/indexes, total reclaimable space, and priority maintenance actions.
Get a comprehensive overview of database bloat with top bloated tables/indexes, total reclaimable space, and priority maintenance actions.
No parameter schema in public metadata yet.
monitor_vacuum_progressTrack manual VACUUM, VACUUM FULL, and autovacuum operations. Monitor progress percentage, dead tuples collected, index vacuum rounds, and estimated time remaining. Includes autovacuum configuration review and tables needing maintenance.
Track manual VACUUM, VACUUM FULL, and autovacuum operations. Monitor progress percentage, dead tuples collected, index vacuum rounds, and estimated time remaining. Includes autovacuum configuration review and tables needing maintenance.
No parameter schema in public metadata yet.
Readme
Details
- Repository
- github.com/isdaniel/pgtuner_mcp
- Categories
- Databases, Monitoring & Observability
- Package
pgtuner-mcp- Transport
- STDIO
- Registry
- MCP registry, active
More from isdaniel
All 2Similar to PostgreSQL performance Tuner MCP Server
More DatabasesPostgres MCP ProMCP servercrystaldba3.5K starsConnects to PostgreSQL databases for schema browsing, SQL execution, query tuning, and health checks.
postgres-performancePlugindashed/claude-marketplace27 starsPostgreSQL query & performance tuning. Use when a query is slow, reading an `EXPLAIN [ANALYZE]` plan (scan/join nodes, estimate skew), choosing an index type/co
sql-query-optimizationSkillaj-geddes/useful-ai-prompts530 installsAnalyze and tune slow PostgreSQL and MySQL queries using plans, indexes, and rewrites.
database-performance-debuggingSkillaj-geddes/useful-ai-prompts501 installsStructured debugging guide that finds slow queries, reviews execution plans, and tunes indexes across major databases.
Pg AiguideMCP servertimescale1.9K starsSemantic and keyword search over PostgreSQL, TimescaleDB, and PostGIS manuals, plus curated best-practice skills.
Greptimedb Mcp ServerMCP servergreptimeteam29 starsQuery GreptimeDB metrics, logs, and traces via SQL and TQL; manage pipelines and dashboards.