K8s MCP 06272da3

MCP运维云端

提供方 AceDarkknight

运维云端 未标注 Token 社区 / 第三方 VS Code

一个用于Kubernetes集群管理和资源查看的Model Context Protocol (MCP)服务器,提供安全的只读访问和全面的集群管理工具集。

一句话选型结论

按资料字段整理

K8s MCP 06272da3 属于运维云端类 MCP 服务器,传输方式未标注,Token,可直接接入 VS Code,没有现成安装命令,需按官方文档接入。接入前先确认权限范围;涉及写入、删除或付款的操作,建议先在测试环境验证。

分类运维云端 传输方式未标注 鉴权Token 部署方式未标注
GitHub 星标 0 仓库热度,无公开仓库时显示未标注
工具数 11 暴露给模型的工具数量
资源 / 提示词 0 / 0 资源与提示词模板数量
维护方 社区 / 第三方 核验等级 仅资料核对

工具与能力

运维云端
数量来自来源目录的标注,具体工具清单以官方文档为准
工具数量11暴露给模型可调用的工具个数
资源数量0可读取的资源条目
提示词数量0内置提示词模板数量

能力标签

支持客户端

适用场景

Kubernetes管理Go本地部署集群监控资源查看安全访问MCP协议

安装与配置

未标注 Token
上游未给出传输方式
  1. 1
    准备运行环境

    按官方文档确认运行环境(常见为 Node.js 或 Python),装好后再执行安装命令。

  2. 2
    安装服务

    复制上面的安装命令执行;命令里带占位符的位置,换成自己的密钥或路径。

  3. 3
    写入客户端配置

    在客户端的 MCP 配置里填好启动命令和参数,保存后完全退出客户端再打开,让新配置生效。

  4. 4
    验证是否可用

    连接成功后客户端会列出约 11 个工具,随便调一个只读工具确认能返回结果。

典型使用场景

3 类
按分类与标签整理的常见用法,具体以官方文档为准
云资源查询

查实例、存储、账单等云上资源状态。

部署与发布

把部署、重启、回滚这类操作接进对话。

监控与告警

拉取监控指标,异常时让模型帮你判断。

选择建议

选之前先看这几条
按条目字段给出的判断,不替你决定用不用

值得选的地方

  • 资料标注 11 个工具,覆盖面较广,能满足多种调用。
  • 已适配 VS Code,换客户端不用重新研究配置。

先想清楚的地方

  • 没有现成安装命令,需要按官方文档自己填启动命令和参数。
  • 使用前要准备好Token对应的凭据,并按最小权限配置。
  • 版本更新与行为细节以官方仓库为准。

更适合

  • 需要在运维云端场景里让模型直接调用外部能力的人。
  • 已经在用 VS Code 的用户,接入路径最短。
  • 想先快速试一下、能接受在本地或自有环境跑服务的人。

不太适合

  • 不方便管理密钥或第三方授权的人。
  • 需要厂商级 SLA 和技术支持的生产环境。

同类对比

6 个同类
同分类里挑最接近的几条,字段以各自详情页为准
MCP 服务器工具数传输方式部署方式安装命令最后核验
K8s MCP 06272da3当前 11 未标注 未标注 无 2026-05-17
lobehub 未标注 stdio · 本地进程 本地部署 有 2026-04-11
TrendRadar 未标注 stdio · 本地进程 本地部署 有 2026-04-13
Ui Tars Desktop 8a825770 未标注 stdio · 本地进程 本地部署 有 2026-05-17
ruflo 未标注 stdio · 本地进程 本地部署 有 2026-04-13
FastGPT 未标注 stdio · 本地进程 本地部署 有 2026-04-11

服务器档案

运维云端
字段来自项目仓库与公开索引,中文说明由本站标注
提供方AceDarkknight上游标注的维护方 AceDarkknight
分类运维云端本站按上游分类展示
连接方式未标注上游未给出传输方式
鉴权方式Token远程服务建议用最小权限凭据
维护方社区 / 第三方核验等级 仅资料核对
包名 / 运行时未标注 · 未标注本地安装时用到的包标识与运行时
部署类型未标注上游给出的部署形态
最近核验2026-05-17上游最后核验时间

