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.1The 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_DSNEnv var· required· secretState database DSN, connecting as the pgwarden_app role that `pgwarden db init` creates.PGWARDEN_CONFIGEnv var· requiredPath to pgwarden.yaml inside the container.Default:/etc/pgwarden/pgwarden.yamlPGWARDEN_TARGET_DSNEnv var· requiredTarget Postgres 16+ DSN: host, port and database, no user or password.PGWARDEN_ROLE_SECRET_FILEEnv var· requiredFile with the secret that derives each login role's SCRAM password.Default:/etc/pgwarden/secrets/role_secretPGWARDEN_SIGNING_KEY_FILEEnv var· requiredFile with the Ed25519 key that signs access tokens.Default:/etc/pgwarden/secrets/signing_key.pemPGWARDEN_SESSION_SECRET_FILEEnv var· requiredFile with the browser session secret.Default:/etc/pgwarden/secrets/session_secret
Show 3 moreShow fewer
PGWARDEN_OIDC_CLIENT_SECRET_FILEEnv var· requiredFile with the client secret your identity provider issued for pgwarden.Default:/etc/pgwarden/secrets/oidc_client_secret-vArgument· requiredThe directory holding pgwarden.yaml and secrets/ from docs/own-database.md (readable by uid 10001).-pArgument· optionalPublish the gateway's port; MCP clients connect to /mcp on it.
Links
Listed in the official MCP Registry since Nov 21, 2026. Mirrored daily; last checked Nov 26, 2026.