Postgres MCP Pro
A self-hosted PostgreSQL MCP server connects AI assistants to databases with index tuning, query plan analysis and configurable read-only access.
Postgres MCP Pro gives AI assistants access to PostgreSQL databases and tools for investigating performance problems. It's for developers and database maintainers who want an assistant to work with actual schema details and query plans.
- Index tuning: Evaluate candidate indexes for a specific query or a database workload, and estimate their effect with hypothetical indexes before creating them.
- Query plans: Review EXPLAIN plans to understand how PostgreSQL executes a query and assess possible performance improvements.
- Database health: Check index health, connection usage, buffer cache, vacuum health, sequence limits and replication lag with checks adapted from PgHero.
- Schema and SQL access: Give assistants details about tables, columns, constraints and indexes, plus SQL execution with configurable access controls, including a read-only mode.
The server runs locally or on a self-hosted server, supports Docker, and is open source under the MIT license. It works with MCP clients such as Cursor, Cline and Windsurf. Multiple clients can share one server through SSE.
Workload analysis requires PostgreSQL's pg_stat_statements extension. Hypothetical index estimates use hypopg and depend on the accuracy of its predictions.