Repository navigation
Releases
Releases · alaev-dev/pg-doctor
v0.3.0
Changelog
- 02990dc: Add vacuum_health: what keeps VACUUM from cleaning up, and wraparound (#7) (@alaev-dev)
v0.2.1
Changelog
- a434899: Add the demo GIF; tell users that plans and bloat need SELECT (#3) (@alaev-dev)
- 1a3d7ab: Wait for the replica to receive all WAL; move Actions to Node 24 (#4) (@alaev-dev)
- ec33fed: Add a least-privilege eval: pg-doctor with pg_monitor only (#5) (@alaev-dev)
- 9a55093: Prepare v0.2.1 and publish to the MCP Registry from the release workflow (#6) (@alaev-dev)
v0.2.0
The first public release of pg-doctor: an MCP server that lets AI agents diagnose PostgreSQL without being able to change it.
Install
# Claude Code plugin (skill, subagent, /pg-health command)
claude plugin marketplace add alaev-dev/pg-doctor && claude plugin install pg-doctor@pg-doctor
# any MCP client over stdio: a binary from this release, go install, or the image
go install github.com/alaev-dev/pg-doctor/cmd/pg-doctor@v0.2.0
claude mcp add pg-doctor -- docker run -i --rm -e DATABASE_URL=postgres://pgdoctor:...@host:5432/app ghcr.io/alaev-dev/pg-doctor:0.2.0Give it a role with pg_monitor and nothing else. Try it on a deliberately broken database with docker compose up -d (see the README).
What is in it
- 8 read-only tools:
slow_queries,explain_statement(byqueryid, never by text),list_tables,describe_table,table_bloat,blocking_locks,replication_status,unused_indexes. Plus 2 prompts:diagnose_slow_database,investigate_locks. - Read-only by construction. No tool accepts SQL. Sessions are read-only with a 5 s statement timeout. Tools return statistics, never rows, and query text only with literals already replaced by
$1. - Prompt-injection defence. A comment that tells the agent to drop a table and keep quiet never made Claude drop anything, but it kept Claude silent in 3 of 3 runs. Warnings placed next to the text helped in 1 of 5. pg-doctor now withholds database text that addresses AI agents, and 5 of 5 runs told the user.
- Remote mode. Streamable HTTP with static tokens or OAuth 2.0 introspection (RFC 7662), per-token scopes, per-token rate limits, a JSON audit log and OpenTelemetry traces down to each SQL statement.
- Evals. 6 scenarios plant real faults in PostgreSQL. Claude Code investigates them through MCP, and deterministic checks plus an LLM judge grade the answers. Last run: 17 of 18 trials solved (94%, 95% CI 74–99%). See evals/README.md.
Artifacts
- Binaries for Linux, macOS and Windows on amd64 and arm64, with
checksums.txt. - Image
ghcr.io/alaev-dev/pg-doctor:0.2.0forlinux/amd64andlinux/arm64: distroless, nonroot, 7.7 MB.
Full history: https://github.com/alaev-dev/pg-doctor/commits/v0.2.0