Back to MCP directory
publicPublicdnsLocal runtime

kube-mcp

Kubernetes MCP是一个用于管理Kubernetes资源的工具,提供资源查询和修改功能,可通过Goose CLI扩展集成。

article

README

🚀 kube-mcp

kube-mcp 是一个 Kubernetes MCP 工具,它能助力用户更便捷地操作和管理 Kubernetes 资源。

🚀 快速开始

📦 安装指南

  1. 安装 Goose CLI
  2. 在本地安装 MCP
$ uv pip install .
  1. 配置 Goose CLI
$ goose configure

This will update your existing config file
  if you prefer, you can edit it directly at /home/yurinnick/.config/goose/config.yaml

┌   goose-configure
│
◇  What would you like to configure?
│  Add Extension
│
◇  What type of extension would you like to add?
│  Command-line Extension
│
◇  What would you like to call this extension?
│  kube-mcp
│
◇  What command should be run?
│  uv run /global/path/to/kube-mcp/.venv/bin/mcp-kube
│
◇  Please set the timeout for this tool (in secs):
│  300
│
◇  Would you like to add a description?
│  No
│
◇  Would you like to add environment variables?
│  No
│
└  Added kube-mcp extension
  1. 验证扩展是否已激活
$ goose

( O)> What tools do you have?
Let me list out the tools that are currently available to me:

1. **Kubernetes MCP Tools**:
   - `kube-mcp__get_resources` - Get resources of a specific kind in a namespace
   - `kube-mcp__get_resource` - Get a specific resource by kind, name, and namespace
   - `kube-mcp__patch_resource` - Patch a specific resource

Let me also check if there are any additional resources available in the kube-mcp extension:
─── list_resources | platform ──────────────────────────
extension_name: kube-mcp

I can also see there are two resources available in the kube-mcp extension:
- `kube://config`
- `kube://context`

Let me check what information these resources provide:
─── read_resource | platform ──────────────────────────
uri: kube://config
─── read_resource | platform ──────────────────────────
uri: kube://context

💻 使用示例

开发环境启动

  1. 激活虚拟环境
$ .venv/bin/activate
  1. 以开发模式运行 MCP 服务器
$ uv run mcp dev kube_mcp/server.py
help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client