CloudNativePG Server
БесплатноНе проверенEnables managing PostgreSQL clusters via the CloudNativePG operator, including CRUD operations for clusters, databases, and roles.
Описание
Enables managing PostgreSQL clusters via the CloudNativePG operator, including CRUD operations for clusters, databases, and roles.
README
An MCP server for managing PostgreSQL clusters through the CloudNativePG operator.
This version uses the MCP Base scaffold for its server layout, authentication,
container build, Helm chart, prompt registry, and test harness. The previous
manual implementation is retained under deprecated-v1/ for reference.
Tool Surface
The server exposes the CloudNativePG tools from the v1 implementation:
list_postgres_clustersget_cluster_statuscreate_postgres_clusterscale_postgres_clusterdelete_postgres_clusterlist_postgres_rolescreate_postgres_roleupdate_postgres_roledelete_postgres_rolelist_postgres_databasesget_postgres_database_statuscreate_postgres_databasedelete_postgres_database
create_postgres_database supports CloudNativePG Database CRD create-time
locale options, including encoding, locale, locale_provider,
locale_collate, locale_ctype, icu_locale, icu_rules,
builtin_locale, and collation_version.
get_postgres_database_status reports the current Database CRD spec values for
those options along with the operator reconciliation status.
It also includes MCP Base scaffold admin tools for prompt management:
admin_reload_promptsadmin_get_prompt_manifest
Layout
src/cnpg_mcp_server.py: production FastMCP HTTP entrypointsrc/cnpg_mcp_test_server.py: no-auth/OIDC test entrypointsrc/cnpg_mcp_tools.py: CloudNativePG tool implementations and registrationsrc/mcp_context.py: MCP context wrapper with user identity extractionsrc/auth_*.py: MCP Base scaffold authentication supportchart/: Helm deployment assetstest/: MCP plugin test harnessSCAFFOLD_INVENTORY.md: MCP Base scaffold artifact hashes
Development
Create an environment and install dependencies:
python -m venv .venv
. .venv/bin/activate
pip install -r requirements.txt -r test/requirements.txt
Run the scaffold registration smoke test:
python bin/smoke_test.py
Run the local no-auth MCP test suite:
python test/run-local-tests.py
Run the CloudNativePG Kubernetes integration tests adapted from
deprecated-v1/test/plugins:
python test/run-local-tests.py --include-integration
# or
make test-integration
These tests create, scale, update, and delete real CloudNativePG resources. Useful optional settings:
CNPG_MCP_TEST_NAMESPACE: namespace for test resourcesCNPG_MCP_TEST_CLUSTER_PREFIX: generated cluster name prefixCNPG_MCP_TEST_STORAGE_SIZE: per-instance storage size, default1GiCNPG_MCP_TEST_CREATE_WAIT_SECONDS: cluster readiness timeout, default300CNPG_MCP_TEST_SCALE_WAIT_SECONDS: scale readiness timeout, default300
Running Locally
The scaffold entrypoint uses HTTP transport:
python src/cnpg_mcp_server.py --host 0.0.0.0 --port 4200
The test server can be run without authentication:
python src/cnpg_mcp_test_server.py --host 127.0.0.1 --port 4201 --no-auth
Kubernetes Access
The tools use the Kubernetes Python client. They load configuration in this order:
- In-cluster service account configuration
- Local kubeconfig from
~/.kube/configorKUBECONFIG
Most tools accept an optional namespace. When omitted, the current Kubernetes
context namespace is used, falling back to default.
For in-cluster Helm deployments, the server uses the deployment service account.
By default the chart grants that service account CNPG and secret permissions
only in the Helm release namespace. To manage CNPG resources in another
namespace, pass the tool's namespace argument and grant the service account
access there:
rbac:
targetNamespaces:
- application-databases
For a shared MCP deployment that must operate in arbitrary namespaces, opt in to cluster-wide RBAC:
rbac:
clusterWide: true
Cluster-wide mode grants secret access across namespaces, so prefer explicit
targetNamespaces when the target set is known.
Deployment
The MCP Base scaffold includes Docker and Helm assets:
make build
make push
make helm-install
Use python bin/configure-make.py to generate make.env for image and
namespace settings before using the deployment targets.
Установка CloudNativePG Server
У этого сервера нет опубликованного пакета — он собирается из исходников. Открой репозиторий и следуй инструкции в README.
▸ github.com/waTeim/cnpg-mcpFAQ
CloudNativePG Server MCP бесплатный?
Да, CloudNativePG Server MCP бесплатный — установка в пару кликов через Unyly без оплаты.
Нужен ли API-ключ для CloudNativePG Server?
Нет, CloudNativePG Server работает без API-ключей и переменных окружения.
CloudNativePG Server — hosted или self-hosted?
Доступен hosted-вариант: Unyly запускает сервер в облаке, локальная установка не обязательна.
Как установить CloudNativePG Server в Claude Desktop, Claude Code или Cursor?
Открой CloudNativePG Server на unyly.org, выбери вкладку своего клиента (Claude Desktop, Claude Code, Cursor) и нажми Install — конфиг сгенерируется автоматически, без правки JSON.
Похожие MCP
GitHub
PRs, issues, code search, CI status
автор: GitHubFilesystem
Secure file operations with configurable access controls.
Memory
Knowledge graph-based persistent memory system.
Template MCP Server
A CLI tool to create a new Model Context Protocol server project with TypeScript support, dual transport options, and an extensible structure
автор: mcpdotdirectCompare CloudNativePG Server with
Не уверен что выбрать?
Найди свой стек за 60 секунд
Автор?
Embed-бейдж для README
Похожее
Все в категории development
