Who it is forA developer using Claude Code who wants the agent to reason over live PostgreSQL health findings during a debugging session.
The problemAn agent guessing at database state from application code gives weak answers, and pasting terminal output is fragile.
The outcomeThe agent queries the same versioned findings the CLI produces and cites specific tables, queries, and indexes.
What you need first
- A PostgreSQL server version 14 to 18 that you can reach over the network
- A login role with the pg_monitor role and no write grants (pgbot init generates the setup SQL)
- The pgbot binary, installed with the curl install script or npx @pgbot/cli
- Optional: pg_stat_statements for the queries section, and hypopg on PostgreSQL 16+ for advise
Steps
- Install Pgbot with
curl -fsSL https://pgbot.dev/install | sh. - Set the read-only connection with
export DATABASE_URL="postgres://pgbot_ro@host:5432/db". - Start the MCP server with
pgbot mcp. - Register the server with Claude Code, or install the Pgbot Claude Code plugin, as described in the README MCP section.
- Ask the agent to run the inspect findings and summarize the CRITICAL and WARNING items with their sources.
Prompt for your agent
Using the pgrundev/pgbot MCP server running against <target-db-url>, fetch the current health findings and list each CRITICAL and WARNING finding with the table, query, or index it names. Verify that the response includes the contract version 1.5.0 before you act on any finding.
Caveat. The MCP surface exposes the same findings as the CLI, so an agent should not treat the terminal report as the source of truth.
Use this in your AI agent
Ask your agent
Using the Deduped MCP, get the setup steps for pgrundev/pgbot and "Let Claude Code read PostgreSQL findings over MCP"
Add Deduped to Claude Code once
claude mcp add --transport http deduped https://dedupedai.com/mcp
Every Monday: the 5 hottest repos and exactly how to use them. Free, one email a week, unsubscribe anytime.
Get them freeShare: X LinkedIn Hacker News Email Copy link
Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer