PostgreSQL Official MCP Server MCP Configuration

Read-only schema inspection, table relation discovery, and parameterized SQL query execution for PostgreSQL databases across Cursor, Claude Desktop, and VS Code.

Select Blueprint

Transport: stdio · 14ms schema reflection / 22ms parameterized query round-trip
PostgreSQL Official MCP Server @modelcontextprotocol/server-postgres
Install.sh
{
  "mcpServers": {
    "postgres": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-postgres",
        "postgresql://readonly_user:password@localhost:5432/production_db"
      ],
      "env": {
        "PGSSLMODE": "require"
      }
    }
  }
}
Ready 5-client compiler ready · postgres

Environment Variables for PostgreSQL Official MCP Server

Variable Key Requirement Example Format Guidance
PGSSLMODE Optional require Enforce TLS verification when connecting to managed cloud PostgreSQL instances (Neon, RDS, Supabase).

Recurring & Sponsor Tiers

Team Registry Pro
$19/mo · 25 developer seats
Weekly Ecosystem Sponsor
$99/wk · Header & llms.txt slot