{
 "schema_version": 1,
 "generated": "2026-10-20",
 "id": "pgrundev-pgbot--let-claude-code-read-postgres-findings",
 "repo": "pgrundev/pgbot",
 "repo_url": "https://github.com/pgrundev/pgbot",
 "repo_slug": "pgrundev-pgbot",
 "title": "Let Claude Code read PostgreSQL findings over MCP",
 "page_title": "How to let Claude Code read PostgreSQL findings over MCP with Pgbot",
 "summary": "Connect an AI coding agent to structured database findings through the Pgbot MCP server.",
 "who": "A developer using Claude Code who wants the agent to reason over live PostgreSQL health findings during a debugging session.",
 "problem": "An agent guessing at database state from application code gives weak answers, and pasting terminal output is fragile.",
 "outcome": "The agent queries the same versioned findings the CLI produces and cites specific tables, queries, and indexes.",
 "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."
 ],
 "agent_prompt": "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.",
 "agents": [
  "claude-code"
 ],
 "difficulty": "Intermediate",
 "time": "30 minutes",
 "basis": "readme",
 "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.",
 "category": "Software and DevOps",
 "tags": [
  "Software and DevOps"
 ],
 "lang": "go",
 "requirements": [
  "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"
 ],
 "risk": "none",
 "seen_in_the_wild": false,
 "mentioned_publicly": false,
 "risks": [],
 "best": false,
 "score": 0.6,
 "evidence": [],
 "url": "https://dedupedai.com/use-cases/pgrundev-pgbot/let-claude-code-read-postgres-findings/",
 "md": "https://dedupedai.com/use-cases/pgrundev-pgbot/let-claude-code-read-postgres-findings/index.md",
 "disclaimer": "Deduped lists open-source repositories that belong to other people. We do not own, maintain, audit, or vouch for any of them, and a repo appearing here is not an endorsement or a safety check. The use cases, steps, and prompts are written by AI and may be incomplete, outdated, or just wrong. Where a use case is marked \"Seen in the wild\", we link to public posts where someone described something similar, but we have not verified those posts and the use case itself is still our AI's own write-up. Use all of this at your own risk. Only run code, commands, or agents on systems and accounts you are authorized to use, and read the code and every command before you run it, especially anything that touches credentials, files, or the network. Nothing here is professional, security, legal, or financial advice. All trademarks and project names belong to their respective owners, and their use here does not imply affiliation. Content is provided as is, without warranties of any kind. Found a mistake, a safety problem, or something you want removed? Email hello@dedupedai.com and we will look at it promptly.",
 "api": "https://dedupedai.com/api/v1/usecases/pgrundev-pgbot--let-claude-code-read-postgres-findings.json",
 "api_version": "v1"
}
