Skip to main content
MCP server CX Codex

PostgreSQL performance Tuner MCP Server — Claude Code MCP server

MCP server that diagnoses PostgreSQL slow queries and tests hypothetical indexes using HypoPG without writing to disk.

Install into Claude Code · Platform CLI All methods and platforms ↓
claude mcp add pgtuner-mcp -- uvx pgtuner-mcp
Open on GitHub

What PostgreSQL performance Tuner MCP Server does

The server connects to PostgreSQL using the DATABASE_URI environment variable and gathers telemetry from catalog tables. It pulls resource-heavy queries from pg_stat_statements and inspects EXPLAIN ANALYZE outputs. It also tracks lock waits and stalled transactions. A dedicated check monitors autovacuum progress and identifies temporary file spills caused by low work_mem.

Index optimization relies on the HypoPG extension. It builds virtual indexes inside session memory, allowing the planner to test cost reductions before writing changes to disk. Bloat tracking requires pgstattuple.

Without catalog read access such as the pg_read_all_stats role, the server cannot collect query metrics.

What it helps with

  • extract slow queries from pg_stat_statements with execution stats
  • test virtual index impact via HypoPG without allocating storage
  • diagnose autovacuum progress and identify bloated tables
  • inspect lock contention and long-running transactions

Example prompts for the agent

  • Inspect slow queries in pg_stat_statements and point out execution bottlenecks
  • Simulate a candidate index on the orders table using HypoPG and show the plan diff
  • Check autovacuum activity and report tables that require immediate vacuuming

How to install PostgreSQL performance Tuner MCP Server

Platform CLI

claude mcp add pgtuner-mcp -- uvx pgtuner-mcp

uvx runs the command named after the package; if the README names another one, use uvx --from pgtuner-mcp <command>

Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more

Questions about PostgreSQL performance Tuner MCP Server

How do I install PostgreSQL performance Tuner MCP Server in Claude Code?

Run claude mcp add pgtuner-mcp -- uvx pgtuner-mcp in your terminal and configure the DATABASE_URI connection string.

What does this MCP server do?

It equips the assistant with diagnostic tools for PostgreSQL to detect query bottlenecks, verify configuration settings, and simulate indexes.

Is the HypoPG extension required?

Standard query and vacuum monitoring operate without it, but simulating prospective indexes requires hypopg on the target database.

Similar MCP servers

All MCP servers for Data and databases →

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor