CK

containers/kubernetes-mcp-server

部署与 DevOps

本页由 AI 翻译,技术细节请以原文为准。 查看原文

2196 stars 467 forks 质量 93 趋势 49Apache-2.0

Kubernetes 和 OpenShift 的模型上下文协议(MCP)服务器

概览

https://github.com/user-attachments/assets/be2b67b3-fc1c-4d11-ae46-93deba8ed98e 一个强大且灵活的Kubernetes模型上下文协议(MCP)服务器实现,支持和。 - : - 自动检测 Kubernetes 配置的变化并更新 MCP 服务器。- 并管理当前的 Kubernetes .kube/config 或集群内配置。- : 对 Kubernetes 或 OpenShift 资源执行操作。- 任何 CRUD 操作(创建或更新、获取、列表、删除)。- : 执行特定 Pod 操作。- 所有命名空间中的 pod 或特定命名空间中的 pod。- 指定命名空间中的 pod 名称。- 指定命名空间中按名称的 pod。- 用于指定命名空间中 pod 的名称。- 获取指定命名空间中所有 pod 或特定 pod 的资源使用指标。- 进入 pod 并运行命令。- 在 pod 中获取容器镜像,并可选择性地暴露。- : 列出 Kubernetes 命名空间。- : 查看所有命名空间或特定命名空间中的 Kubernetes 事件。

概述(AI 翻译)

功能 |🚀入门指南 |🎥演示 |⚙️配置 |🛠️工具 |💬社区 |🧑 💻开发 ✨

https://github.com/user-attachments/assets/be2b67b3-fc1c-4d11-ae46-93deba8ed98e

✨ 特色

一个强大且灵活的Kubernetes模型上下文协议(MCP)服务器实现,支持Kubernetes和OpenShift。

  • ** ✅ 配置**:
  • 自动检测Kubernetes配置变更并更新MCP服务器。
  • **查看和管理当前的Kubernetes .kube/config或集群内配置。
  • ** ✅ 通用 Kubernetes 资源:对任意 Kubernetes 或 OpenShift 资源执行操作。
  • 任何CRUD操作(创建或更新、获取、列表、删除)。
  • ** ✅ 舱体:执行舱体专属操作。
  • 在所有命名空间或特定命名空间中列出 pods。
  • 从指定的命名空间中按名称获取 pod。
  • 按指定命名空间中删除一个舱体。
  • 显示指定命名空间中Pod的名称日志。
  • Top 获取指定命名空间内所有 pod 或特定 pod 的资源使用指标。
  • Exec进入一个舱体并执行命令。

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

Kubernetes MCP Server

✨ Features | 🚀 Getting Started | 🎥 Demos | ⚙️ Configuration | 🛠️ Tools | 💬 Community | 🧑‍💻 Development

https://github.com/user-attachments/assets/be2b67b3-fc1c-4d11-ae46-93deba8ed98e

✨ Features

A powerful and flexible Kubernetes Model Context Protocol (MCP) server implementation with support for Kubernetes and OpenShift.

  • ✅ Configuration:
    • Automatically detect changes in the Kubernetes configuration and update the MCP server.
    • View and manage the current Kubernetes .kube/config or in-cluster configuration.
  • ✅ Generic Kubernetes Resources: Perform operations on any Kubernetes or OpenShift resource.
    • Any CRUD operation (Create or Update, Get, List, Delete).
  • ✅ Pods: Perform Pod-specific operations.
    • List pods in all namespaces or in a specific namespace.
    • Get a pod by name from the specified namespace.
    • Delete a pod by name from the specified namespace.
    • Show logs for a pod by name from the specified namespace.
    • Top gets resource usage metrics for all pods or a specific pod in the specified namespace.
    • Exec into a pod and run a command.
    • Run a container image in a pod and optionally expose it.
  • ✅ Namespaces: List Kubernetes Namespaces.
  • ✅ Events: View Kubernetes events in all namespaces or in a specific namespace.
  • ✅ Projects: List OpenShift Projects.
  • ☸️ Helm:
    • Install a Helm chart in the current or provided namespace.
    • List Helm releases in all namespaces or in a specific namespace.
    • Uninstall a Helm release in the current or provided namespace.
  • 🔧 Tekton: Tekton-specific operations that complement generic Kubernetes resource management.
    • Pipeline: Start a Tekton Pipeline by creating a PipelineRun.
    • PipelineRun: Restart, cancel, troubleshoot, and retrieve PipelineRun logs.
在 GitHub 查看完整 README

安装

npx -y kubernetes-mcp-server@latest
新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "kubernetes": { "command": "npx", "args": ["-y", "kubernetes-mcp-server@latest"] } } }