Skip to content
MCP server
Registry

pgman MCP Server

PostgreSQL for coding agents: schema, read-only queries, EXPLAIN, masked dumps, confirmed writes.

pgman scores 63 (Good), licensed Apache-2.0 and written in Rust. It installs as a local process. It does not declare tools yet. Filed under Databases. GitHub shows 0 stars. Install configs are generated for 10 clients. Being listed in the registry is not the same as being vendor-official.

by tombaldwinApache-2.0Rust0 stars
Trust score
63Good
Trust score 63 of 100, Good

Good trust

63 of 100 from six public signals. Nobody can buy a point.

  • Listed in the official MCP registry.
  • OSI-style license: apache-2.0.
How we score trust
Scorecard

License, quality and maintenance

How grades work
Trust breakdown

Where the 63 comes from

22 + 20 + 0 + 10 + 4 + 7 = 63. Each factor is capped, so no single signal can carry a listing.

Registry22 / 30

Active in the official MCP registry, plus a known vendor namespace.

Registry: 22 of 30 points.
Maintenance20 / 20

How recently the repository saw a commit or release.

Maintenance: 20 of 20 points.
Popularity0 / 20

GitHub stars and weekly downloads, on a log scale.

Popularity: 0 of 20 points.
License10 / 10

A clear, OSI-style open-source license.

License: 10 of 10 points.
Security4 / 10

Not archived, a secure install path, a pinned version.

Security: 4 of 10 points.
Docs7 / 10

A real summary, a README with depth, listed tools.

Docs: 7 of 10 points.

Install

Pick your client, copy the config, paste it in.

Needs Cursor or VS Code installed on this device. The button opens the app and asks you to confirm before it adds the server.

~/Library/Application Support/Claude/claude_desktop_config.json
{  "mcpServers": {    "tombaldwin-pgman": {      "command": "npx",      "args": [        "-y",        "pgman@0.5.5"      ]    }  }}

Environment variables

This server does not declare environment variables.

Tools show up when the registry metadata or the repository README lists them. Public READMEs are read directly. A GitHub token is used only when one is already configured.

About

pgman

CI license status: beta

A k9s-style terminal UI for PostgreSQL 10 and newer, wherever it runs: every database in every environment on one screen, guarded queries, safe migrations, masked copies of production, and logs turned back into runnable SQL (Postgres server logs, Hibernate logs and pasted JDBC, offline, with N+1 detection). Teams on AWS or the JVM get extras: RDS and Aurora discovery, Secrets Manager, bastions, and connections from Spring and IntelliJ. Sibling project to ebman.

⚠️ Beta

pgman is beta — expect rough edges and breaking changes. It defaults to read-only connections and routes every write through per-statement safety guards, but don't point it at a production database without reviewing your safety.toml first. Bug reports and feedback very welcome — open an issue.

Install: brew install tombaldwin/tap/pgman or cargo install pgman --locked (more) · try it with no database: pgman --demo.

pgman demo — paste a Hibernate log, ctrl-l to reconstruct queries, N+1 clusters, load + run

Captured from pgman --demo, the synthetic-data mode baked into the binary (no database needed). Regenerate after a code change with vhs demo.tape.

