Postgres DBA MCP

v0.4.3
io.github.a-lafon/postgres-dba-mcp Checked 17 hours ago Published 7 days ago

Bounded, read-only PostgreSQL access for AI assistants: ten DBA tools, compact CSV output

Values you need

VariableWhat it is
DATABASE_URIrequired secret PostgreSQL connection URI of the database to serve

Docker

Requires Docker

Run in a terminal
claude mcp add postgres-dba-mcp -e 'DATABASE_URI=<DATABASE_URI>' -- docker run -i --rm -e DATABASE_URI ghcr.io/a-lafon/postgres-dba-mcp:0.4.3
Add to claude_desktop_config.json
{
  "mcpServers": {
    "postgres-dba-mcp": {
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "DATABASE_URI",
        "ghcr.io/a-lafon/postgres-dba-mcp:0.4.3"
      ],
      "command": "docker",
      "env": {
        "DATABASE_URI": "<DATABASE_URI>"
      }
    }
  }
}
Add to ~/.cursor/mcp.json
{
  "mcpServers": {
    "postgres-dba-mcp": {
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "DATABASE_URI",
        "ghcr.io/a-lafon/postgres-dba-mcp:0.4.3"
      ],
      "command": "docker",
      "env": {
        "DATABASE_URI": "<DATABASE_URI>"
      }
    }
  }
}
Add to .vscode/mcp.json
{
  "inputs": [
    {
      "description": "DATABASE_URI",
      "id": "database-uri",
      "password": true,
      "type": "promptString"
    }
  ],
  "servers": {
    "postgres-dba-mcp": {
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "DATABASE_URI",
        "ghcr.io/a-lafon/postgres-dba-mcp:0.4.3"
      ],
      "command": "docker",
      "env": {
        "DATABASE_URI": "${input:database-uri}"
      },
      "type": "stdio"
    }
  }
}
Add to ~/.codex/config.toml
[mcp_servers.postgres-dba-mcp]
command = "docker"
args = ["run", "-i", "--rm", "-e", "DATABASE_URI", "ghcr.io/a-lafon/postgres-dba-mcp:0.4.3"]
env = { "DATABASE_URI" = "<DATABASE_URI>" }

For AI agents

  1. Ask the user for: DATABASE_URI. Never invent or guess these values; secrets go into the client config, not into chat logs.
  2. Pick the user's MCP client and apply the matching config from the first install method (it is the one verified by the smoke test when available).
  3. Restart or reload the client so it starts the server.
  4. If it fails, check that the required runtime is installed (Docker) and that the values above are set.

Machine-readable: install.md · manifest.json