kube-mcp
获取 Gemini APi 密钥
前往https://aistudio.google.com/获取 API 密钥。目前,gemini-2.0-pro-exp-02-05 LLM 完全免费。其他型号也提供非常优惠的价格。
安装 Codename Goose
Goose 是一个开源 AI 代理,它通过自动化编码任务来增强您的软件开发能力。我们将使用 Codename Goose,因为它内置了 MCP 客户端。请按照此处的步骤安装 Codename Goose: https://block.github.io/goose/docs/getting-started/installation 。设置 GOOGLE_API_KEY 环境变量,以便 Goose 知道使用 Gemini API。了解如何使用goose configure进行配置,以及如何使用goose session以会话方式启动。
开发 MCP 服务器
通过阅读文档了解 MCP: https://modelcontextprotocol.io/introduction以及 Python SDK: https://github.com/modelcontextprotocol/python-sdk克隆此仓库并使用mcp dev server.py进行测试。请注意,本项目使用uv包管理器而不是 pip。通过阅读文档了解uv : https://github.com/astral-sh/uv本项目使用 Kubernetes python 客户端: https://github.com/kubernetes-client/python
安装 Minikube
按照以下说明安装 minikube: https://minikube.sigs.k8s.io/docs/start/? arch=%2Flinux%2Fx86-64%2Fstable%2Fbinary+download 确保集群配置已提供给 MCP 服务器。查看KubernetesManager和config.load_kube_config()以了解配置的加载方式。
将您的 MCP 服务器连接到 Codename Goose
通过阅读以下文档将 MCP 服务器添加为扩展: https://block.github.io/goose/docs/getting-started/using-extensions使用命令goose session --with-builtin developer --with-extension "uvx kube-mcp"启动新的 goose 会话
让一切正常运转
尝试在 Goose 中发出命令并使其使用 MCP 服务器与 Minikube 进行交互
This server cannot be installed
Related Resources
Related MCP Servers
- -securityAlicense-qualityA read-only MCP server for Kubernetes that allows querying cluster information and diagnosing issues through natural language interfaces like Claude.Last updated -8MIT License
- GoMIT License
- -securityAlicense-qualityAn MCP server that enables interaction with Kubernetes resources through natural language interfaces like Goose CLI, allowing users to get, read, and patch Kubernetes resources.Last updated -Apache 2.0
- -securityFlicense-qualityAn auto-generated MCP server that enables interaction with Google Kubernetes Engine Hub API for multi-cluster management through natural language commands.Last updated -