메뉴
HN
Hacker News • 31일 전

pgbot: 사람과 AI 에이전트를 위한 5.9MB 읽기 전용 Postgres 도구

IMP
6/10
핵심 요약

pgbot은 5.9MB 크기의 오픈소스(Go) 읽기 전용 PostgreSQL 진단 도구로, 데이터베이스 상태·쿼리 성능·인덱스·vacuum 등을 분석해 대시보드 대신 해답을 제공합니다. 자연어로 질문하면 AI가 실제 DB 신호 기반으로 원인 분석과 권장 사항을 설명해주며, MCP(Model Context Protocol)를 통해 Claude Desktop, Cursor 등 AI 에이전트의 도구로도 사용할 수 있습니다. 읽기 전용으로 설계되어 프로덕션 환경에서도 안전하게 쓸 수 있다는 점이 핵심입니다.

번역된 본문

오픈소스 · Go · AI 에이전트와 앱을 위한 무료 Postgres 인텔리전스. 아무도 데이터베이스 메트릭을 읽지 않습니다. pgbot이 대신 읽어줍니다. PostgreSQL에 연결하면 대시보드가 아니라 해답을 얻을 수 있습니다: 무엇이 건강하고, 무엇이 고장 났으며, 무엇을 먼저 고쳐야 하는지.

설치는 간단합니다: $ curl -fsSL https://pgbot.dev/install | sh

Supabase, Neon, RDS, PlanetScale 같은 퍼블릭 클라우드 DB에는 직접 연결하고, Docker, Kubernetes, 사설 서버, VPC 같은 프라이빗 환경에서는 데이터베이스가 네트워크를 벗어나지 않도록 에이전트를 DB 옆에 실행하는 두 가지 연결 방식을 제공합니다.

주요 기능: 01 실시간 데이터베이스 상태 확인 — 연결, 잠금(lock), 트랜잭션, 캐시 히트율, 복제, WAL 및 전반적인 DB 건강 상태 모니터링 02 쿼리 성능 이해 — PostgreSQL 통계를 활용해 느린 쿼리, 성능 회귀, 처리량, 쿼리 지연 시간, 비용이 큰 SQL 추적 03 테이블과 인덱스 점검 — 테이블 증가, 인덱스 사용률, 미사용 인덱스, 누락된 인덱스, vacuum 활동, 스토리지 패턴 분석 04 AI 기반 인사이트 — 일상 언어로 pgbot에게 질문하면 실제 DB 신호 기반의 요약, 설명, 권장 사항 제공 05 모든 PostgreSQL과 호환 — 퍼블릭 DB 직접 연결 또는 Docker, Kubernetes, 사내 서버 등 프라이빗 환경용 pgBot 에이전트 사용 06 안전한 프로덕션 사용 설계 — 읽기 전용 접근, 오픈소스 에이전트, DB를 외부에 노출하지 않는 프라이빗 배포 지원

MCP — 에이전트 도구로서의 pgbot: pgbot mcp는 stdio에서 Model Context Protocol을 사용하므로 AI 에이전트가 pgbot을 읽기 전용 도구로 호출할 수 있습니다. 결정론적(deterministic) 도구만 노출하며 — inspect(전체 분석 결과를 JSON으로)와 unused_indexes — 설명은 연결된 모델이 담당합니다. Gemini API 키가 필요 없고, 에이전트가 CLI가 계산한 동일한 분석 결과를 근거로 추론합니다. Claude Desktop/Code, Cursor 등 모든 MCP 클라이언트에 추가할 수 있습니다.

설정 예시: { "mcpServers": { "pgbot": { "command": "pgbot", "args": ["mcp"], "env": { "DATABASE_URL": "postgres://pgbot_ro@host:5432/db" } } } }

구조적으로 읽기 전용: DATABASE_URL이 설정되면 에이전트는 인자 없이 inspect를 호출하고, 호출마다 connection_string을 전달해 여러 DB에 접근할 수도 있습니다. pgbot은 절대 쓰기를 하지 않으므로 에이전트가 이를 통해 망칠 수 있는 것은 없습니다.

도구·프롬프트·리소스: 한 번의 클릭으로 "점검 후 우선순위가 매겨진 진단을 제공"하는 diagnose 프롬프트와, pgbot이 로컬 이력을 가진 DB 목록을 보여주는 pgbot://baselines 리소스도 노출합니다.\n 핵심 기능: PostgreSQL 건강 모니터링, 쿼리 성능 분석, 느린 쿼리 및 회귀 감지, 잠금 및 블로킹 쿼리 인사이트, 테이블/인덱스 분석, vacuum 및 autovacuum 가시성, DB 증가 추적, AI 근본 원인 분석, AI 기반 권장 사항, 직접 연결 또는 에이전트 기반 프라이빗 접근.