At a glance:

  • Every environment on one screen — E lists each environment's databases (dev, staging, prod…) with replicas under their primary, from RDS, docker or hand-listed connections, without connecting. Enter connects (replicas read-only, the password read from AWS Secrets Manager at that moment, through the bastion when there is one); opt-in probes add versions, migration level, pending patches, lag, sessions and size; pgman env discover proposes the whole file from an AWS account. See docs/environments.md.
  • Applying patches — P plans an environment's pending patches read-only, checks each against your guard rails, and after you confirm runs each in its own transaction; a dry run or a throwaway copy rehearses it first; pgman apply does the same from the command line (and pgman execute runs one counted INSERT, UPDATE or DELETE), and pgman run runs a script that manages its own transactions (docs/run.md). l shows the RDS server's recent errors.
  • Dump and restore — pgman dump staging/ledger runs your own pg_dump through pgman's connection (from the replica, the password read at that moment, through the bastion; nothing secret on a command line or on disk), and pgman restore puts it into a local database, never a protected one. Production is dumped masked — emails, names, phones and free text replaced as they are read, joins intact — and every copy is tracked until it is deleted (pgman copies). See docs/dump-restore.md.
  • For your coding agent — pgman mcp serve gives Claude Code (or any MCP client) read-only tools for queries, lock pre-flights, pending patches, schema lint and environments, plus apply_patches, a one-off execute, dump and restore, each confirmed by you. See docs/mcp.md.
  • Connect fast — auto-discovers datasources from Spring application*.yml/.properties, IntelliJ .idea/dataSources.xml, and a committed .pgman/pgman.toml.
  • Logs / pasted code → runnable SQL — Hibernate logs, Postgres/RDS server logs, and pasted JDBC, with N+1 detection — see "Logs and pasted code → runnable SQL" below.
  • Safe by default — read-only connections, statement_timeout, and per-database guard rails on every statement.
  • Edit and page results — u on a result cell edits it in place: a one-row UPDATE by primary key, shown in the same safety confirm as any statement you run. M fetches the next 1000 rows of a SELECT through a server-side cursor.
  • Editor — syntax highlighting, completion, formatting, history, saved queries (:param prompts, rename, search), DBUnit fixture apply + capture.
  • DBA panels — schema browser, EXPLAIN tree, slow queries, active sessions/locks, schema-lint wizard with a config advisor (RDS / Aurora parameter names), result diff.
  • JDBC tap — live app-side queries from any JVM over OpenTelemetry, with hotspots and live N+1 detection. A dedicated Java library adding per-caller, per-pool and per-transaction views is planned.
  • Screenshots — --demo runs the whole tool against a synthetic billing database, and --redact blocks out hosts, accounts and server names on a real one.

Logs and pasted code → runnable SQL

Point it at a Postgres database, then turn logs and pasted code into runnable SQL:

  • Hibernate logs → runnable SQL. Reconstruct executable statements from org.hibernate.SQL lines plus the separately-logged bind parameters. Needs bind-parameter trace logging turned on (org.hibernate.orm.jdbc.bind at TRACE on Hibernate 6, org.hibernate.type.descriptor.sql.BasicBinder at TRACE on Hibernate 5) — without it you still get the statement, just with ? placeholders instead of substituted values.
  • Postgres / RDS server logs → runnable SQL. Reconstruct from log_statement output plus DETAIL: parameters: $1 = … lines (the more reliable source — it needs no application redeploy).
  • Pasted JDBC → runnable SQL. No log needed — a ?-placeholder statement plus a typed parameter list (TYPE:value per line) reconstructs the same way.
  • N+1 detection. Cluster reconstructed queries by shape to surface loop-driven selects.

Three ways in: paste a log into the editor, press ctrl-l (or F8), pick a query — Enter loads it terminated with ;, and a second Enter runs it; skip the paste and launch straight into the reconstructed queries with pgman --log app.log; or, with no log at all, paste a ?-placeholder statement plus its typed parameter list. Walkthrough: docs/logs-to-sql.md.

Run it inside a Spring project and it picks up spring.datasource.* to connect.

Project config (commit this)

Drop a .pgman/pgman.toml at the root of your repo. pgman walks up from the current directory to find it, so launching pgman from any subdirectory of the project works.

# .pgman/pgman.toml — commit this. No passwords here.
# Passwords come from the variable a connection's password_env names.
# PGPASSWORD is only used with --dsn, never for a discovered connection.

[[connections]]
name = "local"
url  = "postgres://postgres@localhost:5432/myapp"

[[connections]]
name = "staging"
url  = "postgres://stg-db.internal:5432/myapp"
user = "app"
password_env = "STAGING_DB_PASSWORD"   # env var holding the password

# Per-database safety overrides. These can only TIGHTEN your personal
# `~/.config/pgman/safety.toml` — a committed file can't relax your guard
# rails. Commit just `[safety.databases.production]` and your own defaults
# still apply everywhere else.
[safety.databases.production]
read_only = true
statement_timeout_ms = 5000

Project connections show up in the startup picker alongside any IntelliJ data sources found in .idea/dataSources.xml. Nothing in that picker connects until you choose it — see Safety.

Safety

pgman connects to production databases. It opens read-only by default, enforces a statement_timeout, classifies every statement, and applies per-database guard rails — e.g. block DROP, confirm TRUNCATE / unqualified DELETE, and wrap DML in a transaction you can roll back. (This is a guard rail, not a replacement for least-privilege database roles — scope the role you connect with.)

