Postgres MCP Pro
Open-source Postgres MCP server with deterministic health checks, index tuning, and safe SQL execution.
Backend developers and DBAs who want an AI assistant that can safely explore, explain, and tune a real Postgres database in development or production with reproducible, algorithmic index recommendations.
Teams on non-Postgres databases, users who need fine-grained row/column ACLs, or anyone wanting a hosted GUI dashboard rather than an MCP server wired into an AI IDE.
Postgres MCP Pro is an open-source Model Context Protocol (MCP) server from Crystal DBA that gives AI coding assistants like Claude Desktop, Cursor, Windsurf, Cline, Goose, and Qodo Gen a rich, opinionated interface into a PostgreSQL database. Instead of merely wrapping a connection and letting the LLM improvise, it exposes a set of deterministic tools for schema exploration, query execution, EXPLAIN plans, workload analysis, and comprehensive database health checks (index health, buffer cache hit rate, connection utilization, vacuum/transaction-id wraparound risk, replication lag, invalid constraints, sequence limits). Its standout feature is principled index tuning: it enumerates candidate multi-column indexes, uses the hypopg extension to simulate their effect on real query plans, and runs a greedy Anytime-style search adapted from Microsoft's SQL Server Tuning Advisor to recommend a Pareto-optimal set of indexes given a storage budget. An experimental Optimization-by-LLM mode can substitute the search heuristic with an iterative LLM proposer (requires OPENAI_API_KEY). Safe SQL execution is enforced by parsing statements with pglast and running them inside read-only transactions in restricted mode, blocking COMMIT/ROLLBACK escape hatches. It ships as a Docker image or PyPI package, speaks both stdio and SSE transports, uses psycopg3 under the hood, and works against Postgres 13-17 including RDS, Azure, and Cloud SQL where pg_stat_statements and hypopg can be enabled. Ideal for developers who want their AI agent to genuinely reason about performance rather than guess.
This is the Postgres MCP server I would actually trust to touch a production database. The combination of pglast-guarded read-only transactions and hypopg-backed index simulation puts it in a different league from the reference server that just executes whatever SQL the model emits. The experimental LLM tuner is a nice bonus, but the classical Anytime search is the real value.
— The AI Tool Bible editorial team
Pros
- ✅ Deterministic index tuning based on the Anytime Algorithm plus hypopg what-if simulation, not LLM guesswork
- ✅ Comprehensive PgHero-derived health checks covering bloat, cache, connections, vacuum, replication, and sequences
- ✅ Restricted mode enforces read-only transactions and blocks COMMIT/ROLLBACK escapes via pglast SQL parsing
- ✅ Works with any MCP client (Claude Desktop, Cursor, Windsurf, Cline, Goose, Qodo Gen) and supports both stdio and SSE transports
- ✅ MIT-licensed and free; installs via Docker, pipx, uvx, or uv with clear per-client config recipes
- ✅ Cost-benefit index selection along the Pareto front with configurable performance-vs-storage threshold
- ✅ Actively maintained by Crystal DBA with Discord community and public roadmap on GitHub
Cons
- ⚠️ Postgres-only; no MySQL, SQL Server, or other database support
- ⚠️ Full-featured tuning requires pg_stat_statements and hypopg extensions, which self-managed installs may need to install manually
- ⚠️ Only two coarse access modes (unrestricted vs restricted) with no per-table or column-level ACLs
- ⚠️ Credentials are supplied at startup via DATABASE_URI, so switching databases means restarting the server
- ⚠️ Experimental LLM-based index tuning requires an OpenAI API key and adds external cost/latency
- ⚠️ Workload compression is basic (query normalization, equal weighting), which can misrank importance in complex workloads
Use cases
Explore related
Compare with similar tools
All in MCP Servers →Airtable MCP Server
Model Context Protocol server that gives LLMs full read/write access to your Airtable bases.
Apple Notes MCP
Let Claude read your local Apple Notes over the Model Context Protocol.
AWS MCP Servers
Official AWS Labs collection of Model Context Protocol servers for connecting AI coding assistants and agents to AWS services and documentation.
Azure MCP Server
Official Microsoft MCP server that exposes 40+ Azure services to AI agents under the developer's own Entra ID credentials.
Blender MCP
Give Claude hands inside Blender — an MCP server for natural-language 3D modeling.
Brave Search MCP
Give any MCP client web and local search powered by the Brave Search API.