kubeview
Read-only Model Context Protocol MCP server enabling code-driven AI analysis of Kubernetes clusters.
MCP 服务配置
复制以下 JSON 到 OPClaw 或其他 MCP 客户端的配置文件中即可使用
{
"mcpServers": {
"kubeview-mcp": {
"args": [
"kubeview-mcp@1.5.1"
],
"command": "npx"
}
}
}
可用工具 (5 个)
该服务在 MCP 协议中暴露的工具,AI 可按需调用
tavily_search 14 个参数 需填 1 项
Search the web for current information on any topic. Use for news, facts, or data beyond your knowledge cutoff. Returns snippets and source URLs.
必填参数:query
tavily_extract 6 个参数 需填 1 项
Extract content from URLs. Returns raw page content in markdown or text format.
必填参数:urls
tavily_crawl 11 个参数 需填 1 项
Crawl a website starting from a URL. Extracts content from pages with configurable depth and breadth.
必填参数:url
tavily_map 8 个参数 需填 1 项
Map a website's structure. Returns a list of URLs found starting from the base URL.
必填参数:url
tavily_research 2 个参数 需填 1 项
Perform comprehensive research on a given topic or question. Use this tool when you need to gather information from multiple sources to answer a question or complete a task. Returns a detailed response based on the research findings.
必填参数:input
服务介绍
KubeView MCP 鈥� Kubernetes Model Context Protocol Server
KubeView is a read-only Model Context Protocol (MCP) server that enables AI agents (like Cursor IDE, Claude Code CLI, Codex CLI, Gemini CLI, etc.) to inspect, diagnose, and debug Kubernetes clusters safely. It provides a comprehensive set of tools for Kubernetes, Helm, Argo Workflows, and Argo CD.
Learn more about the benefits of code mode and implementation in Evicting MCP tool calls from your Kubernetes cluster.
鉁� Features
- 馃 Code Mode: Sandboxed TypeScript environment for complex reasoning and multi-step workflows.
- 馃洝锔� Read-Only & Safe: Designed for production safety with zero write access and sensitive data masking.
- 鈽革笍 Kubernetes Integration: List/get resources, fetch metrics, stream logs and events, execute commands, and tools to diagnose network issues.
- 馃摝 Helm Support: Inspect releases, values, manifests, and history.
- 馃悪 Argo Ecosystem: Manage Argo Workflows and Argo CD applications using direct Kubernetes API or CLI.
馃殌 Quick Start
Prerequisites
- Node.js 鈮� 18
- Access to a Kubernetes cluster
- Optionally, CLIs installed in current $PATH:
helm,argo,argocd
Installation
# start the server
npx -y kubeview-mcp
# install as a claude code mcp server
claude mcp add kubernetes -- npx kubeview-mcp
Configuration for MCP Clients
Add to your mcpServers configuration (e.g., in Cursor or Claude Desktop):
{
"mcpServers": {
"kubeview": {
"command": "npx",
"args": ["-y", "kubeview-mcp"]
}
}
}
Environment Variables
Configure the server using environment variables:
| Variable | Description | Default |
|---|---|---|
KUBECONFIG |
Path to kubeconfig file | ~/.kube/config |
MCP_MODE |
Server mode: all, code, or tools |
all |
MCP_LOG_LEVEL |
Log level (error, warn, info, debug) |
info |
MCP_HIDE_SENSITIVE |
Enable global sensitive data masking | false |
馃洜锔� Tools Overview
Kubernetes
kube_list: List resources or get cluster diagnostics.kube_get: Describe specific resources (supports all K8s types).kube_metrics: Fetch CPU/memory metrics for nodes and pods.kube_logs: Fetch or stream container logs.kube_exec: Execute commands in containers (read-only recommended).kube_port: Port-forward to pods/services.kube_net: Run in-cluster network diagnostics.
Helm
helm_list: List Helm releases.helm_get: Fetch release values, manifests, and history.
Argo
argo_list/argo_get: Manage Argo Workflows.argocd_app: Inspect Argo CD applications and resources.
Utilities
run_code: Execute sandboxed TypeScript code for complex tasks.
馃 Code Mode
Inspired by Code execution with MCP, KubeView ships with a code-mode runtime that allows agents to explore the API, search tools, and execute complex workflows in a sandboxed environment.
What it provides
- MCP Bridge Layer: Seamlessly connects to all registered MCP server tools.
- Dynamic TypeScript Definitions: Automatically converts tool schemas into a strongly-typed
global.d.tsresource, enabling agents to use valid TypeScript patterns and enjoy type safety without hallucinating parameters. - Tool Search Utilities: Runtime helpers like
tools.search()andtools.list()allow agents to progressively discover capabilities without needing to load the entire schema context upfront. - Sandboxed Execution: A locked-down Node.js environment (via
vm) with controlled access to theconsoleand thetoolsglobal object, ensuring safe execution of agent-generated code.
Usage
For complex tasks requiring logic, loops, or data processing, use Code Mode:
"env": { "MCP_MODE": "code" }
馃挕 Pro Tip: Code Mode Prompt
The server includes a built-in prompt named code-mode that injects the full TypeScript API documentation, tool overview, and examples into the context.
In Cursor IDE:
Simply type /kubeview/code-mode in the prompt (or select it from the / prompt menu). This gives the AI the exact context it needs to write correct run_code scripts immediately.
馃捇 Local Development
-
Clone & Install:
git clone https://github.com/mikhae1/kubeview-mcp.git cd kubeview-mcp npm install -
Build & Run:
npm run build npm start -
Test:
npm test
CLI Usage
You can test tools directly via the CLI:
npm run command -- kube_list --namespace=default
馃搫 License
MIT 漏 mikhae1