Pgops MCP Server

Safe, audited PostgreSQL operations for AI agents: queries, migrations, EXPLAIN, containers

Local serverstdio

What is the Pgops MCP Server?

Pgops is an MCP integration. Safe, audited PostgreSQL operations for AI agents: queries, migrations, EXPLAIN, containers.

Packages and local setup

The published pypi package is pgops-mcp, version 0.1.9. Its declared MCP transport is stdio.

The package declares PGOPS_DSN (required): PostgreSQL connection string for the database to operate on.; 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..

The published oci package is ghcr.io/arzharch/pgops-mcp:0.1.9. Its declared MCP transport is stdio.

The package declares PGOPS_DSN (required): PostgreSQL connection string. From inside a container, localhost is the container itself — use host.docker.internal or the compose service name.; PGOPS_READ_ONLY: Set to 1 to withhold every mutating tool.; PGOPS_AUDIT_LOG: Path to the audit log inside the container. Mount a volume at this path or the log dies with the container..

Before connecting

Check the maintainer’s instructions for account access, authentication and the supported client configuration. Once connected, inspect the tools your client receives and try a small task that matches the server’s stated purpose. The registry description does not include a verified, complete tool list.

Project and source

View the publisher’s registry entry · Project repository. This profile uses version 0.1.9 from the registry. Registration identifies the publisher namespace; it does not establish that this is a first-party integration for every service it connects.

Browse related databases MCP servers for tools that cover the same kind of work.

Configuration

VariableDescriptionRequired
PGOPS_DSNPostgreSQL connection string for the database to operate on.Yes
PGOPS_READONLY_DSNOptional 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.Optional
PGOPS_READ_ONLYSet to 1 to withhold every mutating tool. Write tools are not registered at all, so an agent cannot call them.Optional
PGOPS_APPROVAL_MODESet to 1 to register container.restart and container.exec. Off by default: Docker socket access is root-equivalent on the host.Optional
PGOPS_AUDIT_LOGPath to the append-only JSONL audit log.Optional
PGOPS_DEFAULT_TIMEOUT_MSStatement timeout applied to every query unless a tool call overrides it.Optional
PGOPS_MAX_TIMEOUT_MSCeiling a caller-supplied timeout is clamped to.Optional
PGOPS_DEFAULT_ROW_LIMITRows returned by query.read when the caller does not specify a limit.Optional