pgman
PostgreSQL schema, read-only queries, EXPLAIN and masked dumps for coding agents
- 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 pgmanAdd to claude_desktop_config.json
{
"mcpServers": {
"pgman": {
"command": "npx",
"args": [
"-y",
"pgman"
]
}
}
}Add to ~/.cursor/mcp.json
{
"mcpServers": {
"pgman": {
"command": "npx",
"args": [
"-y",
"pgman"
]
}
}
}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

REA
MCP serverCLI and MCP server that lets coding agents reverse engineer apps and binaries
Runs locally- Open source
- 464K GitHub stars
- Developer tools

Codebase Memory
MCP serverLocal MCP server that builds a code knowledge graph for AI coding agents
Runs locally- Open source
- 48.7K GitHub stars
- Knowledge and memory

GitHub
MCP serverOfficial MCP server connecting AI assistants to GitHub repos, issues and workflows
Not checked yet- Remote
- Open source
- 34.5K GitHub stars
- Developer tools

Serena MCP: the IDE for your agent
MCP serverMCP toolkit giving coding agents symbol-level code retrieval and editing
Runs locally- Open source
- 31.5K GitHub stars
- Developer tools

XERJ
MCP serverLocal search engine for AI agents with cited answers over your code and docs
Runs locally- Open source
- 19.2K GitHub stars
- Knowledge and memory

Ouroboros
MCP serverSpec-first layer that pins requirements and verifies results of AI coding agent work
Runs locally- Open source
- 6.4K GitHub stars
- Developer tools