All MCP Servers
Dev Tools & GitMCP RegistrypypiB · 71

Postgres AIops MCP server

io.github.AIops-tools · Updated

Governed PostgreSQL DBA ops: slow-query RCA, bloat/vacuum & blocking-lock analysis; 35 MCP tools.

At a glance

Postgres AIops is an MCP server in the Dev Tools & Git category. It runs locally over stdio via `uvx postgres-aiops`, and declares no required credentials. It scores B (71/100) on the MCP Skills Hub health score as of Oct 28, 2026.

Source 0GitHub stars

One-click install

Opens your editor and pre-fills the config. Your editor will ask before adding it.

How to install Postgres AIops in your AI client

Setup for Claude Code, Claude Desktop, Cursor, Codex, Windsurf, Cline and VS Code — copy-paste ready.

How to install Postgres AIops in Claude CodeAnthropic's agentic CLI

  1. Add the server

    bash
    claude mcp add postgres-aiops -- uvx postgres-aiops
  2. Verify it's connected

    bash
    claude mcp list
  3. Sharing it with your team?

    Add `--scope project` to write it to .mcp.json in the repository root, which you can commit (with the secrets left as environment variables).

  4. Use it in a session

    Ask Claude to use the tools this server exposes. It discovers them automatically.

What tools does Postgres AIops expose?

This server runs as a local package. We only query remote servers for their tool list — asking this one would mean executing it, so its tools are listed in the documentation below.

What the code can do

Source analysis currently covers npm packages only. This server ships as a Python package, which needs a different parser.

Before you install

Signals gathered from the source repo and package registry — not a safety verdict.

What it can reach

  • Runs code on your machine — Executes as a local process with your user's permissions, including filesystem access.
  • Downloads at launch — The package is fetched from its registry each run unless you pin a version.
  • Last commit 14 days ago — Actively maintained.
  • 0 GitHub stars — Very little community usage so far.

Client compatibility

Claude Code: NativeClaude Desktop: NativeCursor: NativeCodex CLI: NativeWindsurf: NativeCline: NativeVS Code: Native

Health score

B · 71

Maintenance, adoption, transparency and packaging — not a safety audit. How this is calculated

  • Maintenance30%100%

    Last commit 14 days ago.

  • Adoption20%0%

    0 stars.

  • Transparency20%75%

    3/4: ✓ public source repo, ✓ declared license, ✓ documentation, ✗ discoverable tool list.

  • Provenance15%75%

    Links to its own repository; package linkage unverified.

  • Packaging15%100%

    Publishes a pinned version (0.12.0).

Documentation

Full README

Postgres AIops

Disclaimer: Community-maintained open-source project. Not affiliated with, endorsed by, or sponsored by the PostgreSQL Global Development Group or any vendor. "PostgreSQL" and the elephant logo are trademarks of the PostgreSQL Community Association; all product/trademark names belong to their respective owners. MIT licensed.

Governed AI-ops for PostgreSQL DBA operations — connecting to a server with psycopg 3 and reading the system catalogs and pg_stat_* views — with a built-in governance harness: unified audit log, token/runaway budget guard, undo-token recording, and descriptive risk-tier labels. Beyond the mock test suite, the reads, a governed write, and its undo have been exercised against a live PostgreSQL 16.14 instance — see `docs/VERIFICATION.md`.

What it does

Three flagship signature analyses, plus the guarded reads and writes around them:

  • Slow-query RCA — take the worst pg_stat_statements entry (plus an optional

EXPLAIN plan) and map its numbers — mean time, cache-hit ratio, temp spill, call count, plan node types — to a cited cause and a concrete action. Every finding carries its measured number, not a black-box verdict.

  • Bloat & vacuum analysis — combine per-table dead-tuple ratio and autovacuum

recency into a ranked, cited recommendation (VACUUM / tune autovacuum).

  • Blocking lock-chain RCA — build the wait-for tree from pg_blocking_pids,

name the root blocker (blocks others, waits on none), and give the action; a cycle is flagged as a likely deadlock.

What works

  • CLI (postgres-aiops ...): init, overview, server, activity, query, index, table, repl, analyze, remediate, secret, doctor, mcp.
  • MCP server (postgres-aiops mcp or postgres-aiops-mcp): 35 tools (25 read, 10 write), every one wrapped with the bundled @governed_tool harness.
  • Encrypted credentials: the role password lives in an encrypted store ~/.postgres-aiops/secrets.enc (Fernet + scrypt) — never plaintext on disk. Unlock with a master password from POSTGRES_AIOPS_MASTER_PASSWORD (MCP/CI) or an interactive prompt (CLI).
  • Reversibility: mutating writes fetch the real before-state first and record a faithful inverse — create_index↔drop_index; drop_index captures pg_get_indexdef so undo recreates it exactly; update_setting captures the prior value so undo sets it back. Irreversible ops (terminate_backend, cancel_query, run_vacuum, run_analyze, reindex, reset_query_stats) record prior stats for audit but declare no undo.
  • Safety: every state-changing CLI op supports --dry-run and requires double confirmation; every write MCP tool takes a dry_run preview. All identifiers that cannot be parameterised (table/index/GUC names) are validated and quoted; all values are bound query parameters.

Capability matrix (35 MCP tools)

Excerpt — the full document is on GitHub.

Maintain Postgres AIops? Add a badge to your README

Shows its health grade, and links readers to install steps for every client.

markdown
[![Postgres AIops on MCP Skills Hub](https://mcp-skills-hub.vercel.app/badge/io-github-aiops-tools-postgres-aiops)](https://mcp-skills-hub.vercel.app/mcps/io-github-aiops-tools-postgres-aiops)

Catalog data refreshed . Something wrong? Report it.