Postgres logo

Postgres MCP Server

CommunityDatabase

Postgres MCP servers connect to a PostgreSQL database for read and write SQL, schema inspection and query analysis. It is community-maintained. Works in Claude, Cursor and Claude Code.

Postgres

What Postgres can do

Postgres MCP servers connect to a PostgreSQL database for read
Write SQL, schema inspection
Query analysis

Tools Postgres exposes

6 tools · from docs

The exact tools this MCP server gives your AI.

queryRun a read-only SQL queryread
executeRun a write SQL statementwrite
list_schemasList schemasread
list_tablesList tables in a schemaread
describe_tableDescribe a table's columnsread
explain_queryExplain a query planread

Try asking Claude

Example prompts once Postgres is connected.

Ask questions of a Postgres database in plain language.
Inspect a schema.
Tune a slow query.

Set up Postgres

Pick your client. Every snippet is copy-ready.

Claude Desktop → Settings → Developer → Edit Config (claude_desktop_config.json).

{
  "mcpServers": {
    "postgres": {
      "command": "npx",
      "args": [
        "-y",
        "@crystaldba/postgres-mcp"
      ]
    }
  }
}

Permissions & safety

Read & writeAuth: Connection string

Can change data via: execute

Runs locally, so your data stays on your machine and only what the AI needs is sent to the model.

To stay safe, connect with least-privilege scopes and use a read-only credential where the service supports one.

Troubleshooting

“command not found” when the client starts the server
Install the runtime it needs (Node.js for npx, uv for uvx) and make sure it’s on your PATH.
Tools don’t appear after adding it
Fully restart the client (Claude Desktop, Cursor). Local servers load on startup.
A tool returns nothing for your Postgres data
Confirm the account you authorised actually contains that data, and that your plan includes it.

FAQ

Postgres is a local server, so you add it with a command: run "claude mcp add postgres -- npx -y @crystaldba/postgres-mcp", then restart Claude. See the config snippet above for Cursor and VS Code.

More Database MCP servers

Postgres compared

A
Written by Ari · Founder

Running a digital business since 2019 and a local SEO agency, Ari built and shipped GBPAudit.AI as a Claude connector. Every server here is connected and its tools read before it's listed.

Something wrong with this listing? Report it.