Skip to main content

pgwarden

io.github.B0yko/pgwarden

v0.1.1Updated Nov 21, 2026local · Docker

Give AI assistants access to Postgres with per-user permissions and human approval for writes.

Install

Needs 1 secret. Replace 2 placeholders with your own values.

Run in your terminal. Replace 2 placeholders.

claude mcp add pgwarden -e PGWARDEN_CONFIG=/etc/pgwarden/pgwarden.yaml -e 'PGWARDEN_TARGET_DSN=<your-pgwarden-target-dsn>' -e 'PGWARDEN_STATE_DSN=<your-pgwarden-state-dsn>' -e PGWARDEN_ROLE_SECRET_FILE=/etc/pgwarden/secrets/role_secret -e PGWARDEN_SIGNING_KEY_FILE=/etc/pgwarden/secrets/signing_key.pem -e PGWARDEN_SESSION_SECRET_FILE=/etc/pgwarden/secrets/session_secret -e PGWARDEN_OIDC_CLIENT_SECRET_FILE=/etc/pgwarden/secrets/oidc_client_secret -- docker run -i --rm -e PGWARDEN_CONFIG -e PGWARDEN_TARGET_DSN -e PGWARDEN_STATE_DSN -e PGWARDEN_ROLE_SECRET_FILE -e PGWARDEN_SIGNING_KEY_FILE -e PGWARDEN_SESSION_SECRET_FILE -e PGWARDEN_OIDC_CLIENT_SECRET_FILE ghcr.io/b0yko/pgwarden:0.1.1

The registry lists extra launch arguments or environment variables for this server that could change what runs. They are left out here; check its repository before adding any.

Configuration

9 settings, 1 required secret. Snippets use placeholders; keep real values out of shared config.

  • PGWARDEN_STATE_DSN
    Env var· required· secret
    State database DSN, connecting as the pgwarden_app role that `pgwarden db init` creates.
  • PGWARDEN_CONFIG
    Env var· required
    Path to pgwarden.yaml inside the container.Default: /etc/pgwarden/pgwarden.yaml
  • PGWARDEN_TARGET_DSN
    Env var· required
    Target Postgres 16+ DSN: host, port and database, no user or password.
  • PGWARDEN_ROLE_SECRET_FILE
    Env var· required
    File with the secret that derives each login role's SCRAM password.Default: /etc/pgwarden/secrets/role_secret
  • PGWARDEN_SIGNING_KEY_FILE
    Env var· required
    File with the Ed25519 key that signs access tokens.Default: /etc/pgwarden/secrets/signing_key.pem
  • PGWARDEN_SESSION_SECRET_FILE
    Env var· required
    File with the browser session secret.Default: /etc/pgwarden/secrets/session_secret
Show 3 more
  • PGWARDEN_OIDC_CLIENT_SECRET_FILE
    Env var· required
    File with the client secret your identity provider issued for pgwarden.Default: /etc/pgwarden/secrets/oidc_client_secret
  • -v
    Argument· required
    The directory holding pgwarden.yaml and secrets/ from docs/own-database.md (readable by uid 10001).
  • -p
    Argument· optional
    Publish the gateway's port; MCP clients connect to /mcp on it.

Listed in the official MCP Registry since Nov 21, 2026. Mirrored daily; last checked Nov 26, 2026.