đŸ—„ī¸

PostgreSQL

Query local or remote Postgres for dashboards and reports.

Category: Database
Difficulty: Advanced
Rank: #9

Quick Configuration

Choose the setup that matches your environment.

Before You Start

  • Confirm you have the account, endpoint, or API key required for PostgreSQL.
  • Start with minimum scopes and read-only access where possible.
  • Keep secrets in environment variables instead of hardcoding them in JSON.

Hosted / Remote

JSON
Hosted Config json
{
  "postgresql": {
    "url": "https://YOUR_POSTGRESQL_MCP_ENDPOINT"
  }
}

Local CLI (npx)

JSON
Local Config json
{
  "postgresql": {
    "command": "npx",
    "args": ["-y", "mcp-remote", "https://YOUR_POSTGRESQL_MCP_ENDPOINT"],
    "env": {
      "POSTGRESQL_API_KEY": "YOUR_POSTGRESQL_API_KEY"
    }
  }
}

Common Pitfalls & Fixes

  • âš ī¸ Watch out: Connection strings, SSL, schema discovery.
  • 🔑 Always store API keys in environment variables, never hardcode them in JSON.
  • đŸ›Ąī¸ Start with read-only scopes if available to verify connection safely.

Example Prompts

Once connected, try these prompts to test capabilities:

  • List tables in the database schema.
  • Run a sample query to fetch the latest 5 records.
  • Describe the columns in the users table.

Verification Checklist

  • Run 1-2 real prompts to confirm PostgreSQL returns usable data.
  • Check that error messages are clear enough for troubleshooting.
  • Document the required scopes, dependencies, and env vars for future reuse.