Favicon of Postgres MCP Pro

Postgres MCP Pro

An open-source Postgres MCP server that runs locally or on your server, with index tuning, database health checks and configurable SQL access. MIT licensed.

Postgres MCP Pro is a self-hosted MCP server that gives AI assistants access to PostgreSQL alongside tools for diagnosing slow queries and testing index recommendations. It's for developers and database maintainers who want their assistant to work with the database's actual schema, query statistics and execution plans. It runs through Docker or Python and is open source under the MIT license.

Its tuning tools use established search algorithms and PostgreSQL's query planner to evaluate candidate indexes. With hypopg, it can estimate how an index would affect a query before creating it. Workload analysis uses pg_stat_statements to identify queries that consume the most execution time; it can also recommend indexes for specific queries. These performance capabilities depend on the database extensions.

Access is configurable. Read/write mode lets an agent change data and schema, while restricted mode limits it to read-only transactions with execution time constraints. Schema inspection exposes tables, columns, constraints and existing indexes so an assistant has concrete context for writing SQL.

Health checks adapted from PgHero examine unused or invalid indexes, connection usage, buffer cache performance, vacuum health and sequence limits. The server works with Claude Desktop, Cursor, Windsurf and other MCP clients. It can run locally alongside a client or on a server shared by multiple clients through SSE.

Similar to Postgres MCP Pro