AM

azure/mcp-kubernetes

部署与 DevOps

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

62 stars 22 forks 质量 84 趋势 14MIT

azure/mcp-kubernetes 是从 https://github.com/azure/mcp-kubernetes. 导入的 MCP 服务器候选

概览

azure/mcp-kubernetes 是从 https://github.com/azure/mcp-kubernetes. 导入的 MCP 服务器候选

概述(AI 翻译)

mcp-kubernetes 是一个模型上下文协议(MCP)服务器,使 AI 助手能够与 Kubernetes 集互。它作为 AI 工具(如 Claude、Cursor 和 GitHub Copilot)与 Kubernetes 之间的桥梁,将自然语言请求转换为 Kubernetes 操作,并以 AI 工具能理解的格式返回结果。

它允许人工智能工具:

  • 查询 Kubernetes 资源
  • 执行 kubectl 命令
  • 通过自然语言交互管理Kubernetes集群
  • 诊断和解释Kubernetes资源的状态

它是如何运作的

如何安装

容器镜像不再被生产或支持。在本地安装已发布的二进制文件,并配置你的MCP客户端将其作为stdio子进程运行。

本地

安装kubectl

如果还没安装,就安装 kubectl,并把它添加到你的 PATH,比如说。

安装舵手

如果还没安装,就安装Helm并添加到你的PATH中,比如说

在Claude Desktop、Cursor、ChatGPT Copilot、Github Copilot及其他支持的AI客户端中配置你的MCP服务器,例如。

选项

环境变量:

  • KUBECONFIG:通往你的kubeconfig文件的路径,例如/home/ /.kube/config。

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

README

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

mcp-kubernetes

The mcp-kubernetes is a Model Context Protocol (MCP) server that enables AI assistants to interact with Kubernetes clusters. It serves as a bridge between AI tools (like Claude, Cursor, and GitHub Copilot) and Kubernetes, translating natural language requests into Kubernetes operations and returning the results in a format the AI tools can understand.

It allows AI tools to:

  • Query Kubernetes resources
  • Execute kubectl commands
  • Manage Kubernetes clusters through natural language interactions
  • Diagnose and interpret the states of Kubernetes resources

How it works

How to install

Container images are no longer produced or supported. Install a released binary locally and configure your MCP client to run it as a stdio subprocess.

Local

Config your MCP servers in Claude Desktop, Cursor, ChatGPT Copilot, Github Copilot and other supported AI clients, e.g.

{
  "mcpServers": {
    "kubernetes": {
      "command": "",
      "args": ["--transport", "stdio"],
      "env": {
        "KUBECONFIG": ""
      }
    }
  }
}

Options

Environment variables:

  • KUBECONFIG: Path to your kubeconfig file, e.g. /home//.kube/config.
  • USE_LEGACY_TOOLS: Set to true to use multiple specialized kubectl tools instead of the unified call_kubectl tool (default: false).

Command line arguments:

Usage of ./mcp-kubernetes:
      --access-level string       Access level (readonly, readwrite, or admin) (default "readonly")
      --additional-tools string   Comma-separated list of additional tools to support (kubectl is always enabled). Available: helm,cilium,hubble
      --allow-namespaces string   Comma-separated list of namespaces to allow (empty means all allowed)
      --otlp-endpoint string      OTLP endpoint for OpenTelemetry traces (e.g. localhost:4317, default "")
      --timeout int               Timeout for command execution in seconds, default is 60s (default 60)
在 GitHub 查看完整 README

安装

npx @modelcontextprotocol/inspector <path of binary 'mcp-kubernetes'>
新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "kubernetes": { "command": "<path of binary 'mcp-kubernetes'>", "args": ["--transport", "stdio"], "env": { "KUBECONFIG": "<your-kubeconfig-path>" } } } }