pgops runs on your own machine — the client starts it, so there is no endpoint to ping. 201 installs a week from pypi. Last commit 1 Sep 2026.
Safe, audited PostgreSQL operations for AI agents: queries, migrations, EXPLAIN, containers
Today is the operative word: we check pgops every 15 minutes and re-read its code on every release. Watch it and you find out the day that stops being true.
This server runs on your own machine — install it with the package manager and the client starts it for you. Package name taken from the official registry entry.
claude mcp add pgops-mcp -e 'PGOPS_DSN=<PGOPS_DSN>' -- uvx pgops-mcp
{
"mcpServers": {
"pgops-mcp": {
"command": "uvx",
"args": [
"pgops-mcp"
],
"env": {
"PGOPS_DSN": "<PGOPS_DSN>"
}
}
}
}
[mcp_servers.pgops-mcp]
command = "uvx"
args = ["pgops-mcp"]
env = { PGOPS_DSN = "<PGOPS_DSN>" }
{
"mcpServers": {
"pgops-mcp": {
"command": "uvx",
"args": [
"pgops-mcp"
],
"env": {
"PGOPS_DSN": "<PGOPS_DSN>"
}
}
}
}
{
"servers": {
"pgops-mcp": {
"type": "stdio",
"command": "uvx",
"args": [
"pgops-mcp"
],
"env": {
"PGOPS_DSN": "<PGOPS_DSN>"
}
}
}
}
Put your own value in place of
<PGOPS_DSN> (PostgreSQL connection string for the database to operate on).
The author’s registry entry marks it as required.
Optional settings from the registry entry, left out of the block above:
PGOPS_READONLY_DSN (Optional separate DSN for the read-only pool. Use a role with no write grants to enforce read-only at the database rather than only in the server), PGOPS_READ_ONLY (Set to 1 to withhold every mutating tool. Write tools are not registered at all, so an agent cannot call them), PGOPS_APPROVAL_MODE (Set to 1 to register container.restart and container.exec. Off by default: Docker socket access is root-equivalent on the host), PGOPS_AUDIT_LOG (Path to the append-only JSONL audit log), PGOPS_DEFAULT_TIMEOUT_MS (Statement timeout applied to every query unless a tool call overrides it), PGOPS_MAX_TIMEOUT_MS (Ceiling a caller-supplied timeout is clamped to), PGOPS_DEFAULT_ROW_LIMIT (Rows returned by query.read when the caller does not specify a limit).
Offline PostgreSQL query, migration and EXPLAIN diagnostics for AI agents.
Lints PostgreSQL migrations for dangerous locking operations and suggests safe rewrites.
Safe, read-only Postgres and MySQL access for AI agents. Audit log + column-level controls.
Read PostgreSQL EXPLAIN plans for AI agents: bottlenecks, estimation errors, fixes, charts.
Safe-by-default SQL guardrails for AI agents: AST-checked queries, per-table policy, audit log.
Analytical memory for AI agents: a real Postgres queried in plain English over MCP. One command.
PostgreSQL MCP server - query, schema introspection, explain, and health checks for AI assistants
Governed, read-only Postgres access for AI agents: SQL safety, RLS, budgets, tamper-evident audit.
Answers built from our own checks of this server.