前往 https://aistudio.google.com/ 并为自己获取一个API密钥。目前,gemini-2.0-pro-exp-02-05 大型语言模型完全免费提供。其他模型也以非常低廉的价格提供。
Goose 是一个开源AI代理,通过自动化编码任务来加速软件开发。我们将使用代号Goose,因为它内置了MCP客户端。按照以下步骤安装代号Goose:https://block.github.io/goose/docs/getting-started/installation。设置GOOGLE_API_KEY环境变量,以便Goose知道使用Gemini API。了解如何使用 goose configure 进行配置,并使用 goose session 启动会话。
阅读有关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:https://minikube.sigs.k8s.io/docs/start/?arch=%2Flinux%2Fx86-64%2Fstable%2Fbinary+download。确保集群配置已提供给MCP服务器。查看 KubernetesManager 和 config.load_kube_config() 以了解配置是如何加载的。
通过阅读以下文档将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进行交互。