---
title: "postgresql"
description: "Safe, read-only PostgreSQL inspection, query diagnosis, performance analysis, and database health workflows for AI agents, with a bundled HiAI PostgreSQL MCP server."
canonical: https://agentpluginsdirectory.com/plugins/postgresql
last-updated: 2026-09-22
---

# postgresql
Safe, read-only PostgreSQL inspection, query diagnosis, performance analysis, and database health workflows for AI agents, with a bundled HiAI PostgreSQL MCP server.
- Slug: postgresql
- Publisher: HiAI
- Repository: https://github.com/HiAi-gg/agent-plugins
- Manifest: plugins/postgresql/plugin.json
- Version: 0.0.2
- License: MIT
- Category (editorial): databases
- Skills: 5 (diagnose-locks, diagnose-performance, diagnose-query, inspect-database, review-database-health)
- MCP servers: 1 (postgresql)
- Stars: 1
- Repository created: 2026-08-08
- Repository last pushed: 2026-09-03
- Publisher type: Organization
- Listing: https://agentpluginsdirectory.com/plugins/postgresql
- Schema: https://agent-plugins.org/schemas/1.0.0/plugin.schema.json

## What postgresql does, in the publisher's words

Safe, read-only PostgreSQL inspection, query diagnosis, performance analysis, and database health workflows for AI agents.

An Agent Plugin (spec 1.0.0), version 0.0.2.

- Inspects PostgreSQL databases: identity, schemas, tables, columns, relationships, indexes, sizes.
- Diagnoses slow queries with EXPLAIN (FORMAT JSON) (never executes the target statement).
- Investigates performance: activity, long transactions, locks, table health, pg_stat_statements (when available).
- Produces compact health reviews.
- All through a bundled HiAI PostgreSQL MCP server: no third-party PostgreSQL MCP dependency.

Most coding agents already expose filesystem and general tools, but safe PostgreSQL inspection is a distinct capability. This plugin ships a read-only MCP that uses PostgreSQL's own server-side read-only enforcement, not a regex, as the primary safety boundary.

- an AI database administrator,

From the project README, punctuation lightly normalized. Full text: https://raw.githubusercontent.com/HiAi-gg/agent-plugins/HEAD/plugins/postgresql/README.md

## Skills

- diagnose-locks: Diagnose PostgreSQL lock contention: detect blocked sessions, find the blocking session, identify the lock, and explain the cause. Use when queries hang, transactions stall, or the database appears stuck.
- diagnose-performance: Diagnose PostgreSQL performance issues: active sessions, long transactions, locks, table health, sizes, and pg_stat_statements. Use when the database is slow, under load, or when asked for a performance investigation.
- diagnose-query: Diagnose why a PostgreSQL query is slow or suspicious: understand the SQL, inspect tables and indexes, EXPLAIN JSON, and propose measured next steps. Use when a query is slow, timing out, or has a suspicious plan.
- inspect-database: Understand an unfamiliar PostgreSQL database: identity, schemas, important tables, relationships, indexes, and sizes. Use when onboarding to a database, mapping its structure, or before writing queries against it.
- review-database-health: Produce a compact PostgreSQL health review: configuration signals, capacity, maintenance, locks/activity, large relations, and query statistics. Use when asked for an overall database health assessment or a pre-maintenance check.

Descriptions come from the frontmatter of each SKILL.md, punctuation lightly normalized.

## MCP servers

- postgresql: transport: stdio; command: bun run ${PLUGIN_ROOT}/packages/postgres-mcp/src/index.ts

Read from the plugin's own mcp.json. Environment variable names only, never values.