왜 pgBot인가: 단순 메트릭이 아니라 맥락을 제공합니다. 무엇이 변경됐고 왜 중요한지 이해하도록 돕습니다. 대시보드가 아니라 설명을 제공합니다. 일상 언어로 질문하고 실행 가능한 답을 얻으세요. 호스티드 Postgres 전용이 아닙니다. Supabase, Neon, RDS, Docker, Kubernetes, 사설 서버에서 모두 사용 가능합니다. 단순 관측(observability)이 아니라 AI DBA입니다. 문제를 더 빨리 찾고 더 나은 결정을 내리는 인사이트를 얻으세요. 데이터베이스를 지정하기만 하면 됩니다. 기본적으로 읽기 전용이며, 명시하지 않는 한 인프라 외부로 나가는 것은 없습니다.

원문 보기
원문 보기 (영어)
Open source · Go · FREE Postgres intelligence for AI agents & apps. Nobody reads database metrics. pgbot does. pgbot — inspect — 96×32 ➜ ~ pgbot pgbot inspect --full pgbot indexes pgbot tables help pgbot ask "why is it slow?" live demo — type a command above see the real CLI → Connect your Postgres. Get answers, not dashboards: what's healthy, what's broken, and what to fix first. curl npm brew $ curl -fsSL https://pgbot.dev/install | sh copy pgbot How it connects · MCP · Features · Docs · GitHub · Changelog Works with any cloud: pgrun How it connects Two paths to the same place: connect directly over the wire, or run the agent next to a database that never leaves your network. pgbot.dev │ ┌───────────────────┴───────────────────┐ │ │ Direct PostgreSQL access pgBot agent │ │ Supabase · Neon · RDS Docker · Kubernetes PlanetScale · public DBs Private servers · VPC │ │ └───────────────────┬───────────────────┘ ▼ PostgreSQL Features Connect any PostgreSQL database and get visibility into performance, queries, health, schema, and changes — with AI-powered explanations. 01 See database health in real time Monitor connections, locks, transactions, cache hit ratio, replication, WAL, and overall database health. 02 Understand query performance Track slow queries, regressions, throughput, query latency, and expensive SQL using PostgreSQL statistics. 03 Inspect tables and indexes Analyze table growth, index usage, unused indexes, missing indexes, vacuum activity, and storage patterns. 04 Get AI-powered insights Ask pgBot questions in plain English and get summaries, explanations, and recommendations based on real database signals. 05 Works with any PostgreSQL Connect directly to public databases or use the pgBot Agent for private environments like Docker, Kubernetes, and internal servers. 06 Built for secure production use Read-only access, open-source agent, and support for private deployments without exposing your database publicly. MCP — use pgbot as an agent tool pgbot mcp speaks the Model Context Protocol on stdio, so an AI agent can call pgbot as a read-only tool. It exposes deterministic tools only — inspect (full findings as JSON) and unused_indexes — and lets the connected model do the explaining. No Gemini key involved: the agent reasons over the same findings the CLI computes. Add it to any MCP client (Claude Desktop/Code, Cursor, …) { "mcpServers" : { "pgbot" : { "command" : "pgbot" , "args" : [ "mcp" ], "env" : { "DATABASE_URL" : "postgres://pgbot_ro@host:5432/db" } } } } Read-only by construction With DATABASE_URL set, the agent calls inspect with no arguments; or it can pass connection_string per call to reach several databases. pgbot never writes, so there's nothing an agent can break through it. Tools, prompts, and resources It also exposes a diagnose prompt — a one-click "inspect and give me a prioritized diagnosis" workflow — and a pgbot://baselines resource listing the databases pgbot has local history for. Core features + PostgreSQL health monitoring + Query performance analysis + Slow query and regression detection + Locks and blocking query insights + Table and index analytics + Vacuum and autovacuum visibility + Database growth tracking + AI root-cause analysis + AI-powered recommendations + Direct connection or agent-based private access Why pgBot Not just metrics. Context. pgBot helps you understand what changed and why it matters. Not just dashboards. Explanations. Ask questions in plain English and get actionable answers. Not just for hosted Postgres. Use pgBot with Supabase, Neon, RDS, Docker, Kubernetes, and private servers. Not just observability. An AI DBA. Get insights that help you find issues faster and make better decisions. Point it at a database. Read-only by default. Nothing leaves your infrastructure unless you say so. Connect your Postgres View on GitHub pgbot 550