pgops
io.github.arzharch/pgops-mcp
v0.1.9Updated Sep 1, 2026stdio · Dockerstdio · PyPI
Safe, audited PostgreSQL operations for AI agents: queries, migrations, EXPLAIN, containers
Install
Needs 1 secret. Replace 1 placeholder with your own values.
Run in your terminal. Replace 1 placeholder.
claude mcp add pgops-mcp -e 'PGOPS_DSN=<your-pgops-dsn>' -e PGOPS_READ_ONLY=0 -e PGOPS_APPROVAL_MODE=0 -e 'PGOPS_AUDIT_LOG=~/.pgops/audit.jsonl' -e PGOPS_DEFAULT_TIMEOUT_MS=5000 -e PGOPS_MAX_TIMEOUT_MS=30000 -e PGOPS_DEFAULT_ROW_LIMIT=100 -- uvx pgops-mcp==0.1.9Configuration
8 settings, 1 required secret. Snippets use placeholders; keep real values out of shared config.
PGOPS_DSNEnv var· required· secretPostgreSQL connection string for the database to operate on.PGOPS_READONLY_DSNEnv var· optional· secretOptional separate DSN for the read-only pool. Use a role with no write grants to enforce read-only at the database rather than only in the server.PGOPS_READ_ONLYEnv var· optionalSet to 1 to withhold every mutating tool. Write tools are not registered at all, so an agent cannot call them.Default:0PGOPS_APPROVAL_MODEEnv var· optionalSet to 1 to register container.restart and container.exec. Off by default: Docker socket access is root-equivalent on the host.Default:0PGOPS_AUDIT_LOGEnv var· optionalPath to the append-only JSONL audit log.Default:~/.pgops/audit.jsonlPGOPS_DEFAULT_TIMEOUT_MSEnv var· optionalStatement timeout applied to every query unless a tool call overrides it.Default:5000
Show 2 moreShow fewer
PGOPS_MAX_TIMEOUT_MSEnv var· optionalCeiling a caller-supplied timeout is clamped to.Default:30000PGOPS_DEFAULT_ROW_LIMITEnv var· optionalRows returned by query.read when the caller does not specify a limit.Default:100
Links
Listed in the official MCP Registry since Sep 1, 2026. Mirrored daily; last checked Nov 26, 2026.