详细介绍

6.9 KB
来自项目仓库与上游目录的原文,未做删改

k8s-mcp

A Model Context Protocol (MCP) server for Kubernetes cluster management and resource viewing.

Features

  • 🔗 Connect to Kubernetes clusters via HTTP/SSE
  • 👀 View Kubernetes resources (read-only)
  • 🛡️ Secure access with Token authentication
  • 📊 Comprehensive tool set for cluster management
  • 🔒 Secret data redaction for security
  • 🚀 CLI powered by Cobra and Viper

Architecture

  • MCP Server (Golang): Provides k8s cluster connection and resource viewing capabilities via HTTP/SSE
  • MCP Client (Golang): Test client for validating server functionality
  • pkg/mcpclient (Golang): Reusable client library for integrating MCP functionality into other Go applications

Quick Start

Prerequisites

  • Go 1.23 or later
  • kubectl configured with cluster access
  • Valid kubeconfig file
  • TLS certificate and key (for HTTPS mode, default)

Building```bash

Build MCP server

go build -o bin/k8s-mcp-server ./cmd/server

Build test client

go build -o bin/k8s-mcp-client ./cmd/client


### Running

#### 1. Generate TLS Certificate (for HTTPS mode)```bash
# Generate a self-signed certificate for testing
openssl req -x509 -newkey rsa:4096 -nodes -days 365 -keyout key.pem -out cert.pem -subj "/CN=localhost"

2. Start MCP Server```bash

Using command line flags

./bin/k8s-mcp-server --token my-secret-token --cert cert.pem --key key.pem

Using environment variables (flags override env vars)

export MCP_TOKEN=my-secret-token
export MCP_CERT=cert.pem
export MCP_KEY=key.pem
./bin/k8s-mcp-server


#### 3. Test with Client```bash
# Connect to HTTPS server
./bin/k8s-mcp-client --server https://localhost:8443 --token my-secret-token

# Connect to HTTP server
./bin/k8s-mcp-client --server http://localhost:8443 --token my-secret-token --insecure-skip-verify

Configuration

The server supports configuration via command-line flags and environment variables.

Server Configuration

Flag Environment Variable Default Description
--port MCP_PORT 8443 Port to listen on
--cert MCP_CERT Path to TLS certificate file (required for HTTPS)
--key MCP_KEY Path to TLS key file (required for HTTPS)
--insecure MCP_INSECURE false Run in insecure HTTP mode (default is HTTPS)
--token MCP_TOKEN Authentication token (required)
--kubeconfig MCP_KUBECONFIG Path to kubeconfig file (optional)

Logging Configuration

The server provides a comprehensive logging system based on Uber Zap and Lumberjack.

Flag Environment Variable Default Description
--log-level info Log level (debug, info, warn, error)
--log-format text Log format (json, text)
--log-to-file false (Server: true) Enable logging to file (Server defaults to true)
--log-file logs/app.log Log file path
--log-max-size 100 Maximum size of each log file (MB)
--log-max-backups 3 Maximum number of old log files to retain
--log-max-age 30 Maximum number of days to retain old log files
--log-compress true Whether to compress old log files
--log-caller true Whether to include caller information (file and line)
--log-stacktrace false Whether to include stacktrace on error level

When --log-to-file is enabled, logs are written to both stdout/stderr and the specified log file. The logging system automatically handles log rotation based on size, age, and number of backups.

Client Configuration

Flag Environment Variable Default Description
--server MCP_CLIENT_SERVER https://localhost:8443 MCP server URL
--token MCP_CLIENT_TOKEN Authentication token (required)
--insecure-skip-verify MCP_CLIENT_INSECURE_SKIP_VERIFY false Skip TLS certificate verification

MCP Tools

The server provides the following tools:

