Wink Pings

No one reads database metrics. pgbot does.

A 5.9MB Postgres diagnostic tool that connects directly to your database and tells you what's going on in seconds. No dashboards, read-only, open source, MCP-enabled, works with AI agents too.

No one reads database metrics. pgbot does.

This is the first line on the homepage of [pgbot.dev](https://pgbot.dev).

When something goes wrong with your database, the standard workflow is: open your monitoring dashboard, scroll through charts, check slow query logs, then look at CPU and memory. After all that hassle, you still might not know what the problem is.

pgbot takes a different approach. It's a 5.9MB binary that connects directly to your Postgres and tells you what's happening in your database in seconds. No dashboards, no telemetry stack, no extra database required to run it.

It reads from your database, but never writes to it. That's a core design principle.

There are only a handful of core commands:

- pgbot inspect → Database health check

- pgbot queries → Identify expensive queries

- pgbot indexes → Find risky or unused indexes

- pgbot tables → Table-level diagnostics

- pgbot ask "why is it slow?" → Natural language Q&A, for both humans and agents

- pgbot mcp → Let AI coding assistants inspect Postgres directly

pgbot tables deserves a special mention. One command lists the top 30 tables, sorted by dead tuple percentage, sequential scan count, index scan count, size, and row count.

What do these metrics actually tell you? A developer named ActiveRabbit put it perfectly: “A 20GB table isn't necessarily a problem. A 20GB table with 2.7 million sequential scans? That's what you need to look into.”

A high dead tuple percentage means leftover garbage rows from UPDATE/DELETE operations are piling up, and autovacuum might not be keeping up. A high number of sequential scans means queries aren't using indexes. Size tells you how much disk the table takes up — larger tables are usually harder to maintain.

Installation requires no configuration:

```bash

curl -fsSL https://pgbot.dev/install | sh

pgbot inspect

```

It works with any Postgres. Neon, Supabase, AWS RDS, Railway, self-hosted — all you need is a connection string. You can also install it via npm: `npm i @pgbot/cli`.

pgbot's MCP support is another standout feature. It exposes read-only tools via the Model Context Protocol, so AI agents can call pgbot to get structured JSON diagnostic results. Since pgbot never writes to the database, there's no way for an agent to break anything.

A user named ProEvilz asked: “Any AI harness can do this, why do we need pgbot?” pgbot author alex shapalov replied: Any AI harness can query Postgres, but pgbot provides a Postgres-specific diagnostic layer with health checks, query and index analysis, evidence gathering, safety classification, and structured read-only output. No agent needs to reinvent this logic from scratch.

The tool is LLM-agnostic, it works with any model that supports MCP. Krishna Singh commented: “This feels like the right shape for a dev tool: one binary, connects directly, gives you useful answers, no observability platform you have to maintain.”

The project is open source, written in Go, and free, with 265 stars on [GitHub](https://github.com/pgrundev/pgbot). The install script verifies cosign signatures, so you can use it safely in production.

The author also has a thought-provoking line:

Fast is nice. Safe + understandable is better.

That saying holds up way better for database tools than most corporate value statements do.

发布时间: 2026-08-21 09:42