Back to Home
waTeim icon

cnpg-mcp

Verified Safe

by waTeim

Overview

Manages PostgreSQL clusters in Kubernetes using the CloudNativePG operator, enabling LLMs to perform database lifecycle operations through natural language commands.

Installation

Run Command
python src/cnpg_mcp_server.py

Environment Variables

  • OIDC_ISSUER
  • OIDC_AUDIENCE
  • AUTH0_CLIENT_ID
  • AUTH0_CLIENT_SECRET
  • PUBLIC_URL
  • JWT_SIGNING_KEY
  • REDIS_HOST
  • REDIS_PORT
  • REDIS_DB
  • REDIS_PASSWORD
  • OIDC_JWKS_URI
  • DCR_PROXY_URL
  • OIDC_SCOPE
  • AUTH0_MGMT_CLIENT_ID
  • AUTH0_MGMT_CLIENT_SECRET
  • PORT
  • DEBUG

Security Notes

The server employs robust security practices, including comprehensive OIDC/OAuth2 authentication (JWT bearer token validation, JWKS discovery), and careful handling of secrets via Kubernetes Secret mounts. Input validation is enforced using Pydantic models and explicit RFC 1123 checks for resource names. RBAC roles are clearly defined, leveraging CloudNativePG's existing ClusterRoles (e.g., 'edit', 'view') and providing a mechanism for custom roles. Destructive operations (cluster/database deletion) require explicit confirmation. The DCR proxy logic to manage client secrets (capturing, persisting, then stripping from public responses) is designed with security in mind, although inherently complex. No 'eval' or direct shell execution of user input was found. The use of FastAPI and FastMCP provides a secure and well-structured framework.

Similar Servers

Stats

Interest Score0
Security Score9
Cost ClassLow
Avg Tokens750
Stars0
Forks0
Last Update2025-12-09

Tags

KubernetesPostgreSQLCloudNativePGDatabase ManagementLLM Tools