Data as of

Postgres MCP Pro for Claude Desktop: Setup & Config

Give Claude Desktop PostgreSQL schema access, SQL execution, health checks, and performance analysis.

What you can do with Postgres MCP Pro in Claude Desktop

Pick PostgreSQL tooling that goes beyond queries into health checks, plans, and index evaluation.

  • Inspect tables, views, constraints, and indexes before writing SQL.
  • Investigate slow queries with execution plans and statistics.

Before you start: Postgres MCP Pro in Claude Desktop

  • Python 3.12+ for this launch path
  • uv with uvx
  • PostgreSQL database access credentials
  • An MCP-compatible client

The README supports this restricted replacement for its unrestricted example. pg_stat_statements and hypopg are optional database extensions needed for fuller performance and index analysis. Docker is also documented.

Postgres MCP Pro Claude Desktop configuration

  1. Choose Claude Desktop configuration scope

    For Postgres MCP Pro, open macOS: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%\Claude\claude_desktop_config.json. Merge under mcpServers via Settings → Developer → Edit Config when available.

  2. Add Postgres MCP Pro to Claude Desktop

    Use the postgres-mcp entry below in mcpServers. Keep Postgres MCP Pro's documented stdio connection fields and your other Claude Desktop entries.

  3. Check Postgres MCP Pro in Claude Desktop

    Postgres MCP Pro: Fully quit and reopen Claude Desktop; check developer diagnostics.

Config file · macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

Windows: %APPDATA%\Claude\claude_desktop_config.json

JSON
{
  "mcpServers": {
    "postgres-mcp": {
      "command": "uvx",
      "args": [
        "postgres-mcp",
        "--access-mode=restricted"
      ],
      "env": {
        "DATABASE_URI": "<PostgreSQL connection URI with your database credentials>"
      }
    }
  }
}

Postgres MCP Pro tools available to Claude Desktop

Postgres MCP Pro's stored tool list documents 9 tools; compare it with Claude Desktop's connected tool list, because the stored list is not a live check.

list_schemas

When Claude Desktop requests list_schemas from Postgres MCP Pro, review the action before approving it.

Discover schemas available in the PostgreSQL instance.

list_objects

When Claude Desktop requests list_objects from Postgres MCP Pro, review the action before approving it.

Inspect tables, views, sequences, and extensions within a schema.

get_object_details

When Claude Desktop requests get_object_details from Postgres MCP Pro, review the action before approving it.

Read an object's columns, indexes, constraints, and related structural details.

execute_sql

When Claude Desktop requests execute_sql from Postgres MCP Pro, review the action before approving it.

Run SQL statements subject to the configured access restrictions.

explain_query

When Claude Desktop requests explain_query from Postgres MCP Pro, review the action before approving it.

Inspect a query plan and optionally evaluate hypothetical indexes.

get_top_queries

When Claude Desktop requests get_top_queries from Postgres MCP Pro, review the action before approving it.

analyze_workload_indexes

When Claude Desktop requests analyze_workload_indexes from Postgres MCP Pro, review the action before approving it.

analyze_query_indexes

When Claude Desktop requests analyze_query_indexes from Postgres MCP Pro, review the action before approving it.

analyze_db_health

When Claude Desktop requests analyze_db_health from Postgres MCP Pro, review the action before approving it.

Postgres MCP Pro: full stored tool descriptions

Troubleshooting Postgres MCP Pro in Claude Desktop

  • Fully quit and reopen Claude Desktop for Postgres MCP Pro. If uvx postgres-mcp (from uv, for Python tools) is missing, check the desktop process's PATH, which may differ from your terminal.
  • In Claude Desktop's Postgres MCP Pro entry, check DATABASE_URI. Keep secrets out of shared screenshots and repositories.
  • Postgres MCP Pro uses stdio here: Claude Desktop must keep the configured process running; protocol output belongs on stdout and diagnostics on stderr.
  • Known limitation: Advanced workload and index analysis needs optional Postgres extensions.
  • Known limitation: Unrestricted mode allows data and schema modification.
  • Known limitation: Native Python execution requires Python 3.12 or newer.
  • General Claude Desktop troubleshooting lives in the /clients/claude-desktop guide.

Postgres MCP Pro — details. Claude Desktop guide

Frequently asked questions

Claude Desktop loads Postgres MCP Pro from claude_desktop_config.json: ~/Library/Application Support/Claude/ on macOS, or %APPDATA%\Claude\ on Windows. Open it via Settings → Developer → Edit Config when available.

Claude Desktop's postgres-mcp example uses stdio.

Postgres MCP Pro's Claude Desktop configuration invokes uvx postgres-mcp (from uv, for Python tools).

Claude Desktop's Postgres MCP Pro example references DATABASE_URI. Check these names if startup or authentication fails; the example alone does not distinguish required from optional values.

Postgres MCP Pro's stored list contains 9 tools, including list_schemas, list_objects, get_object_details. Compare those names with Claude Desktop's connected tool list; the stored list is not a live check.

It limits SQL to read-only transactions and constrains execution time, unlike unrestricted mode which permits data and schema writes.

The extensions are optional, but pg_stat_statements and hypopg enable fuller workload statistics and hypothetical index analysis.