
Postgres MCP Pro
Postgres MCP Pro is a Model Context Protocol server that enables AI agents and developers to interact with PostgreSQL databases throughout the entire development lifecycle. It provides tools for database health analysis, index tuning using industrial-strength algorithms, query plan optimization with EXPLAIN support, schema-aware SQL generation, and safe SQL execution with configurable access controls for both development and production environments. The server solves the problem of integrating comprehensive database optimization and management capabilities into AI-assisted development workflows, supporting both stdio and SSE transports.
- GitHub stars
- 2.8K
- tools
- 9
- last updated
- Mar 9, 2026
Tools
9 toolsPublic tool metadata for what this MCP can expose to an agent.
list_schemasLists all database schemas available in the PostgreSQL instance.
Lists all database schemas available in the PostgreSQL instance.
No parameter schema in public metadata yet.
list_objectsLists database objects (tables, views, sequences, extensions) within a specified schema.
Lists database objects (tables, views, sequences, extensions) within a specified schema.
No parameter schema in public metadata yet.
get_object_detailsProvides information about a specific database object, for example, a table's columns, constraints, and indexes.
Provides information about a specific database object, for example, a table's columns, constraints, and indexes.
No parameter schema in public metadata yet.
execute_sqlExecutes SQL statements on the database, with read-only limitations when connected in restricted mode.
Executes SQL statements on the database, with read-only limitations when connected in restricted mode.
No parameter schema in public metadata yet.
explain_queryGets the execution plan for a SQL query describing how PostgreSQL will process it and exposing the query planner's cost model. Can be invoked with hypothetical indexes to simulate the behavior after adding indexes.
Gets the execution plan for a SQL query describing how PostgreSQL will process it and exposing the query planner's cost model. Can be invoked with hypothetical indexes to simulate the behavior after adding indexes.
No parameter schema in public metadata yet.
get_top_queriesReports the slowest SQL queries based on total execution time using pg_stat_statements data.
Reports the slowest SQL queries based on total execution time using pg_stat_statements data.
No parameter schema in public metadata yet.
analyze_workload_indexesAnalyzes the database workload to identify resource-intensive queries, then recommends optimal indexes for them.
Analyzes the database workload to identify resource-intensive queries, then recommends optimal indexes for them.
No parameter schema in public metadata yet.
analyze_query_indexesAnalyzes a list of specific SQL queries (up to 10) and recommends optimal indexes for them.
Analyzes a list of specific SQL queries (up to 10) and recommends optimal indexes for them.
No parameter schema in public metadata yet.
analyze_db_healthPerforms comprehensive health checks including: buffer cache hit rates, connection health, constraint validation, index health (duplicate/unused/invalid), sequence limits, and vacuum health.
Performs comprehensive health checks including: buffer cache hit rates, connection health, constraint validation, index health (duplicate/unused/invalid), sequence limits, and vacuum health.
No parameter schema in public metadata yet.
Sponsors
Readme
A Postgres MCP server with index tuning, explain plans, health checks, and safe sql execution.
Overview
Details
- Repository
- github.com/crystaldba/postgres-mcp
- Category
- Databases