talira

Postgres MCP Pro

A Postgres MCP server with index tuning, explain plans, health checks, and safe SQL execution

open sourceMITself-hostablefreeMCP

Postgres MCP Pro is Crystal DBA's MIT-licensed MCP server, written in Python, that gives AI agents in Claude Desktop, Cursor, Windsurf and other clients access to a PostgreSQL database along with tools to tune it. Besides listing schemas and objects and running SQL, it reports the slowest queries from pg_stat_statements, recommends indexes for a workload or for up to 10 queries using a version of Microsoft's Anytime algorithm for database tuning, simulates hypothetical indexes in EXPLAIN plans with hypopg, and runs deterministic health checks (buffer cache, connections, constraints, duplicate, unused or invalid indexes, sequences and vacuum) that build on PgHero's. Unrestricted mode allows reads and writes for development; restricted mode runs SQL in read-only transactions with an execution time limit for production. It installs with pipx or uv as postgres-mcp, or as a Docker image, and speaks stdio and SSE; it has no vector or hybrid search tools.

Problems it solves

  • let my AI coding assistant query our production Postgres without any way to change data
  • find out which indexes to add to speed up my slow Postgres queries
  • ask an agent why my app's database is slow and get recommendations backed by the real query planner
  • test whether a new Postgres index would help a query before creating it on production
  • check my Postgres database for unused or duplicate indexes, vacuum problems and sequences close to their limit
  • see the slowest queries in my database from pg_stat_statements by asking my AI assistant
  • give Cursor or Claude full read and write access to my local development database to fix slow ORM queries
  • an MCP server for Postgres that runs in Docker and connects to RDS, Cloud SQL or Azure databases
  • stop an AI agent's SQL queries from running too long against our production database

Features

  • list_schemas, list_objects and get_object_details for schema context
  • execute_sql, read-only in restricted mode
  • explain_query, with hypothetical indexes through hypopg
  • get_top_queries from pg_stat_statements by total or mean execution time
  • analyze_workload_indexes and analyze_query_indexes (up to 10 queries): index recommendations from an Anytime database tuning advisor search
  • analyze_db_health: buffer cache hit rates, connections, constraints, duplicate, unused or invalid indexes, sequence limits and vacuum health
  • unrestricted (read/write) and restricted (read-only transactions, execution time limit) access modes
  • stdio and SSE transports
  • Docker image remaps localhost to the host automatically
  • tested on Postgres 15, 16 and 17

Limitations

  • No vector or hybrid search tools: its tools cover schemas, SQL, EXPLAIN plans, index tuning and health checks1

Capabilities

Has an MCP serverplan not known

Alternatives

The same job

These do what Postgres MCP Pro does.

  1. PgHero A performance dashboard for Postgres
  2. pgEdge Postgres MCP Server A PostgreSQL MCP server with a Natural Language Agent CLI and Web UI
  3. MCP Toolbox for Databases An open source MCP server for databases
  4. Supabase MCP Server Supabase's official MCP server: connect AI assistants to your Supabase projects

Compare Postgres MCP Pro with the top 3