Postgres (read-only transactions)

v0.1.3
io.github.Poudel0/postgres-mcp-safe Checked 14 hours ago Published 28 days ago

Drop-in replacement for @modelcontextprotocol/server-postgres that is actually read-only.

npm (npx)

Requires Node.js 18+

Run in a terminal
claude mcp add postgres-mcp-safe -- npx -y postgres-mcp-safe@0.1.3 '<postgresql_url>'
Add to claude_desktop_config.json
{
  "mcpServers": {
    "postgres-mcp-safe": {
      "args": [
        "-y",
        "postgres-mcp-safe@0.1.3",
        "<postgresql_url>"
      ],
      "command": "npx"
    }
  }
}
Add to ~/.cursor/mcp.json
{
  "mcpServers": {
    "postgres-mcp-safe": {
      "args": [
        "-y",
        "postgres-mcp-safe@0.1.3",
        "<postgresql_url>"
      ],
      "command": "npx"
    }
  }
}
Add to .vscode/mcp.json
{
  "servers": {
    "postgres-mcp-safe": {
      "args": [
        "-y",
        "postgres-mcp-safe@0.1.3",
        "<postgresql_url>"
      ],
      "command": "npx",
      "type": "stdio"
    }
  }
}
Add to ~/.codex/config.toml
[mcp_servers.postgres-mcp-safe]
command = "npx"
args = ["-y", "postgres-mcp-safe@0.1.3", "<postgresql_url>"]

Docker

Requires Docker

Run in a terminal
claude mcp add postgres-mcp-safe -- docker run -i --rm ghcr.io/poudel0/postgres-mcp-safe:0.1.3 '<postgresql_url>'
Add to claude_desktop_config.json
{
  "mcpServers": {
    "postgres-mcp-safe": {
      "args": [
        "run",
        "-i",
        "--rm",
        "ghcr.io/poudel0/postgres-mcp-safe:0.1.3",
        "<postgresql_url>"
      ],
      "command": "docker"
    }
  }
}
Add to ~/.cursor/mcp.json
{
  "mcpServers": {
    "postgres-mcp-safe": {
      "args": [
        "run",
        "-i",
        "--rm",
        "ghcr.io/poudel0/postgres-mcp-safe:0.1.3",
        "<postgresql_url>"
      ],
      "command": "docker"
    }
  }
}
Add to .vscode/mcp.json
{
  "servers": {
    "postgres-mcp-safe": {
      "args": [
        "run",
        "-i",
        "--rm",
        "ghcr.io/poudel0/postgres-mcp-safe:0.1.3",
        "<postgresql_url>"
      ],
      "command": "docker",
      "type": "stdio"
    }
  }
}
Add to ~/.codex/config.toml
[mcp_servers.postgres-mcp-safe]
command = "docker"
args = ["run", "-i", "--rm", "ghcr.io/poudel0/postgres-mcp-safe:0.1.3", "<postgresql_url>"]

For AI agents

  1. 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).
  2. Restart or reload the client so it starts the server.
  3. If it fails, check that the required runtime is installed (Node.js 18+) and that the values above are set.

Machine-readable: install.md · manifest.json