Cluster Management

  • get_cluster_status: Get cluster status information (version, node count, namespace count)
  • list_nodes: List all nodes in cluster
  • list_namespaces: List all namespaces in cluster

Resource Management

  • list_pods: List pods in a namespace
  • list_services: List services in a namespace
  • list_deployments: List deployments in a namespace

  • get_resource: Get detailed information about a specific resource (JSON format). Secrets will be redacted.

  • get_resource_yaml: Get full YAML definition of a resource. Secrets will be redacted.

Observability & Debugging

  • get_events: Get cluster events
  • get_pod_logs: Get pod logs. Default tail_lines=100, max_bytes=1MB

Security

  • check_rbac_permission: Check if the current user has permission to perform an action (kubectl auth can-i)

Security

  • All operations are read-only by default
  • Token-based authentication is required for all connections
  • Secret data is automatically redacted when retrieved
  • Supports RBAC permission validation
  • Secure kubeconfig handling
  • Connection timeout and retry mechanisms

Integration

Using as a Library

The pkg/mcpclient package can be imported and used in other Go applications:```go
package main

import (
"context"
"fmt"
"log"

"github.com/AceDarkknight/k8s-mcp/pkg/mcpclient"

)

func main() {
// Create configuration
config := mcpclient.Config{
ServerURL: "https://localhost:8443",
AuthToken: "your-token",
InsecureSkipVerify: true,
}

// Create client with optional custom headers
client, err := mcpclient.NewClient(config,
    mcpclient.WithHeader("X-Custom-Header", "value"),
)
if err != nil {
    log.Fatal(err)
}
defer client.Close()

// Connect to server
ctx := context.Background()
if err := client.Connect(ctx); err != nil {
    log.Fatal(err)
}

// List tools
tools, err := client.ListTools(ctx)
if err != nil {
    log.Fatal(err)
}

for _, tool := range tools {
    fmt.Printf("Tool: %s\n", tool.Name)
}

// Call a tool
result, err := client.CallTool(ctx, "get_cluster_status", nil)
if err != nil {
    log.Fatal(err)
}

fmt.Printf("Result: %v\n", result)

}
```

For more details, see pkg/mcpclient/README.md.

MCP Protocol Integration

k8s-mcp follows the standard MCP protocol and can be integrated into any MCP-compatible application:

  1. Claude Desktop: AI assistant can view and analyze Kubernetes resources
  2. VS Code: Get Kubernetes context via MCP extensions
  3. Custom Applications: Use MCP client libraries to integrate

Development

To add new features:

  1. New Tools: Add new tool definitions and handler functions in internal/mcp/server.go
  2. New Resources: Add new resource types in internal/k8s/resources.go

The project uses a modular design for easy extension and maintenance.

常见问题

6 问
答案由本站依据条目字段整理,不引用上游原文
K8s MCP 06272da3 怎么安装?

资料没有给出安装命令,请到官方仓库或文档按说明接入;这类条目多数是生态应用,或尚未发布可安装包。

K8s MCP 06272da3 怎么在 VS Code 里配置?

它的传输方式未标注,在客户端的 MCP 配置里填好启动命令和参数,保存后完全退出客户端再打开,配置才会生效。

K8s MCP 06272da3 收费吗?

本站不代收费用,也没有标注具体价格。是否收费取决于服务本身和背后的接口额度,正式使用前按官方说明确认。

K8s MCP 06272da3 需要 API Key 吗?

资料标注需要Token认证,使用前准备好对应凭据,并按最小权限配置。

K8s MCP 06272da3 支持哪些客户端?

资料标注支持 VS Code;其他客户端只要能配置 MCP Server,也能用同样的命令或地址接入。

K8s MCP 06272da3 能提供哪些能力?

资料显示约 11 个工具;能力标签包括 Kubernetes管理、安全访问、Go、VS Code。具体工具清单以官方文档为准。

热门专题

按标签挑服务器
全部专题 →

服务器信息以作者仓库与官方文档为准;分类、传输方式与鉴权方式的中文说明为中文整理,最近核验 2026-05-17。