a-lafon

Postgres Dba MCP — Data skill for Claude Code

Data community

Read-only PostgreSQL MCP server for AI agents: ten DBA tools (SQL, EXPLAIN with hypothetical indexes, top queries, health checks, locks), bounded CSV results, one static Go binary.

How to install Postgres Dba MCP

This entry records only its repository, not the path inside it, so there is no exact command to give. Open a-lafon/postgres-dba-mcp and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

What Postgres Dba MCP does

Read-only PostgreSQL MCP server for AI agents: ten DBA tools (SQL, EXPLAIN with hypothetical indexes, top queries, health checks, locks), bounded CSV results, one static Go binary. Drop-in replacement for crystaldba/postgres-mcp.

Alternatives in Data

  • Context Mode — Benchmark Results — Benchmarked against real outputs from popular Claude Code MCP servers, Skills, and dev tools 5.6k ★
  • Growth Lab — An end-to-end growth tool that understands the product, fetch the data it needs, researches the market, execut 2k ★
  • Agentsview — Local-first session intelligence and analytics for coding agents, supporting Claude Code, Codex, and 14 other 824 ★

README

postgres-dba-mcp

Bounded, read-only Postgres MCP server

Three Claude Code questions on the Pagila sample database: execute_sql returns the top films by revenue as compact CSV with a row-count footer, analyze_db_health finds duplicate indexes on the payment partitions, and explain_query with a hypothetical index shows the estimated cost of a query dropping from 310 to 34

Let Claude Code, Codex or any MCP client explore a PostgreSQL database, run SQL, read query plans, test hypothetical indexes, find the slowest queries and check the database's health, without flooding the model's context or escaping read-only mode.

A Model Context Protocol server that gives an AI client compact, bounded access to one PostgreSQL database. It is a drop-in replacement for [crystaldba/postgres-mcp](https://github.com/crystaldba/postgres-mcp) 0.3.0, with crystaldba's nine tools and parameters unchanged, plus a tenth, `analyze_locks`; switching is one line of client configuration, and [MIGRATION.md](MIGRATION.md) lists what changes.

Why a bounded, read-only Postgres MCP server

  • Bounded, announced results. Compact CSV with an explicit footer. Every result is capped in rows, bytes and cell length, and every cut is announced.
  • A restricted mode, on by default. Each statement is parsed with PostgreSQL's own parser (libpg_query), every function it names is checked wherever it stands, and it runs inside a read-only transaction.
  • One static Go binary that starts in milliseconds.

Measured against crystaldba/postgres-mcp 0.3.0

On a PostgreSQL 17 database, as a read-only role, on 2026-11-01:

  • 131 of 131 attack statements refused in restricted mode;
  • 9 MB of memory