cnpg-mcp
Verified Safeby waTeim
Overview
Manages PostgreSQL clusters in Kubernetes using the CloudNativePG operator, enabling LLMs to perform database lifecycle operations through natural language commands.
Installation
python src/cnpg_mcp_server.pyEnvironment 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
mcp-server-kubernetes
This MCP server enables AI agents to connect to and manage Kubernetes clusters by executing kubectl and Helm commands.
kubernetes-mcp-server
Facilitates AI agent interaction with Kubernetes and OpenShift clusters by exposing management and observability tools via the Model Context Protocol.
mcp-server-neon
The Neon MCP Server allows users to interact with and manage their Neon Postgres databases using natural language commands, acting as a bridge between AI agents/LLMs and the Neon API and database operations.
MCP-PostgreSQL-Ops
The MCP server provides professional operations, monitoring, and management capabilities for PostgreSQL databases using natural language queries.