Skip to content
MCP server

pgman

PostgreSQL schema, read-only queries, EXPLAIN and masked dumps for coding agents

Runs locallyStatus and history
Pricing
Open source
Platforms
macOS, Linux, CLI
Runs
Locally
Version
0.5.4
Listing updated
3 days ago

About pgman

pgman is an open-source MCP server for databases. It runs locally on your machine and is started by your AI client.

Built as part of pgman, a k9s-style terminal UI for PostgreSQL, the MCP mode (pgman mcp serve) gives an agent a guarded view of your databases. Reads cover queries, lock pre-flights, pending patches, schema lint and environments, while apply_patches, dump and restore each need your confirmation.

Every statement is classified before it runs, a write waits inside a transaction until committed or rolled back, and a project's config can only tighten rules. Migrations can be dry-run with real locks, rehearsed on a throwaway copy and applied one transaction at a time, never on a replica. pgman dump masks names, emails, phones and free text as rows are read while keeping foreign keys joined.

It works with PostgreSQL 10 or newer on laptops, docker, RDS, Aurora and managed hosts with direct connections, and installs through Homebrew, cargo or binaries.

Install

Run in a terminal

claude mcp add pgman -- npx -y pgman

Add to claude_desktop_config.json

{
  "mcpServers": {
    "pgman": {
      "command": "npx",
      "args": [
        "-y",
        "pgman"
      ]
    }
  }
}
Install in CursorOpens Cursor, which asks you to confirm. Or add it by hand:

Add to ~/.cursor/mcp.json

{
  "mcpServers": {
    "pgman": {
      "command": "npx",
      "args": [
        "-y",
        "pgman"
      ]
    }
  }
}
Install in VS CodeOpens VS Code, which asks you to confirm. Or add it by hand:

Add to .vscode/mcp.json

{
  "servers": {
    "pgman": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "pgman"
      ]
    }
  }
}

Add to ~/.codeium/windsurf/mcp_config.json

{
  "mcpServers": {
    "pgman": {
      "command": "npx",
      "args": [
        "-y",
        "pgman"
      ]
    }
  }
}

Add to your client's MCP settings (most use this shape)

{
  "mcpServers": {
    "pgman": {
      "command": "npx",
      "args": [
        "-y",
        "pgman"
      ]
    }
  }
}

What it does

Read-only by default
Statements are classified before running; writes wait for commit.
Safe migrations
Dry-run with real locks, then apply one transaction at a time.
Masked production copies
Dumps mask personal data and keep foreign keys joining.
Environment overview
See dev, staging and production side by side.
Log to SQL
Turn application logs back into runnable SQL.

Good for

  • Let an agent inspect a schema without write access
  • Preview locks before a migration
  • Create a masked copy of production for debugging
  • Run EXPLAIN on a slow query through an assistant

Pricing

Open source

MIT / Apache-2.0; support plans from £1,500/year

Prices change. Check poly.io before you buy.

pgman FAQ

Is it free?

Yes, it is open source under MIT or Apache-2.0; paid support plans start at £1,500 a year.

Can the agent write to my database?

Writes wait in a transaction until you commit or roll back, and patches, dumps and restores need confirmation.

Which Postgres versions work?

PostgreSQL 10 or newer.

Is pgman free?

Yes. pgman is open source, so you can use and self-host it for free.

How do I add pgman to Claude Code?

Run this command in your terminal: claude mcp add pgman -- npx -y pgman

What are the best alternatives to pgman?

The closest alternatives to pgman are REA, Codebase Memory, GitHub, Serena MCP: the IDE for your agent and XERJ.

Alternatives to pgman

  1. REA

    MCP server

    CLI and MCP server that lets coding agents reverse engineer apps and binaries

    Runs locally
    • Open source
    • 464K GitHub stars
    • Developer tools
  2. Codebase Memory

    MCP server

    Local MCP server that builds a code knowledge graph for AI coding agents

    Runs locally
    • Open source
    • 48.7K GitHub stars
    • Knowledge and memory
  3. GitHub

    MCP server

    Official MCP server connecting AI assistants to GitHub repos, issues and workflows

    Not checked yet
    • Remote
    • Open source
    • 34.5K GitHub stars
    • Developer tools
  4. MCP toolkit giving coding agents symbol-level code retrieval and editing

    Runs locally
    • Open source
    • 31.5K GitHub stars
    • Developer tools
  5. XERJ

    MCP server

    Local search engine for AI agents with cited answers over your code and docs

    Runs locally
    • Open source
    • 19.2K GitHub stars
    • Knowledge and memory
  6. Ouroboros

    MCP server

    Spec-first layer that pins requirements and verifies results of AI coding agent work

    Runs locally
    • Open source
    • 6.4K GitHub stars
    • Developer tools