npm @dockndevai/mcp-percona-pgstdioMITupdated 9d ago
A Model Context Protocol server for the Percona Operator for PostgreSQL. It lets an MCP-capable client (Claude Desktop, Claude Code, Cursor, …) operate PostgreSQL + PgBouncer clusters on Kubernetes — topology, connection pooling, tuning, backups/PITR, DR, extensions, and lifecycle — with behaviour controlled entirely by flags.
What can you do with mcp percona pg?
mcp-percona-pg
A Model Context Protocol server for the Percona Operator for PostgreSQL. It lets an MCP-capable client (Claude Desktop, Claude Code, Cursor, …) operate PostgreSQL + PgBouncer clusters on Kubernetes — topology, connection pooling, tuning, backups/PITR, DR, extensions, and lifecycle — with behaviour controlled entirely by flags.
It drives the operator's custom resources (PerconaPGCluster, PerconaPGBackup, PerconaPGRestore, PerconaPGUpgrade) through your kube-config, so the model works the way you already do: "scale dev-pg to 3 replicas", "switch pooling to transaction mode", "restore prod-pg to 12:00 UTC".
Safe by default: it starts read-only, can be scoped to an allowlist of namespaces and clusters, protects critical clusters from mutation, gates restore / upgrade / delete behind separate opt-ins, and requires typed confirmation for high-impact actions. It never reads or returns database credentials.
Features
- Discovery & status — list clusters, per-cluster summary and raw
.status(Patroni members, PostgreSQL/PgBouncer readiness), connection endpoints, backups and restores. - Connection pooling — read and update PgBouncer
pool_modeand the global pool tunables (default_pool_size,max_client_conn, …). - PostgreSQL tuning — read/merge parameters via
spec.patroni.dynamicConfiguration(the only Patroni-safe path). - Lifecycle — scale PostgreSQL/PgBouncer, pause/resume, toggle built-in extensions, on-demand backups.
- DR & recovery — restore / point-in-time recovery, promote a standby, major-version upgrades — each individually gated.
Security model
| Layer | Flag | Effect |
|---|---|---|
| Access mode | PERCONA_MODE |
read-only → read-write → admin; over-privileged tools are never registered |
| Namespace/cluster allowlists | PERCONA_NAMESPACE_ALLOWLIST, PERCONA_CLUSTER_ALLOWLIST |
scope what the agent can touch |
| Protected clusters | PERCONA_PROTECTED_CLUSTERS |
readable, never mutated/restored/deleted |
| Restore / upgrade / delete | PERCONA_ALLOW_RESTORE, PERCONA_ALLOW_UPGRADE, PERCONA_ALLOW_DELETE |
separate opt-ins on top of admin mode |
| Confirmation | PERCONA_REQUIRE_CONFIRMATION |
high-impact ops require echoing the cluster name |
| Dry-run / audit | PERCONA_DRY_RUN, PERCONA_AUDIT_LOG |
validate-only; JSON audit line per guarded op |
Tools
Read (read-only+): list_contexts, list_clusters, get_cluster, get_cluster_status, get_connection_info, get_pgbouncer_config, get_pg_parameters, list_backups, list_restores
Write (read-write+): scale_cluster, set_pgbouncer_config, set_pg_parameters, pause_cluster, toggle_builtin_extension, create_backup
Admin (admin): restore_cluster (needs PERCONA_ALLOW_RESTORE), upgrade_cluster (needs PERCONA_ALLOW_UPGRADE), promote_standby, delete_backup / delete_cluster (need PERCONA_ALLOW_DELETE)
Quickstart — add to your agent
Published on npm as @dockndevai/mcp-percona-pg. No clone or build needed — your MCP client runs it on demand with npx. Start in read-only mode; see .env.example for every variable and docs/CLIENTS.md for the full per-client guide.
Claude Code (CLI)
claude mcp add percona-pg -e PERCONA_MODE="read-only" -e PERCONA_NAMESPACE="postgres-operator" -- npx -y @dockndevai/mcp-percona-pg
Claude Desktop · Cursor · Windsurf — same block in claude_desktop_config.json, .cursor/mcp.json, or ~/.codeium/windsurf/mcp_config.json:
{
"mcpServers": {
"percona-pg": {
"command": "npx",
"args": ["-y", "@dockndevai/mcp-percona-pg"],
"env": {
"PERCONA_MODE": "read-only",
"PERCONA_NAMESPACE": "postgres-operator"
}
}
}
}
OpenAI Codex CLI — in ~/.codex/config.toml:
[mcp_servers.percona-pg]
command = "npx"
args = ["-y", "@dockndevai/mcp-percona-pg"]
env = { PERCONA_MODE = "read-only", PERCONA_NAMESPACE = "postgres-operator" }
Example prompts
- "List the PostgreSQL clusters and show me the status of
dev-pg." - "What pool_mode is
dev-pgusing, and how big is the default pool?" →get_pgbouncer_config - "Set
dev-pgPgBouncer to transaction pooling with default_pool_size 25." (needsread-write) - "Bump
shared_buffersto 512MB ondev-pg." (needsread-write) - "Take a full backup of
dev-pgto repo1." (needsread-write) - "Restore
dev-pgto 2026-08-30 12:00:00+00." (needsadmin+PERCONA_ALLOW_RESTORE+ confirmation)
Prerequisites
- A Kubernetes cluster running the Percona Operator for PostgreSQL v2 (
pgv2.percona.com/v2). - A kube-config the server can read. For safety, use a ServiceAccount/RBAC scoped to the operator's namespaces and to the
pgv2.percona.comresources you want the agent to see.
Run from source (development)
Prefer the published package above. To run from a clone:
npm install
npm run build
node dist/index.js # with the environment variables set
Develop
npm run dev
npm test # security policy + annotations
npm run typecheck
Publishing
This server ships a server.json for the official MCP registry and an mcpName for npm ownership validation. See PUBLISHING.md.
License
MIT
Install
Add mcp percona pg to your client. Pick the one you use.
claude mcp add mcp-percona-pg -- npx -y @dockndevai/mcp-percona-pgcodex mcp add mcp-percona-pg -- npx -y @dockndevai/mcp-percona-pgamp mcp add mcp-percona-pg -- npx -y @dockndevai/mcp-percona-pg{
"mcpServers": {
"mcp-percona-pg": {
"command": "npx",
"args": [
"-y",
"@dockndevai/mcp-percona-pg"
]
}
}
}Add to `claude_desktop_config.json`, then restart Claude Desktop.
{
"mcpServers": {
"mcp-percona-pg": {
"command": "npx",
"args": [
"-y",
"@dockndevai/mcp-percona-pg"
]
}
}
}Add to `~/.cursor/mcp.json`, or `.cursor/mcp.json` for a single project.
code --add-mcp '{"name":"mcp-percona-pg","command":"npx","args":["-y","@dockndevai/mcp-percona-pg"]}'Or add the block manually to `.vscode/mcp.json` under `servers`.
{
"mcpServers": {
"mcp-percona-pg": {
"command": "npx",
"args": [
"-y",
"@dockndevai/mcp-percona-pg"
]
}
}
}Add to `~/.codeium/windsurf/mcp_config.json`.
{
"mcpServers": {
"mcp-percona-pg": {
"command": "npx",
"args": [
"-y",
"@dockndevai/mcp-percona-pg"
]
}
}
}Add to `cline_mcp_settings.json` via the MCP Servers panel.
{
"mcpServers": {
"mcp-percona-pg": {
"command": "npx",
"args": [
"-y",
"@dockndevai/mcp-percona-pg"
]
}
}
}Add to `~/.gemini/settings.json`.
{
"mcpServers": {
"mcp-percona-pg": {
"type": "local",
"command": "npx",
"args": [
"-y",
"@dockndevai/mcp-percona-pg"
],
"tools": [
"*"
]
}
}
}Add to `~/.copilot/mcp-config.json`, or run `/mcp add` inside the CLI.
{
"context_servers": {
"mcp-percona-pg": {
"command": {
"path": "npx",
"args": [
"-y",
"@dockndevai/mcp-percona-pg"
]
}
}
}
}Add to your Zed `settings.json`.
npx -y @dockndevai/mcp-percona-pgRun `goose configure`, choose **Add Extension → Command-line Extension**, and paste this command.
Score
39 / 100
Incomplete
- Documentation25/25
- Maintenance19/25
- Trust13/20
- Capability0/15
- Install experience12/15
- Documents what it does and how to connect
- Has a resolvable package or endpoint
- Exposes at least one tool, prompt or resource
- README has substantive content
- Includes a code example
- Documents its configuration
- Mentions credentials or security posture
- Last commit 2 days ago
- Has a release history
- Repository is not archived
- Licensed MIT
- Namespace verified in the official MCP registry
- Claimed by its owner
- Published under an organisation
- 0 tool(s) documented
- Provides prompt templates
- Provides resources
- 12 documented install method(s)
- Published to a package registry
- Offers a hosted endpoint — no local install
Version history
| Versions | Published |
|---|---|
| 0.1.1Latest | Aug 30, 2026 |
| 0.1.0 | Aug 30, 2026 |