pgops MCP
pgops-mcp provides safe, audited PostgreSQL operations for AI agents, offering 18 tools for inspecting schemas, running queries, diagnosing slow ones, and planning migrations. It includes safety features like lock-impact analysis, confirmation for dangerous actions, and audit logging to prevent data destruction.
Package and access
Local package with source-attributed installation metadata. Koskamo does not execute packages during review.
What you can do with it
- Inspect database schemas
- Run and explain SQL queries
- Plan migrations with lock analysis
- Diagnose performance issues
Source and maintenance
- Maintenance checked
Packages and installation
Source-provided package data. Koskamo has not executed or live-probed this package.
pgops-mcp 0.1.9
{
"version": "0.1.9",
"transport": "stdio",
"identifier": "pgops-mcp",
"runtimeHint": "uvx",
"registryType": "pypi",
"registryBaseUrl": "https://pypi.org",
"environmentVariables": [
{
"name": "PGOPS_DSN",
"isRequired": true,
"description": "PostgreSQL connection string for the database to operate on."
},
{
"name": "PGOPS_READONLY_DSN",
"description": "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."
},
{
"name": "PGOPS_READ_ONLY",
"default": "0",
"description": "Set to 1 to withhold every mutating tool. Write tools are not registered at all, so an agent cannot call them."
},
{
"name": "PGOPS_APPROVAL_MODE",
"default": "0",
"description": "Set to 1 to register container.restart and container.exec. Off by default: Docker socket access is root-equivalent on the host."
},
{
"name": "PGOPS_AUDIT_LOG",
"default": "~/.pgops/audit.jsonl",
"description": "Path to the append-only JSONL audit log."
},
{
"name": "PGOPS_DEFAULT_TIMEOUT_MS",
"default": "5000",
"description": "Statement timeout applied to every query unless a tool call overrides it."
},
{
"name": "PGOPS_MAX_TIMEOUT_MS",
"default": "30000",
"description": "Ceiling a caller-supplied timeout is clamped to."
},
{
"name": "PGOPS_DEFAULT_ROW_LIMIT",
"default": "100",
"description": "Rows returned by query.read when the caller does not specify a limit."
}
]
}Tools
Reported by the attributed source; not independently observed by Koskamo.
Connect from your client
Each snippet configures the same source-provided package; replace placeholders before use.
Cursor
{
"mcpServers": {
"pgops-mcp-mcp": {
"command": "uvx",
"args": [
"pgops-mcp==0.1.9"
],
"env": {
"PGOPS_DSN": "<YOUR_PGOPS_DSN>",
"PGOPS_READONLY_DSN": "<YOUR_PGOPS_READONLY_DSN>",
"PGOPS_READ_ONLY": "<YOUR_PGOPS_READ_ONLY>",
"PGOPS_APPROVAL_MODE": "<YOUR_PGOPS_APPROVAL_MODE>",
"PGOPS_AUDIT_LOG": "<YOUR_PGOPS_AUDIT_LOG>",
"PGOPS_DEFAULT_TIMEOUT_MS": "<YOUR_PGOPS_DEFAULT_TIMEOUT_MS>",
"PGOPS_MAX_TIMEOUT_MS": "<YOUR_PGOPS_MAX_TIMEOUT_MS>",
"PGOPS_DEFAULT_ROW_LIMIT": "<YOUR_PGOPS_DEFAULT_ROW_LIMIT>"
}
}
}
}Cline
{
"mcpServers": {
"pgops-mcp-mcp": {
"command": "uvx",
"args": [
"pgops-mcp==0.1.9"
],
"env": {
"PGOPS_DSN": "<YOUR_PGOPS_DSN>",
"PGOPS_READONLY_DSN": "<YOUR_PGOPS_READONLY_DSN>",
"PGOPS_READ_ONLY": "<YOUR_PGOPS_READ_ONLY>",
"PGOPS_APPROVAL_MODE": "<YOUR_PGOPS_APPROVAL_MODE>",
"PGOPS_AUDIT_LOG": "<YOUR_PGOPS_AUDIT_LOG>",
"PGOPS_DEFAULT_TIMEOUT_MS": "<YOUR_PGOPS_DEFAULT_TIMEOUT_MS>",
"PGOPS_MAX_TIMEOUT_MS": "<YOUR_PGOPS_MAX_TIMEOUT_MS>",
"PGOPS_DEFAULT_ROW_LIMIT": "<YOUR_PGOPS_DEFAULT_ROW_LIMIT>"
}
}
}
}VS Code
{
"servers": {
"pgops-mcp-mcp": {
"type": "stdio",
"command": "uvx",
"args": [
"pgops-mcp==0.1.9"
],
"env": {
"PGOPS_DSN": "<YOUR_PGOPS_DSN>",
"PGOPS_READONLY_DSN": "<YOUR_PGOPS_READONLY_DSN>",
"PGOPS_READ_ONLY": "<YOUR_PGOPS_READ_ONLY>",
"PGOPS_APPROVAL_MODE": "<YOUR_PGOPS_APPROVAL_MODE>",
"PGOPS_AUDIT_LOG": "<YOUR_PGOPS_AUDIT_LOG>",
"PGOPS_DEFAULT_TIMEOUT_MS": "<YOUR_PGOPS_DEFAULT_TIMEOUT_MS>",
"PGOPS_MAX_TIMEOUT_MS": "<YOUR_PGOPS_MAX_TIMEOUT_MS>",
"PGOPS_DEFAULT_ROW_LIMIT": "<YOUR_PGOPS_DEFAULT_ROW_LIMIT>"
}
}
}
}Claude Desktop
{
"mcpServers": {
"pgops-mcp-mcp": {
"command": "uvx",
"args": [
"pgops-mcp==0.1.9"
],
"env": {
"PGOPS_DSN": "<YOUR_PGOPS_DSN>",
"PGOPS_READONLY_DSN": "<YOUR_PGOPS_READONLY_DSN>",
"PGOPS_READ_ONLY": "<YOUR_PGOPS_READ_ONLY>",
"PGOPS_APPROVAL_MODE": "<YOUR_PGOPS_APPROVAL_MODE>",
"PGOPS_AUDIT_LOG": "<YOUR_PGOPS_AUDIT_LOG>",
"PGOPS_DEFAULT_TIMEOUT_MS": "<YOUR_PGOPS_DEFAULT_TIMEOUT_MS>",
"PGOPS_MAX_TIMEOUT_MS": "<YOUR_PGOPS_MAX_TIMEOUT_MS>",
"PGOPS_DEFAULT_ROW_LIMIT": "<YOUR_PGOPS_DEFAULT_ROW_LIMIT>"
}
}
}
}Let your agent find its tools
Find servers like pgops MCP from your agent. Add Koskamo once to search the index for endpoints, access requirements, and client setup. Public discovery needs no key.