pgops MCP Server
by arzharchio.github.arzharch/pgops-mcpv0.1.9
Safe, audited PostgreSQL operations for AI agents: queries, migrations, EXPLAIN, containers
context tax
queued
security
queued
cold start
queued
freshness
Maintained39d ago
Install pgops MCP server
Install in Claude Code
claude mcp add pgops -e PGOPS_DSN='<pgops-dsn>' -e PGOPS_READONLY_DSN='<pgops-readonly-dsn>' -- uvx pgops-mcpInstall in Cursor
{
"mcpServers": {
"pgops": {
"command": "uvx",
"args": [
"pgops-mcp"
],
"env": {
"PGOPS_DSN": "<pgops-dsn>",
"PGOPS_READONLY_DSN": "<pgops-readonly-dsn>"
}
}
}
}Add to ~/.cursor/mcp.json (global) or .cursor/mcp.json (project).
Install in Claude Desktop
{
"mcpServers": {
"pgops": {
"command": "uvx",
"args": [
"pgops-mcp"
],
"env": {
"PGOPS_DSN": "<pgops-dsn>",
"PGOPS_READONLY_DSN": "<pgops-readonly-dsn>"
}
}
}
}Settings → Developer → Edit Config (claude_desktop_config.json), then restart.
Install in VS Code
{
"servers": {
"pgops": {
"type": "stdio",
"command": "uvx",
"args": [
"pgops-mcp"
],
"env": {
"PGOPS_DSN": "<pgops-dsn>",
"PGOPS_READONLY_DSN": "<pgops-readonly-dsn>"
}
}
}
}Add to .vscode/mcp.json in your workspace.
Install in Windsurf
{
"mcpServers": {
"pgops": {
"command": "uvx",
"args": [
"pgops-mcp"
],
"env": {
"PGOPS_DSN": "<pgops-dsn>",
"PGOPS_READONLY_DSN": "<pgops-readonly-dsn>"
}
}
}
}Add to ~/.codeium/windsurf/mcp_config.json.
Configuration
| Variable | Required | Secret | Description |
|---|---|---|---|
| PGOPS_DSN | yes | yes | 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. |
| PGOPS_READONLY_DSN | — | yes | 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_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_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. |
Freshness
Maintained — last maintenance signal 39d ago. The newest of the signals below sets the band.
Last commit (default branch)
2026-09-01 · 39d ago · GitHub
Latest release
2026-09-01 · 39d ago · GitHub · v0.1.9
Package published
no data · npm/PyPI
Registry entry updated
2026-09-01 · 39d ago · official registry · v0.1.9
FAQ
›How do I install the pgops MCP server in Claude Code?
Run: claude mcp add pgops -e PGOPS_DSN='<pgops-dsn>' -e PGOPS_READONLY_DSN='<pgops-readonly-dsn>' -- uvx pgops-mcp. For Cursor, VS Code, Claude Desktop and Windsurf, use the install tabs above.
›Does pgops require an API key?
Yes. It expects PGOPS_DSN, PGOPS_READONLY_DSN, of which 2 are secrets.
›Can I use pgops as a remote (hosted) MCP server?
No hosted endpoint is published; it runs locally over stdio.
›Is pgops in the official MCP registry?
Yes, as io.github.arzharch/pgops-mcp.
Alternatives to pgops
Other database MCP servers.