
reza-gholizade/k8s-mcp-server
Developer toolsЭта страница переведена автоматически. Технические детали смотрите в оригинале. Открыть оригинал
reza-gholizade/k8s-mcp-server — это кандидат для MCP-сервера, импортированный из https://github.com/reza-gholizade/k8s-mcp-server.
Обзор
reza-gholizade/k8s-mcp-server — это кандидат для MCP-сервера, импортированный из https://github.com/reza-gholizade/k8s-mcp-server.
Обзор (машинный перевод)
Сервер Kubernetes Model Context Protocol (MCP), предоставляющий инструменты для взаимодействия с кластерами Kubernetes через стандартизированный интерфейс.
Размещенное развертывание
Размещенное развертывание доступно на Fronteir AI.
Особенности
- API Resource Discovery: Получите все доступные ресурсы API в вашем кластере Kubernetes.
- Список ресурсов: Список ресурсов любого типа с опциональной фильтрацией пространства имён и меток.
- Детали ресурсов: Получите подробную информацию о конкретных ресурсах Kubernetes.
- Описание ресурса: Получите подробные описания ресурсов Kubernetes, аналогично
kubectl describe. - Pod Logs: Извлекать логи из определённых подов (по желанию из конкретного контейнера или из всех контейнеров, если они не указаны).
- Метрики узлов: Получите метрики использования ресурсов для конкретных узлов.
- Метрики подов: Получите метрики процессора и памяти для конкретных подов.
- Список событий: Список событий внутри пространства имён или для конкретного ресурса.
- Создание/обновление ресурсов: создание новых ресурсов Kubernetes или обновление существующих из манифеста YAML или JSON.
- Удаление ресурсов: удаляет ресурс из кластера Kubernetes на основе предоставленного пространства имён и типа.
Эта страница переведена автоматически. Технические детали смотрите в оригинале.
README
Показан фрагмент оригинального README. Открыть оригинал.
Kubernetes MCP Server
A Kubernetes Model Context Protocol (MCP) server that provides tools for interacting with Kubernetes clusters through a standardized interface.
Hosted deployment
A hosted deployment is available on Fronteir AI.
Features
- API Resource Discovery: Get all available API resources in your Kubernetes cluster.
- Resource Listing: List resources of any type with optional namespace and label filtering.
- Resource Details: Get detailed information about specific Kubernetes resources.
- Resource Description: Get comprehensive descriptions of Kubernetes resources, similar to
kubectl describe. - Pod Logs: Retrieve logs from specific pods (optionally from a specific container, or all containers if unspecified).
- Node Metrics: Get resource usage metrics for specific nodes.
- Pod Metrics: Get CPU and Memory metrics for specific pods.
- Event Listing: List events within a namespace or for a specific resource.
- Resource Creation/Updating: Create new Kubernetes resources or update existing ones from a YAML or JSON manifest.
- Resource Deletion: It deletes a resource in the Kubernetes cluster based on the provided namespace and kind.
- Standardized Interface: Uses the MCP protocol for consistent tool interaction.
- Flexible Configuration: Supports different Kubernetes contexts and resource scopes.
- Multiple Modes: Run in
stdiomode for CLI tools,ssemode, orstreamable-httpmode for web applications, and--readonlyfor no change in the cluster. - Security: Runs as non-root user in Docker containers for enhanced security.
Prerequisites
- Go 1.23 or later
- Access to a Kubernetes cluster
kubectlconfigured with appropriate cluster access
Installation
-
Clone the repository:
git clone https://github.com/reza-gholizade/k8s-mcp-server.git cd k8s-mcp-server -
Install dependencies:
go mod download -
Build the server:
go build -o k8s-mcp-server .
Usage
Starting the Server
The server can run in three modes, configurable via command-line flags or environment variables.
Stdio Mode (for CLI integrations)
This mode uses standard input/output for communication.
./k8s-mcp-server --mode stdio
Or using environment variables:
SERVER_MODE=stdio ./k8s-mcp-server
SSE Mode (for web applications)
This mode starts an HTTP server with Server-Sent Events support.
HTTP transports require a bearer token and listen on loopback by default:
MCP_AUTH_TOKEN="$(openssl rand -hex 32)" ./k8s-mcp-server --mode sse
Specify a port:
MCP_AUTH_TOKEN="your-random-secret" ./k8s-mcp-server --mode sse --port 9090
Or using environment variables:
SERVER_MODE=sse SERVER_PORT=9090 MCP_AUTH_TOKEN="your-random-secret" ./k8s-mcp-server
Установка
docker run -p 8080:8080 -v ~/.kube/config:/home/appuser/.kube/config:ro ginnux/k8s-mcp-server:latest