---
title: "Postgres MCP Pro: setup for Claude, Cursor, Codex · DotsAgent"
description: "Postgres queries, schema inspection, index tuning and health checks, replacing the archived reference server. Set up Postgres MCP Pro in 13 MCP clients."
url: https://dotsagent.io/mcp/servers/postgres-mcp-pro
---

Data · Crystal DBA

# Set up Postgres MCP Pro

Postgres queries, schema inspection, index tuning and health checks, replacing the archived reference server.

- **Publisher**: Crystal DBA Community
- **Run locally**: `uvx postgres-mcp --access-mode=restricted`
- **Transports**: stdio, sse
- **Authentication**: A Postgres connection string in DATABASE_URI.
- **Environment**: `DATABASE_URI`
- **What it can touch**: Restricted mode is read-only; unrestricted mode reads and writes.
- **Licence**: MIT
- **Source**: [github.com/crystaldba/postgres-mcp](https://github.com/crystaldba/postgres-mcp)
- **Status**: Active

## Install

This server runs on your machine as a child process of the client. You need the runtime its command uses, such as Node.js for npx, uv for uvx or Docker, plus any variables listed under Environment.

### Claude Code

`shell`

```
claude mcp add --scope project --env DATABASE_URI='<DATABASE_URI>' postgres-mcp-pro -- uvx postgres-mcp --access-mode=restricted
```

### Cursor

`.cursor/mcp.json`

```
{
  "mcpServers": {
    "postgres-mcp-pro": {
      "command": "uvx",
      "args": [
        "postgres-mcp",
        "--access-mode=restricted"
      ],
      "env": {
        "DATABASE_URI": "${env:DATABASE_URI}"
      }
    }
  }
}
```

### Codex

`~/.codex/config.toml`

```
[mcp_servers.postgres-mcp-pro]
command = "uvx"
args = ["postgres-mcp", "--access-mode=restricted"]
env_vars = ["DATABASE_URI"]
```

[Config for other clients →](https://dotsagent.io/mcp/config#add=postgres-mcp-pro)

Keep --access-mode=restricted for any database you care about; unrestricted mode lets the agent write.

## Other servers in data

- [Airtable](https://dotsagent.io/mcp/servers/airtable): Query, create and update records in Airtable bases, limited to the bases you authorise.

- [BigQuery](https://dotsagent.io/mcp/servers/google-bigquery): Google-hosted endpoint to explore BigQuery datasets and run SQL. Cloud SQL and Spanner have their own.

- [MCP Toolbox for Databases](https://dotsagent.io/mcp/servers/mcp-toolbox-databases): One server with prebuilt tool sets for Postgres, MySQL, BigQuery, AlloyDB, Spanner and other databases.

- [Supabase](https://dotsagent.io/mcp/servers/supabase): Manage Supabase projects from an agent: run SQL, apply migrations, read logs and deploy Edge Functions.

- [Neon](https://dotsagent.io/mcp/servers/neon): Create Neon Postgres projects and branches, run SQL and do branch-based migrations. Meant for development use.

- [MongoDB](https://dotsagent.io/mcp/servers/mongodb): Query and administer MongoDB databases and Atlas clusters, using a connection string or an Atlas service account.

## Sources

1. [github.com](https://github.com/crystaldba/postgres-mcp)/crystaldba/postgres-mcp

Independent reference for people who build AI agents. Not affiliated with any vendor named here.

© 2026 DotsAgent · Facts checked October 1, 2026
