
pgwarden
Gateway access to Postgres as each signed-in user, with database-enforced permissions and approval for writes.
- CCM score
- 82 of 100
- GitHub stars
- 36
- tools
- 4
- auth
- Secret needed
- transport
- HTTP
- env vars
- 7
- last updated
- Nov 21, 2026
Own this MCP server? Claim it
What it does
- Reads data with
whoami,list_tables,describe_table, andquery, each run as the caller's own Postgres role in a read-only transaction - Writes are proposed and held until a named approver confirms them; each call and approval lands in a hash-chained audit log
- Requires OIDC sign-in through your identity provider and a running Postgres 16 or newer; the demo stack runs in Docker
- Designed for teams that want assistants to query shared databases without one credential shared across everyone
Tools
4 toolsPublic tool metadata for what this MCP can expose to an agent.
whoamiShows the signed-in identity and the Postgres role the query runs as.
Shows the signed-in identity and the Postgres role the query runs as.
No parameter schema in public metadata yet.
list_tables
No parameter schema in public metadata yet.
describe_table
No parameter schema in public metadata yet.
query
No parameter schema in public metadata yet.
Configuration
PGWARDEN_CONFIG*default: /etc/pgwarden/pgwarden.yamlPath to pgwarden.yaml inside the container.
PGWARDEN_TARGET_DSN*Target Postgres 16+ DSN: host, port and database, no user or password.
PGWARDEN_STATE_DSN*secretState database DSN, connecting as the pgwarden_app role that `pgwarden db init` creates.
PGWARDEN_ROLE_SECRET_FILE*default: /etc/pgwarden/secrets/role_secretFile with the secret that derives each login role's SCRAM password.
PGWARDEN_SIGNING_KEY_FILE*default: /etc/pgwarden/secrets/signing_key.pemFile with the Ed25519 key that signs access tokens.
PGWARDEN_SESSION_SECRET_FILE*default: /etc/pgwarden/secrets/session_secretFile with the browser session secret.
PGWARDEN_OIDC_CLIENT_SECRET_FILE*default: /etc/pgwarden/secrets/oidc_client_secretFile with the client secret your identity provider issued for pgwarden.
Readme
Details
- Repository
- github.com/b0yko/pgwarden
- Categories
- Databases, Security
- Package
ghcr.io/b0yko/pgwarden:0.1.1- Transport
- HTTP
- Auth
- Required
- Registry
- MCP registry, active
Similar to pgwarden
More Databases
Faucetfaucetdb177 starsTurns SQL databases into REST and MCP access, with CRUD tools, schema introspection, and RBAC controls.
Neonneondatabase667 starsRead and write access to Neon Postgres projects, branches, endpoints, schemas, and queries.
Supabasealexander-zuev837 starsRead, write, and manage a Supabase project's database, schema, logs, and Auth users from chat.
Postgres MCP Procrystaldba3.5K starsConnects to PostgreSQL databases for schema browsing, SQL execution, query tuning, and health checks.
Cloudflarecoleam00304 starsRemote PostgreSQL database access with schema discovery, read-only queries, and GitHub-gated writes.
InsForgeinsforge38 starsBackend platform access for databases, storage, edge functions, and deployments.