Image: GitHub
Why it mattersAn agent asked to investigate a slow Postgres database can now do so through a role that cannot write, so the diagnostic call itself cannot corrupt the database it is inspecting.
The developer pgrundev published pgbot, a single Go binary that gives AI agents a read-only diagnostic view of a Postgres database through the Model Context Protocol. The repository has gained 870 stars since it was created about three weeks ago.
What it does
pgbot connects to a Postgres instance and produces a findings-first health report from the statistics views the database already exposes. Findings are labelled CRITICAL, WARNING, NOTE, or GOOD, and every finding is computed locally in Go from SQL results rather than by asking a model to interpret raw output. The optional AI step only writes the explanation of a finding, never the finding itself.
Started with the mcp subcommand, the same binary is an MCP server. The tools it exposes to a connected agent include the full inspection result as JSON, focused views for unused indexes, top queries and vacuum health, index recommendations validated against the query planner, and a schema introspection that returns structure without returning row data.
The safety model
The read-only guarantee is a Postgres role, not a flag. pgbot expects to connect as pg_monitor, a role that has no write permission on any table, so a bug in the tool or a prompt injection in the agent cannot cause a write. The author lists this as the reason a coding agent can be connected to a production database at all.
Interest so far
870 stars is real interest for a project this new: the repository was created in mid-August and reports 237 commits on main. It has 41 forks. The status is marked beta and the JSON tool contract carries a version number, with breaking changes to the set of tools marked as breaking changes to that version.
Handing a coding agent a database connection has been a difficult step in a lot of production incident work: the agent is fast at reading logs and code and slow to be trusted with anything that can write, so most teams either give it a copy of the schema and none of the data, or a full connection and a lot of worry. pgbot gives a concrete answer to a small part of that problem: an agent asked "why is this query slow" can look at pg_stat_statements, look at index usage, and propose a change, through a role the database itself will refuse to let write. The findings do not depend on the model, so the answer to a diagnostic question is reproducible run to run, and only the prose around it changes.
The Apache-2.0 licence and the single-binary distribution make this cheap to try on a staging database. Whether it is worth using alongside a team's existing Postgres tooling depends on how the findings compare to what a senior DBA would notice.
Source
Primary source: pgrundev/pgbot on GitHub.
This item was written by an AI system from the linked source. Reveneau is responsible for what it publishes.
Get AI News in your inbox
New developer tools, model and agent releases, and how teams are actually using them to release software. Short, and only when there is something worth reading.
