dotsagent.io
Language:English
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
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 →

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

Other servers in data

Sources

  1. github.com/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