LogoSTMCP
Download
Postgres MCP Pro

Postgres MCP Pro

Postgres MCP Pro is an open source Model Context Protocol (MCP) server built to support you and your AI agents throughout the entire development process—from initial coding, through testing and deployment, and to production tuning and maintenance.

Tools

1. list_schemas

Lists all database schemas available in the PostgreSQL instance.

2. list_objects

Lists database objects (tables, views, sequences, extensions) within a specified schema.

3. get_object_details

Provides information about a specific database object, for example, a table's columns, constraints, and indexes.

4. execute_sql

Executes SQL statements on the database, with read-only limitations when connected in restricted mode.

5. explain_query

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.

6. get_top_queries

Reports the slowest SQL queries based on total execution time using pg_stat_statements data.

7. analyze_workload_indexes

Analyzes the database workload to identify resource-intensive queries, then recommends optimal indexes for them.

8. analyze_query_indexes

Analyzes a list of specific SQL queries (up to 10) and recommends optimal indexes for them.

9. analyze_db_health

Performs comprehensive health checks including: buffer cache hit rates, connection health, constraint validation, index health (duplicate/unused/invalid), sequence limits, and vacuum health.

JSON Config

{
  "mcpServers": {
    "postgres": {
      "command": "uv",
      "args": [
        "run",
        "postgres-mcp",
        "--access-mode=unrestricted"
      ],
      "env": {
        "DATABASE_URI": "postgresql://username:password@localhost:5432/dbname"
      }
    }
  }
}

Useful Links

Information

Categories