Three things worth knowing:

  • Running pgman inside a checkout you did not write is a trust decision. pgman discovers connections from files in the working tree, so nothing it finds there connects without a keypress, PGPASSWORD is only used with --dsn, and a project's [safety] block can only tighten your own guard rails — never relax them. Full trust model in docs/safety-and-privacy.md.
  • TLS: sslmode=require / prefer encrypt the connection but do not verify the server certificate (matching libpq). Use sslmode=verify-full on untrusted networks. sslmode=verify-ca checks the chain but not the hostname, as libpq does.
  • JDBC tap: the --tap-listen / --tap-otlp / --tap-udp listeners are unauthenticated and bind to 127.0.0.1 by default. Only bind a non-loopback address on a trusted/firewalled network. See docs/tap.md.

Install

Homebrew (macOS / Linux):

brew install tombaldwin/tap/pgman

On Homebrew 6 or newer, run brew trust tombaldwin/tap first: Homebrew only loads formulae from taps you have trusted.

It brings libpq, whose pg_dump and pg_restore pgman dump and pgman restore run.

Cargo:

cargo install pgman --locked

pgman dump and pgman restore also need PostgreSQL's client tools: brew install libpq on macOS, apt install postgresql-client on Debian/Ubuntu.

Pre-built binary: download the tarball for your platform (Linux and macOS, x86_64 and arm64) from the releases page, check the *.sha256 next to it, extract, and put pgman on your PATH. Each tarball also carries a build-provenance attestation: gh attestation verify pgman-*.tar.gz --repo tombaldwin/pgman.

Then try it with no database: pgman --demo.

To hack on it, install from a checkout:

cargo install --path . --locked

The binary lands at ~/.cargo/bin/pgman, which is on $PATH if your shell sources ~/.cargo/env (rustup does this for you).

Upgrade

pgman --upgrade

Works in place for a checkout (git pull + cargo install --path .), a crates.io cargo install install, and a Homebrew install. An install made with cargo install --git … isn't one of these: re-run that cargo install --git command to upgrade it. A standalone binary (a downloaded release tarball) has no in-place upgrade — --upgrade prints the releases page instead.

pgman also checks crates.io for a newer release at most once every six hours and shows a header badge when one exists. Turn that off with --no-update-check (or PGMAN_NO_UPDATE_CHECK); it never blocks startup and degrades silently if there's no network.

Testing

cargo fmt --all && cargo clippy --all-targets -- -D warnings && cargo test

See docs/development.md for the integration suite, coverage, fuzzing, and what CI runs on every push.

Docs

Status

Beta. See BACKLOG.md for what's next.

License

Dual-licensed under either of

at your option. Unless you explicitly state otherwise, any contribution you submit for inclusion shall be dual-licensed as above, without additional terms.


Built by Polymorphism Ltd. pgman is one of the tools we build for ourselves and our clients — if you want this kind of internal developer tooling for your team, get in touch.

Frequently asked questions

What is pgman MCP Server?

PostgreSQL for coding agents: schema, read-only queries, EXPLAIN, masked dumps, confirmed writes.

How do I install pgman MCP Server in Claude Desktop, Cursor, or VS Code?

Pick your client in the Install section on this page and copy the generated config into the client's config file. Step-by-step guides: Claude Desktop, Cursor, and VS Code. pgman MCP Server runs locally from the package pgman with the command npx -y pgman@0.5.5.

Is pgman MCP Server free and open source?

Yes. pgman MCP Server is released under the Apache-2.0 license, an OSI-approved open-source license, so you can use, modify, and self-host it under those terms.

Does pgman MCP Server support remote (HTTP) connections?

No remote endpoint is listed for pgman MCP Server. It runs locally on your machine over stdio, started by your MCP client.

How is pgman MCP Server's trust score calculated?

pgman MCP Server scores 63 out of 100 (Good). The score adds six capped public signals: registry status, maintenance, popularity, license, documentation, and security. Nobody can pay for points. Read the methodology for the full formula.

Reviews

No reviews yet

—Be the first to review

5 star0 reviews at 5 stars
4 star0 reviews at 4 stars
3 star0 reviews at 3 stars
2 star0 reviews at 2 stars
1 star0 reviews at 1 stars

No published reviews yet. Used it? Tell the next person how it went.

Add badge to your README

Paste either snippet into the repository README. The image links to this listing.

Listed on MCPpedia

Top 5 MCP servers

Daily or weekly. Confirm by email, unsubscribe any time.

How often

Manage this listing

Claim this server