Last updated: 10/21/2026Last verified: 2026-08-30
Open-source, read-only PostgreSQL observability CLI for developers and AI agents. It analyzes native database statistics, reports health and query findings, and exposes deterministic diagnostics through MCP for agent workflows.
What is pgbot?
pgbot is an open-source PostgreSQL observability CLI designed for developers and AI agent workflows. It connects to PostgreSQL in a read-only manner, analyzes native database statistics, and reports health and query-related findings. The tool also exposes deterministic diagnostics through an MCP server, making it useful for structured agent-based inspection tasks.
Key Features
- Uses a read-only PostgreSQL connection to inspect native database statistics
- Reports health findings across PostgreSQL databases without requiring write access
- Analyzes query performance, locks, indexes, vacuum activity, replication, and database growth
- Provides deterministic inspect and unused-index diagnostics through a stdio MCP server
- Supports optional AI-powered ask and explain commands
- Keeps core diagnostic workflows local while making AI assistance optional
- Designed for both developer CLI usage and AI agent observability workflows
Best For
Pricing
pgbot is listed as a free tool. Because it is open source, users should review the project website or repository for current licensing details, installation requirements, and any optional service costs that may apply to AI-powered commands.
Pros & Cons
Pros
- Free and open-source based on the provided tool information
- Read-only database access model reduces the need for write permissions during inspection
- Covers several PostgreSQL observability areas, including queries, locks, indexes, replication, vacuum activity, and growth
- MCP support makes diagnostics accessible to AI agents in a structured way
- Deterministic inspect and unused-index diagnostics can support repeatable workflows
- Optional AI commands allow teams to use explanation features without depending on AI for every diagnostic
Cons
- Focused specifically on PostgreSQL, so it is not a general-purpose database observability tool
- May require PostgreSQL statistics to be available and properly configured for meaningful findings
- CLI-first workflows may be less suitable for users who prefer dashboard-based monitoring
- The provided information does not describe alerting, historical dashboards, or hosted team collaboration features
- AI-powered ask and explain commands may require additional configuration not detailed in the provided information
Alternatives
Cursor is an AI coding environment that can help developers inspect code, generate database-related queries, and work with agent-style workflows, although it is not a dedicated PostgreSQL observability CLI.
GitHub Copilot is an AI coding assistant that can help write SQL, explain database code, and support developer productivity inside popular IDEs.
Continue is an open-source AI coding assistant that can be configured with different models and workflows, making it relevant for developers building AI-assisted engineering processes.
Sourcegraph Cody is an AI coding assistant focused on code understanding and developer productivity, which can complement database-related development tasks.
JetBrains AI Assistant supports AI-assisted development across JetBrains IDEs, including environments where developers may work with SQL and database-backed applications.
FAQ
Details
Platform
Features
- Reads PostgreSQL statistics with a read-only connection and reports health findings
- Analyzes query performance, locks, indexes, vacuum activity, replication, and database growth
- Exposes deterministic inspect and unused-index diagnostics through a stdio MCP server
- Provides optional AI-powered ask and explain commands while keeping core diagnostics local
Languages
Known limitations
- Works only with PostgreSQL and requires a read-only role with the documented monitoring permissions
- The project labels its versioned JSON contract as beta, so integrations should pin and validate the schema
- AI-powered ask and explain features require a configured OpenAI or Gemini key and explicit confirmation for outbound calls





