kubeview — Claude Code MCP server: what it does, how to install
Runs Kubernetes diagnostics through an isolated TypeScript runtime. Keeps intermediate logs and cluster events out of the model prompt.
claude mcp add --env KUBECONFIG=<KUBECONFIG> --env MCP_TRANSPORT=<MCP_TRANSPORT> --env MCP_MODE=<MCP_MODE> --env MCP_CODE_MODE_DISABLED_TOOLS=<MCP_CODE_MODE_DISABLED_TOOLS> --env MCP_ARGO_TOOLS=<MCP_ARGO_TOOLS> --transport stdio kubeview -- npx -y kubeview-mcpWhat kubeview does
Kubeview provides code execution mode instead of dozens of standalone tools. The assistant evaluates TypeScript via run_code, querying the cluster API and Helm releases directly. Raw payloads never touch the context window. Intermediate logs stay inside the sandbox runtime.
Only two tools are exposed: run_code and kube_pod_exec. Shell execution in pods requires explicit elicitation and expires after 10 minutes. Network port forwarding stays blocked by default. Without Node.js 22 or higher and valid cluster access in KUBECONFIG, the server will not start.
What it helps with
- inspect failing pods across namespaces without context bloat
- correlate cluster events with Helm releases and Argo state
- run diagnostic commands in containers behind approval gates
- fetch and filter container logs in a single batch
Example prompts for the agent
- Check pods with errors in the payments namespace and summarize their logs
- Inspect cluster events and compare them against recent Helm revisions
- Execute run_code to find pods restarting frequently and inspect their exit codes
How to install kubeview
Platform CLI
claude mcp add --env KUBECONFIG=<KUBECONFIG> --env MCP_TRANSPORT=<MCP_TRANSPORT> --env MCP_MODE=<MCP_MODE> --env MCP_CODE_MODE_DISABLED_TOOLS=<MCP_CODE_MODE_DISABLED_TOOLS> --env MCP_ARGO_TOOLS=<MCP_ARGO_TOOLS> --transport stdio kubeview -- npx -y kubeview-mcpReplace <…> with your own values. 19 more environment variables are in the server README
Platform CLI
codex mcp add kubeview --env KUBECONFIG=<KUBECONFIG> --env MCP_TRANSPORT=<MCP_TRANSPORT> --env MCP_MODE=<MCP_MODE> --env MCP_CODE_MODE_DISABLED_TOOLS=<MCP_CODE_MODE_DISABLED_TOOLS> --env MCP_ARGO_TOOLS=<MCP_ARGO_TOOLS> -- npx -y kubeview-mcpReplace <…> with your own values. 19 more environment variables are in the server README
Config file
{
"mcpServers": {
"kubeview": {
"command": "npx",
"args": [
"-y",
"kubeview-mcp"
],
"env": {
"KUBECONFIG": "<KUBECONFIG>",
"MCP_TRANSPORT": "<MCP_TRANSPORT>",
"MCP_MODE": "<MCP_MODE>",
"MCP_CODE_MODE_DISABLED_TOOLS": "<MCP_CODE_MODE_DISABLED_TOOLS>",
"MCP_ARGO_TOOLS": "<MCP_ARGO_TOOLS>"
}
}
}
}Replace <…> with your own values. 19 more environment variables are in the server README
Config file
{
"servers": {
"kubeview": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"kubeview-mcp"
],
"env": {
"KUBECONFIG": "<KUBECONFIG>",
"MCP_TRANSPORT": "<MCP_TRANSPORT>",
"MCP_MODE": "<MCP_MODE>",
"MCP_CODE_MODE_DISABLED_TOOLS": "<MCP_CODE_MODE_DISABLED_TOOLS>",
"MCP_ARGO_TOOLS": "<MCP_ARGO_TOOLS>"
}
}
}
}Replace <…> with your own values. 19 more environment variables are in the server README
Platform CLI
gemini mcp add -e KUBECONFIG=<KUBECONFIG> -e MCP_TRANSPORT=<MCP_TRANSPORT> -e MCP_MODE=<MCP_MODE> -e MCP_CODE_MODE_DISABLED_TOOLS=<MCP_CODE_MODE_DISABLED_TOOLS> -e MCP_ARGO_TOOLS=<MCP_ARGO_TOOLS> kubeview npx -y kubeview-mcpReplace <…> with your own values. 19 more environment variables are in the server README
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about kubeview
How to install kubeview in Claude Code?
Run claude mcp add kubeview -e MCP_APPROVAL_STATE_SECRET=<MCP_APPROVAL_STATE_SECRET> -- npx -y kubeview-mcp in your terminal.
What does kubeview do?
It gives the model a sandboxed TypeScript environment to inspect Kubernetes clusters. Diagnostic scripts execute in a single call, preventing huge API payloads from consuming the context window.
What prerequisites are required for kubeview?
The server requires Node.js 22 or later. It also needs cluster credentials set through KUBECONFIG or an in-cluster service account.