pgtuner_mcp

MCP.Pizza Chef: isdaniel

This server brings AI-powered performance tuning to your PostgreSQL database through MCP-compatible apps like Claude Desktop. It helps you find slow queries, get index recommendations, analyze execution plans, and monitor database health. You need to install it with developer tools like Python and Docker, connect it to your PostgreSQL 12+ database, and enable some extensions. Once set up, it provides actionable insights to improve your database speed and reliability.

Data
Other

Use This MCP server To

Find slow queries in my PostgreSQL database Get AI-powered index recommendations Analyze query execution plans for bottlenecks Monitor database health and connection usage Track vacuum and autovacuum performance Detect I/O bottlenecks and cache hit ratios Review PostgreSQL configuration and get tuning tips

README

PostgreSQL Performance Tuning MCP

PyPI - Version PyPI - Downloads Python 3.10+ Pepy Total Downloads Docker Pulls

A Model Context Protocol (MCP) server that provides AI-powered PostgreSQL performance tuning capabilities. This server helps identify slow queries, recommend optimal indexes, analyze execution plans, and leverage HypoPG for hypothetical index testing.

Features

Query Analysis

  • Retrieve slow queries from pg_stat_statements with detailed statistics
  • Analyze query execution plans with EXPLAIN and EXPLAIN ANALYZE
  • Identify performance bottlenecks with automated plan analysis
  • Monitor active queries and detect long-running transactions

Index Tuning

  • AI-powered index recommendations based on query workload analysis
  • Hypothetical index testing with HypoPG extension (no disk usage)
  • Find unused and duplicate indexes for cleanup
  • Estimate index sizes before creation
  • Test query plans with proposed indexes before implementing

pgtuner_mcp FAQ

Can I use this to identify slow PostgreSQL queries?
Yes — it analyzes your database's query stats to find slow queries and suggests improvements.
Can I get index recommendations for my PostgreSQL database?
Yes — it uses AI to recommend indexes based on your workload and can test hypothetical indexes without changing your data.
Does this work with Claude Desktop?
Yes — it is designed to be used with MCP clients like Claude Desktop.
Do I need an API key or account to use this?
No — but you need access to your PostgreSQL database and to install the server, which requires some developer setup.
How hard is it to set up?
It requires developer-level setup, including installing Python 3.10+, PostgreSQL 12+, and configuring permissions and extensions.
What PostgreSQL versions are supported?
PostgreSQL 12 and above are supported, with version 14+ recommended for best results.
What extensions do I need?
You must enable pg_stat_statements for query analysis and optionally HypoPG for hypothetical index testing.