Skip to content

postgres-mcp

MIT★ 3.5kupdated 17 Aug 2026

Postgres MCP Pro provides configurable read/write access and performance analysis for you and your AI agents.

What can you do with postgres-mcp?

  • list_schemas — Lists all database schemas available in the PostgreSQL instance.
  • list_objects — Lists database objects (tables, views, sequences, extensions) within a specified schema.
  • get_object_details — Provides information about a specific database object, for example, a table's columns, constraints, and indexes.
  • execute_sql — Executes SQL statements on the database, with read-only limitations when connected in restricted mode.
  • 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.
  • get_top_queries — Reports the slowest SQL queries based on total execution time using pgstatstatements data.

Tool descriptions from the project's README, checked 16 Nov 2026.

About postgres-mcp

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. Postgres MCP Pro does much more than wrap a database connection.

Opening text of the project's README, checked 16 Nov 2026.

Install

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

Config as documented in its source, checked 16 Nov 2026. Placeholders such as API keys are the project's own: replace them with your values.

Requirements listed

  • Access credentials for your database.
  • Docker or Python 3.12 or higher.

Tools (9)

list_schemasLists all database schemas available in the PostgreSQL instance.
list_objectsLists database objects (tables, views, sequences, extensions) within a specified schema.
get_object_detailsProvides information about a specific database object, for example, a table's columns, constraints, and indexes.
execute_sqlExecutes SQL statements on the database, with read-only limitations when connected in restricted mode.
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.
get_top_queriesReports the slowest SQL queries based on total execution time using pgstatstatements data.
analyze_workload_indexesAnalyzes the database workload to identify resource-intensive queries, then recommends optimal indexes for them.
analyze_query_indexesAnalyzes a list of specific SQL queries (up to 10) and recommends optimal indexes for them.
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.

Tool names from the README, checked 16 Nov 2026.

postgres-mcp compared with other Postgres servers

ServerLicenceToolsLast commitStars
postgres-mcpMIT917 Aug 20263,476
MCP-PostgreSQL-OpsMIT3714 Nov 2026164
PostgreSQLMIT616 Sept 202625

Every value is a checked fact on that server's own page. This is a comparison of facts, not a ranking.

Verified facts

Maintainer
crystaldba

Source · checked 16 Nov 2026

Licence
MIT

Source · checked 16 Nov 2026

Setup documented for
  • Claude Desktop
  • Cursor
  • Windsurf
  • Cline

Source · checked 16 Nov 2026

Repository
github.com/crystaldba/postgres-mcp

Source · checked 16 Nov 2026

Last commit
17 Aug 2026

Source · checked 16 Nov 2026

GitHub stars
3,476

Source · checked 16 Nov 2026

Open issues
96

Source · checked 16 Nov 2026

Each value links to where it was found and shows the date it was checked. How we verify

Frequently asked questions

What does postgres-mcp do?

Postgres MCP Pro provides configurable read/write access and performance analysis for you and your AI agents.

Which MCP clients does postgres-mcp document setup for?

Its README documents setup for Claude Desktop, Cursor, Windsurf, Cline.

How do I install postgres-mcp?

Add the install config shown on this page to your MCP client's configuration. Check the README for client-specific steps.

What licence is postgres-mcp under?

MIT, as reported by the repository on 16 Nov 2026.

Is postgres-mcp still maintained?

The last commit was on 17 Aug 2026, and the repository had 96 open issues.

What tools does postgres-mcp expose?

9 tools: list_schemas, list_objects, get_object_details, execute_sql, explain_query, get_top_queries, analyze_workload_indexes, analyze_query_indexes, analyze_db_health.

More Postgres MCP servers