DEDUPED Hot AI repos. Real use cases. What people build. Get the Monday 5

How to let Claude Code read PostgreSQL findings over MCP with Pgbot

Connect an AI coding agent to structured database findings through the Pgbot MCP server.

Short answer: Install Pgbot with curl -fsSL https://pgbot.dev/install | sh; then set the read-only connection with export DATABASE_URL="postgres://pgbot_ro@host:5432/db"; start the MCP server with pgbot mcp. All steps.

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

  1. Install Pgbot with curl -fsSL https://pgbot.dev/install | sh.
  2. Set the read-only connection with export DATABASE_URL="postgres://pgbot_ro@host:5432/db".
  3. Start the MCP server with pgbot mcp.
  4. Register the server with Claude Code, or install the Pgbot Claude Code plugin, as described in the README MCP section.
  5. 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

Cursor, ChatGPT, others

Share: X LinkedIn Hacker News Email Copy link

Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer