Install pgmcp in Claude Code
Docker
claude mcp add pascalallen-pgmcp -e PGMCP_DATABASE_URL=... -- docker run -i --rm -e PGMCP_DATABASE_URL ghcr.io/pascalallen/pgmcp:1.1.0{
"mcpServers": {
"pascalallen-pgmcp": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"PGMCP_DATABASE_URL",
"ghcr.io/pascalallen/pgmcp:1.1.0"
],
"env": {
"PGMCP_DATABASE_URL": "..."
}
}
}
}MCP Bundle (.mcpb)
curl -LO https://github.com/pascalallen/pgmcp/releases/download/v1.1.0/pgmcp_1.1.0.mcpbDownload pgmcp_1.1.0.mcpb and double-click it to install in Claude Desktop.MCP Bundles install in one click in Claude Desktop. Download the file, then open it.
Replace each ... with your own value.
Frequently asked questions
What does the pgmcp MCP server do?
Read-only Postgres ops/DBA diagnostics: slow queries, EXPLAIN, locks, index and table health.
Is the pgmcp MCP server free?
Yes, most likely. Open source and no paid account or API key is mentioned in the listing. Check the provider for current pricing.
Does pgmcp run locally or remotely?
Local. Runs on your machine (stdio). You install it with npx, uvx, Docker or from source.
How do I add pgmcp to Claude Code?
Run: claude mcp add pascalallen-pgmcp -e PGMCP_DATABASE_URL=... -- docker run -i --rm -e PGMCP_DATABASE_URL ghcr.io/pascalallen/pgmcp:1.1.0
More databases MCP servers
View allPgmoat
Kitalon-Labs-LLC/pgmoat
Governed, read-only Postgres access for AI agents: SQL safety, RLS, budgets, tamper-evident audit.
pgbrake
lexang/pgbrake
Postgres brake for AI agents: risky SQL waits for approval, UPDATE/DELETE get one-command undo.
pgops
arzharch/pgops-mcp
Safe, audited PostgreSQL operations for AI agents: queries, migrations, EXPLAIN, containers
pg Readonly
les-k/pg-readonly-mcp
A read-only Postgres MCP server that parses SQL rather than pattern-matching it.
pgvector
mittalpk/mcp-server-pgvector
Similarity search, hybrid search, and index management for pgvector-backed PostgreSQL tables
Pensieve
praveen-ilangovan/pensieve
Manually-triggered, self-organising personal memory for AI agents; SQLite, no vector DB.