pgops MCP server
Safe, audited PostgreSQL operations for AI agents: queries, migrations, EXPLAIN, containers
0 stars
Reviews
Write oneNobody has reviewed pgops yet.
If you have run it, two minutes of your experience saves the next person an afternoon.
pgops tools (18, 3 write)
write = sends, deletes, buys or postsRead from the package source without running it. The installed server may list more.
container.execwrite actionRun a read-only diagnostic command inside a container. Requires --approval-mode AND a confirmation token, and the command must be in the diagnostic allowlist — this tool does not offer an arbitrary shell.
container.logsTail a container's logs, optionally filtered to a minimum Postgres severity (DEBUG/INFO/NOTICE/LOG/WARNING/ERROR/FATAL/PANIC).
container.restartRestart a container. Requires --approval-mode AND a confirmation token. Dropping connections is disruptive; relay the reason to the user first.
container.statsCPU, memory and IO snapshot for a container. Takes about a second: a CPU percentage requires two samples to compute a delta.
db.healthHealth snapshot: connections, cache hit ratio, dead tuples, long-running queries, waiting locks — each finding with a severity and explanation.
env.correlateJoin db.health findings with the database container's resource usage and return plain-language hints about whether container pressure explains the database's symptoms.
env.topologyDiscover containers, compose projects, ports and health, and identify which container serves this server's DSN (matched by published host port).
index.adviseIndex recommendations: unused indexes, redundant indexes, sequential-scan hotspots, and the slowest statements by total time.
migration.applyApply a plan produced by migration.plan.
migration.describePlan a schema change described in plain English.
migration.historyApplied-migration history from the ledger, including any interrupted (in_flight) migration. Each entry carries the `ledger_id` that migration.rollback and migration.resolve take.
migration.planPlan a migration from a target schema. Executes nothing.
migration.resolveClose out an interrupted (in_flight) migration, unblocking further ones.
migration.rollbackReverse an applied migration by its ledger id (from migration.history).
query.explainExplain a statement and return the plan plus actionable verdicts.
query.readwrite actionExecute a read-only statement (SELECT/WITH/EXPLAIN only).
query.writewrite actionExecute a mutating statement (INSERT/UPDATE/DELETE/DDL).
schema.inspectInspect database structure: tables, columns, indexes, constraints, sizes.
Public scan report
scanner v0.1.9 · 2026-09-20 · same rubric, same numbers if you re-run it
- Code scan36 source files scanned25/25
- –Live reliabilityno gateway calls yet and no remote to proben/a
- –Tool poisoningtools not inspected (local package is not executed); not countedn/a
- Auth qualitystatic API keys via environment variables6/15
- Maintenancelast push 19 days ago15/15
- Maintainer identityregistry namespace matches repository owner; GitHub account older than a year8/10
Install directly
claude mcp add pgops-mcp -- uvx pgops-mcp
pgops: common questions
- Is pgops MCP server safe?
- Mostly: it is graded B (83/100). Read the pgops safety report
- How do I install pgops?
- It runs on your machine. Copy the Claude Code, Claude Desktop or Cursor config from the install section.
- Does pgops need an API key?
- Yes. The registry entry asks for
PGOPS_DSN,PGOPS_READONLY_DSN. - Is pgops maintained?
- The last commit was 19 days ago (2026-09-01). The latest release is v0.1.9.