Data as of

Postgres MCP Pro for Cursor: Setup & Config

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

What you can do with Postgres MCP Pro in Cursor

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

  • Evaluate index recommendations against a workload or selected queries.
  • Review database health using a restricted read-only connection.

Before you start: Postgres MCP Pro in Cursor

  • 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 Cursor configuration

  1. Choose Cursor configuration scope

    For Postgres MCP Pro, open Project: .cursor/mcp.json User: ~/.cursor/mcp.json. Merge into mcpServers at project or user scope.

  2. Add Postgres MCP Pro to Cursor

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

  3. Check Postgres MCP Pro in Cursor

    Postgres MCP Pro: Enable in Cursor’s MCP settings; inspect tools.

Config file · Project: .cursor/mcp.json

User: ~/.cursor/mcp.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 Cursor

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

list_schemas

Find list_schemas under Postgres MCP Pro in Cursor's MCP settings; inspect its arguments when the agent requests a call.

Discover schemas available in the PostgreSQL instance.

list_objects

Find list_objects under Postgres MCP Pro in Cursor's MCP settings; inspect its arguments when the agent requests a call.

get_object_details

Find get_object_details under Postgres MCP Pro in Cursor's MCP settings; inspect its arguments when the agent requests a call.

execute_sql

Find execute_sql under Postgres MCP Pro in Cursor's MCP settings; inspect its arguments when the agent requests a call.

explain_query

Find explain_query under Postgres MCP Pro in Cursor's MCP settings; inspect its arguments when the agent requests a call.

get_top_queries

Find get_top_queries under Postgres MCP Pro in Cursor's MCP settings; inspect its arguments when the agent requests a call.

Identify slow statements using pg_stat_statements execution statistics.

analyze_workload_indexes

Find analyze_workload_indexes under Postgres MCP Pro in Cursor's MCP settings; inspect its arguments when the agent requests a call.

Recommend indexes for resource-intensive statements across a workload.

analyze_query_indexes

Find analyze_query_indexes under Postgres MCP Pro in Cursor's MCP settings; inspect its arguments when the agent requests a call.

Recommend indexes for a supplied set of up to ten SQL queries.

analyze_db_health

Find analyze_db_health under Postgres MCP Pro in Cursor's MCP settings; inspect its arguments when the agent requests a call.

Check cache, connections, indexes, constraints, sequences, and vacuum health.

Postgres MCP Pro: full stored tool descriptions

Troubleshooting Postgres MCP Pro in Cursor

  • Cursor must find uvx postgres-mcp (from uv, for Python tools) for Postgres MCP Pro. Enable the project/user entry in MCP settings and inspect its tools.
  • Review DATABASE_URI for Postgres MCP Pro before sharing project .cursor/mcp.json; project scope travels with the repository.
  • Postgres MCP Pro uses stdio here: Cursor 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 Cursor troubleshooting lives in the /clients/cursor guide.

Postgres MCP Pro — details. Cursor guide

Frequently asked questions

Cursor's Postgres MCP Pro entry belongs under mcpServers in .cursor/mcp.json (project) or ~/.cursor/mcp.json (user). Confirm the active scope in MCP settings.