kubeview-mcp 1.6.0 → 1.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (85) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/README.md +68 -84
  3. package/SKILL.md +101 -92
  4. package/dist/scripts/publish-mcp.d.ts +3 -0
  5. package/dist/scripts/publish-mcp.d.ts.map +1 -0
  6. package/dist/scripts/publish-mcp.js +10 -0
  7. package/dist/scripts/publish-mcp.js.map +1 -0
  8. package/dist/scripts/release-publish.d.ts +36 -0
  9. package/dist/scripts/release-publish.d.ts.map +1 -0
  10. package/dist/scripts/release-publish.js +206 -0
  11. package/dist/scripts/release-publish.js.map +1 -0
  12. package/dist/src/kubernetes/resources/HelmReleaseOperations.d.ts +62 -0
  13. package/dist/src/kubernetes/resources/HelmReleaseOperations.d.ts.map +1 -0
  14. package/dist/src/kubernetes/resources/HelmReleaseOperations.js +381 -0
  15. package/dist/src/kubernetes/resources/HelmReleaseOperations.js.map +1 -0
  16. package/dist/src/plugins/HelmToolsPlugin.d.ts +3 -1
  17. package/dist/src/plugins/HelmToolsPlugin.d.ts.map +1 -1
  18. package/dist/src/plugins/HelmToolsPlugin.js +43 -6
  19. package/dist/src/plugins/HelmToolsPlugin.js.map +1 -1
  20. package/dist/src/tools/helm/BaseTool.d.ts +2 -1
  21. package/dist/src/tools/helm/BaseTool.d.ts.map +1 -1
  22. package/dist/src/tools/helm/BaseTool.js.map +1 -1
  23. package/dist/src/tools/helm/HelmGetHooksTool.d.ts +2 -1
  24. package/dist/src/tools/helm/HelmGetHooksTool.d.ts.map +1 -1
  25. package/dist/src/tools/helm/HelmGetHooksTool.js +1 -1
  26. package/dist/src/tools/helm/HelmGetHooksTool.js.map +1 -1
  27. package/dist/src/tools/helm/HelmGetManifestTool.d.ts +2 -1
  28. package/dist/src/tools/helm/HelmGetManifestTool.d.ts.map +1 -1
  29. package/dist/src/tools/helm/HelmGetManifestTool.js +1 -1
  30. package/dist/src/tools/helm/HelmGetManifestTool.js.map +1 -1
  31. package/dist/src/tools/helm/HelmGetNotesTool.d.ts +2 -1
  32. package/dist/src/tools/helm/HelmGetNotesTool.d.ts.map +1 -1
  33. package/dist/src/tools/helm/HelmGetNotesTool.js +1 -1
  34. package/dist/src/tools/helm/HelmGetNotesTool.js.map +1 -1
  35. package/dist/src/tools/helm/HelmGetResourcesTool.d.ts +2 -1
  36. package/dist/src/tools/helm/HelmGetResourcesTool.d.ts.map +1 -1
  37. package/dist/src/tools/helm/HelmGetResourcesTool.js +1 -1
  38. package/dist/src/tools/helm/HelmGetResourcesTool.js.map +1 -1
  39. package/dist/src/tools/helm/HelmGetTool.d.ts +4 -2
  40. package/dist/src/tools/helm/HelmGetTool.d.ts.map +1 -1
  41. package/dist/src/tools/helm/HelmGetTool.js +179 -91
  42. package/dist/src/tools/helm/HelmGetTool.js.map +1 -1
  43. package/dist/src/tools/helm/HelmGetValuesTool.d.ts +2 -1
  44. package/dist/src/tools/helm/HelmGetValuesTool.d.ts.map +1 -1
  45. package/dist/src/tools/helm/HelmGetValuesTool.js +1 -1
  46. package/dist/src/tools/helm/HelmGetValuesTool.js.map +1 -1
  47. package/dist/src/tools/helm/HelmHistoryTool.d.ts +2 -1
  48. package/dist/src/tools/helm/HelmHistoryTool.d.ts.map +1 -1
  49. package/dist/src/tools/helm/HelmHistoryTool.js +1 -1
  50. package/dist/src/tools/helm/HelmHistoryTool.js.map +1 -1
  51. package/dist/src/tools/helm/HelmListTool.d.ts +3 -1
  52. package/dist/src/tools/helm/HelmListTool.d.ts.map +1 -1
  53. package/dist/src/tools/helm/HelmListTool.js +42 -10
  54. package/dist/src/tools/helm/HelmListTool.js.map +1 -1
  55. package/dist/src/tools/helm/HelmListWithResourcesTool.d.ts +2 -1
  56. package/dist/src/tools/helm/HelmListWithResourcesTool.d.ts.map +1 -1
  57. package/dist/src/tools/helm/HelmListWithResourcesTool.js +1 -1
  58. package/dist/src/tools/helm/HelmListWithResourcesTool.js.map +1 -1
  59. package/dist/src/tools/helm/HelmStatusTool.d.ts +2 -1
  60. package/dist/src/tools/helm/HelmStatusTool.d.ts.map +1 -1
  61. package/dist/src/tools/helm/HelmStatusTool.js +1 -1
  62. package/dist/src/tools/helm/HelmStatusTool.js.map +1 -1
  63. package/dist/src/utils/HelmDataParser.d.ts +51 -0
  64. package/dist/src/utils/HelmDataParser.d.ts.map +1 -0
  65. package/dist/src/utils/HelmDataParser.js +144 -0
  66. package/dist/src/utils/HelmDataParser.js.map +1 -0
  67. package/dist/src/version.d.ts +1 -1
  68. package/dist/src/version.js +1 -1
  69. package/dist/tests/helm/HelmGetTool.test.d.ts +2 -0
  70. package/dist/tests/helm/HelmGetTool.test.d.ts.map +1 -0
  71. package/dist/tests/helm/HelmGetTool.test.js +78 -0
  72. package/dist/tests/helm/HelmGetTool.test.js.map +1 -0
  73. package/dist/tests/kubernetes/HelmReleaseOperations.test.d.ts +2 -0
  74. package/dist/tests/kubernetes/HelmReleaseOperations.test.d.ts.map +1 -0
  75. package/dist/tests/kubernetes/HelmReleaseOperations.test.js +218 -0
  76. package/dist/tests/kubernetes/HelmReleaseOperations.test.js.map +1 -0
  77. package/dist/tests/release/PublishWorkflow.test.d.ts +7 -0
  78. package/dist/tests/release/PublishWorkflow.test.d.ts.map +1 -0
  79. package/dist/tests/release/PublishWorkflow.test.js +103 -0
  80. package/dist/tests/release/PublishWorkflow.test.js.map +1 -0
  81. package/dist/tests/utils/HelmDataParser.test.d.ts +2 -0
  82. package/dist/tests/utils/HelmDataParser.test.d.ts.map +1 -0
  83. package/dist/tests/utils/HelmDataParser.test.js +81 -0
  84. package/dist/tests/utils/HelmDataParser.test.js.map +1 -0
  85. package/package.json +8 -7
package/CHANGELOG.md CHANGED
@@ -7,6 +7,23 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [1.7.1] - 2026-03-07
11
+
12
+ ### Changed
13
+ - **Refactor publishing scripts and add tests for release workflow**
14
+ - **Enhance publish scripts and update README for clarity**
15
+ - **Update publish:mcp script in package.json to remove login requirement for mcp-publisher**
16
+ - **Refactor CLI run-command.js to simplify Kubernetes and Helm tool class handling**
17
+
18
+ ## [1.7.0] - 2026-02-17
19
+
20
+ ### Added
21
+ - **feat(helm): add API-first backend support for Helm commands**
22
+ - **feat(helm): add CLI fallback support for Helm v4 commands**
23
+
24
+ ### Changed
25
+ - **Refactor CLI run-command.js to simplify Kubernetes and Helm tool class handling**
26
+
10
27
  ## [1.6.0] - 2026-02-04
11
28
 
12
29
  ### Changed
package/README.md CHANGED
@@ -1,29 +1,23 @@
1
1
  # KubeView MCP – Kubernetes Model Context Protocol Server
2
2
 
3
+ [![npm version](https://img.shields.io/npm/v/kubeview-mcp)](https://www.npmjs.com/package/kubeview-mcp)
3
4
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
4
5
  [![Node.js Version](https://img.shields.io/badge/node-%3E%3D18.0.0-brightgreen)](https://nodejs.org/)
5
6
  [![TypeScript](https://img.shields.io/badge/TypeScript-5.8+-blue)](https://www.typescriptlang.org/)
6
7
 
7
- **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.
8
- Learn more about the benefits of code mode and implementation in [Evicting MCP tool calls from your Kubernetes cluster](https://dev.to/mikhae1/evicting-mcp-tool-calls-from-your-kubernetes-cluster-428k).
8
+ **KubeView** is a read-only [Model Context Protocol](https://modelcontextprotocol.io/) (MCP) server that lets AI agents (Cursor, Claude Code, Codex CLI, Gemini CLI, etc.) safely inspect, diagnose, and debug Kubernetes clusters. It covers Kubernetes core, Helm, Argo Workflows, and Argo CD.
9
9
 
10
- ---
11
-
12
- ## ✨ Features
13
-
14
- - **🧠 Code Mode**: Sandboxed TypeScript environment for complex reasoning and multi-step workflows.
15
- - **🛡️ Read-Only & Safe**: Designed for production safety with zero write access and sensitive data masking.
16
- - **☸️ Kubernetes Integration**: List/get resources, fetch metrics, stream logs and events, execute commands, and tools to diagnose network issues.
17
- - **📦 Helm Support**: Inspect releases, values, manifests, and history.
18
- - **🐙 Argo Ecosystem**: Manage Argo Workflows and Argo CD applications using direct Kubernetes API or CLI.
10
+ > Read more: [Evicting MCP tool calls from your Kubernetes cluster](https://dev.to/mikhae1/evicting-mcp-tool-calls-from-your-kubernetes-cluster-428k)
19
11
 
20
12
  ---
21
13
 
22
- ## MCP SDK Compatibility
14
+ ## Features
23
15
 
24
- - This project is pinned to `@modelcontextprotocol/sdk@^1.25.3`.
25
- - Legacy loose type imports (`Tools`, `Prompts`, `Resources`, `Roots`, `Sampling`) are disallowed.
26
- - This compatibility pass intentionally excludes Streamable HTTP transport migration and icon metadata rollout.
16
+ - **🧠 Code Mode** Sandboxed TypeScript runtime for complex reasoning and multi-step workflows.
17
+ - **🛡️ Read-Only & Safe** Zero write access; sensitive data masking for production clusters.
18
+ - **☸️ Kubernetes** List/get resources, fetch metrics, stream logs and events, exec into containers, diagnose network issues.
19
+ - **📦 Helm (API-first)** – Inspect releases, values, manifests, and history via the Kubernetes API with CLI fallback.
20
+ - **🐙 Argo Ecosystem** – Manage Argo Workflows and Argo CD via the Kubernetes API or CLI.
27
21
 
28
22
  ---
29
23
 
@@ -33,21 +27,21 @@ Learn more about the benefits of code mode and implementation in [Evicting MCP t
33
27
 
34
28
  - Node.js ≥ 18
35
29
  - Access to a Kubernetes cluster
36
- - Optionally, CLIs installed in current $PATH: `helm`, `argo`, `argocd`
30
+ - Optional CLIs in `$PATH`: `helm` (fallback only), `argo`, `argocd`
37
31
 
38
32
  ### Installation
39
33
 
40
34
  ```bash
41
- # start the server
35
+ # Run the server directly
42
36
  npx -y kubeview-mcp
43
37
 
44
- # install as a claude code mcp server
38
+ # Add to Claude Code
45
39
  claude mcp add kubernetes -- npx kubeview-mcp
46
40
  ```
47
41
 
48
- ### Configuration for MCP Clients
42
+ ### MCP Client Configuration
49
43
 
50
- Add to your `mcpServers` configuration (e.g., in Cursor or Claude Desktop):
44
+ Add to your `mcpServers` config (Cursor, Claude Desktop, etc.):
51
45
 
52
46
  ```json
53
47
  {
@@ -62,104 +56,94 @@ Add to your `mcpServers` configuration (e.g., in Cursor or Claude Desktop):
62
56
 
63
57
  ### Environment Variables
64
58
 
65
- Configure the server using environment variables:
66
-
67
- | Variable | Description | Default |
68
- |----------|-------------|---------|
69
- | `KUBECONFIG` | Path to kubeconfig file | `~/.kube/config` |
70
- | `MCP_MODE` | Server mode: `all`, `code`, or `tools` | `all` |
71
- | `MCP_LOG_LEVEL` | Log level (`error`, `warn`, `info`, `debug`) | `info` |
72
- | `MCP_HIDE_SENSITIVE` | Enable global sensitive data masking | `false` |
59
+ | Variable | Description | Default |
60
+ | -------------------- | -------------------------------------------- | ---------------- |
61
+ | `KUBECONFIG` | Path to kubeconfig file | `~/.kube/config` |
62
+ | `MCP_MODE` | Server mode: `all`, `code`, or `tools` | `all` |
63
+ | `MCP_LOG_LEVEL` | Log level: `error`, `warn`, `info`, `debug` | `info` |
64
+ | `MCP_HIDE_SENSITIVE` | Mask sensitive data globally | `false` |
73
65
 
74
66
  ---
75
67
 
76
- ## 🛠️ Tools Overview
68
+ ## 🛠️ Tools
77
69
 
78
70
  ### Kubernetes
79
- - **`kube_list`**: List resources or get cluster diagnostics.
80
- - **`kube_get`**: Describe specific resources (supports all K8s types).
81
- - **`kube_metrics`**: Fetch CPU/memory metrics for nodes and pods.
82
- - **`kube_logs`**: Fetch or stream container logs.
83
- - **`kube_exec`**: Execute commands in containers (read-only recommended).
84
- - **`kube_port`**: Port-forward to pods/services.
85
- - **`kube_net`**: Run in-cluster network diagnostics.
71
+
72
+ | Tool | Description |
73
+ | -------------- | -------------------------------------------------------- |
74
+ | `kube_list` | List resources or get cluster diagnostics |
75
+ | `kube_get` | Describe a specific resource (all K8s types supported) |
76
+ | `kube_metrics` | Fetch CPU/memory metrics for nodes and pods |
77
+ | `kube_logs` | Fetch or stream container logs |
78
+ | `kube_exec` | Execute commands inside containers |
79
+ | `kube_port` | Port-forward to pods or services |
80
+ | `kube_net` | Run in-cluster network diagnostics |
86
81
 
87
82
  ### Helm
88
- - **`helm_list`**: List Helm releases.
89
- - **`helm_get`**: Fetch release values, manifests, and history.
83
+
84
+ | Tool | Description |
85
+ | ----------- | ----------------------------------------------------------------- |
86
+ | `helm_list` | List Helm releases (Kubernetes API first, CLI fallback) |
87
+ | `helm_get` | Fetch release values, manifests, notes, hooks, status, history |
88
+
89
+ **Helm execution strategy:** Tools read Helm metadata directly from Kubernetes storage (Secrets / ConfigMaps) by default — no `helm` binary needed for standard read-only use. CLI fallback is used for non-JSON formatting or non-Kubernetes storage backends (e.g. SQL).
90
90
 
91
91
  ### Argo
92
- - **`argo_list` / `argo_get`**: Manage Argo Workflows.
93
- - **`argocd_app`**: Inspect Argo CD applications and resources.
92
+
93
+ | Tool | Description |
94
+ | ------------- | ---------------------------------------- |
95
+ | `argo_list` | List Argo Workflows |
96
+ | `argo_get` | Inspect a specific Argo Workflow |
97
+ | `argocd_app` | Inspect Argo CD applications |
94
98
 
95
99
  ### Utilities
96
- - **`run_code`**: Execute sandboxed TypeScript code for complex tasks.
97
- - **`plan_step`**: Record step-by-step planning state for long, complex investigations.
98
100
 
99
- ### Why `plan_step` really helps:
101
+ | Tool | Description |
102
+ | ----------- | -------------------------------------------------------------- |
103
+ | `run_code` | Execute sandboxed TypeScript for complex tasks |
104
+ | `plan_step` | Persist step-by-step planning state across long investigations |
100
105
 
101
- 1. **Stable multi-step planning without bloating chat context.**
102
- Instead of dumping a massive plan into the conversation, the agent can store step-by-step progress in `plan_step` and keep user-facing responses clean.
103
- 2. **A consistent state machine for long tasks.**
104
- Complex workflows usually need: plan -> execute step 1 -> verify -> step 2 -> backtrack -> branch -> finalize. `plan_step` gives the agent a structured way to follow that lifecycle without losing track.
105
- 3. **Better tool routing.**
106
- Good agents alternate between thinking and acting. `plan_step` encourages that rhythm: log intent, call real tools, capture outcome, decide next step.
106
+ **Why `plan_step`?** It keeps the chat context clean by storing progress externally, gives agents a structured state machine (plan → execute → verify → branch), and encourages the think-then-act rhythm that produces better results on complex workflows.
107
107
 
108
108
  ---
109
109
 
110
110
  ## 🧠 Code Mode
111
111
 
112
- Inspired by [Code execution with MCP](https://www.anthropic.com/engineering/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.
113
-
114
- ### What it provides
112
+ Inspired by [Code execution with MCP](https://www.anthropic.com/engineering/code-execution-with-mcp), KubeView ships a sandboxed code runtime for agents to explore the API and run complex workflows.
115
113
 
116
- - **MCP Bridge Layer**: Seamlessly connects to all registered MCP server tools.
117
- - **Dynamic TypeScript Definitions**: Automatically converts tool schemas into a strongly-typed `global.d.ts` resource, enabling agents to use valid TypeScript patterns and enjoy type safety without hallucinating parameters.
118
- - **Tool Search Utilities**: Runtime helpers like `tools.search()` and `tools.list()` allow agents to progressively discover capabilities without needing to load the entire schema context upfront.
119
- - **Sandboxed Execution**: A locked-down Node.js environment (via `vm`) with controlled access to the `console` and the `tools` global object, ensuring safe execution of agent-generated code.
114
+ - **MCP Bridge** All registered MCP tools are callable from within `run_code`.
115
+ - **Dynamic TypeScript Definitions** Tool schemas are auto-converted to a typed `global.d.ts`, preventing hallucinated parameters.
116
+ - **Tool Discovery** `tools.search()` and `tools.list()` let agents find capabilities at runtime without loading the full schema.
117
+ - **Sandboxed Execution** Locked-down Node.js `vm` environment with access only to `console` and the `tools` global.
120
118
 
121
- ### Usage
122
-
123
- For complex tasks requiring logic, loops, or data processing, use **Code Mode**:
119
+ Enable code-only mode:
124
120
 
125
121
  ```json
126
122
  "env": { "MCP_MODE": "code" }
127
123
  ```
128
124
 
129
- ### 💡 Pro Tip: `code-mode` MCP Prompt
130
-
131
- The server includes a built-in MCP server prompt named **`code-mode`** that injects the full TypeScript API documentation, tool overview, and examples into the context.
125
+ ### Built-in `code-mode` Prompt
132
126
 
133
- **In Cursor IDE**:
134
- 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.
127
+ The server includes a **`code-mode`** MCP prompt that injects full TypeScript API docs and examples into the agent context. In Cursor, type `/kubeview/code-mode` in the prompt bar to activate it.
135
128
 
136
129
  ---
137
130
 
138
131
  ## 💻 Local Development
139
132
 
140
- 1. **Clone & Install**:
141
- ```bash
142
- git clone https://github.com/mikhae1/kubeview-mcp.git
143
- cd kubeview-mcp
144
- npm install
145
- ```
146
-
147
- 2. **Build & Run**:
148
- ```bash
149
- npm run build
150
- npm start
151
- ```
152
-
153
- 3. **Test**:
154
- ```bash
155
- npm test
156
- ```
133
+ ```bash
134
+ # Clone and install
135
+ git clone https://github.com/mikhae1/kubeview-mcp.git
136
+ cd kubeview-mcp
137
+ npm install
157
138
 
158
- ### CLI Usage
139
+ # Build and run
140
+ npm run build
141
+ npm start
159
142
 
160
- You can test tools directly via the CLI:
143
+ # Test
144
+ npm test
161
145
 
162
- ```bash
146
+ # Run a tool directly via CLI
163
147
  npm run command -- kube_list --namespace=default
164
148
  ```
165
149
 
package/SKILL.md CHANGED
@@ -1,76 +1,81 @@
1
- # KubeView MCP Skills: Debugging Kubernetes Clusters
1
+ ---
2
+ name: kubeview-debug
3
+ description: Debug and diagnose Kubernetes clusters using KubeView MCP server tools. Use when investigating cluster issues (pod crashes, deployment failures, service connectivity problems, node issues, resource constraints), performing cluster health checks, or troubleshooting any Kubernetes workload. Trigger phrases include "cluster health", "pod won't start", "CrashLoopBackOff", "service unreachable", "deployment stuck", "node pressure", "OOMKilled", "ImagePullBackOff".
4
+ ---
5
+
6
+ # Kubernetes Cluster Debugging
2
7
 
3
- This document contains reusable investigation playbooks ("skills") for debugging Kubernetes clusters using the KubeView MCP server.
8
+ Reusable investigation playbooks for debugging Kubernetes clusters using KubeView MCP.
4
9
 
5
- ## Assumptions & Constraints
10
+ ## Core Principles
6
11
 
7
- - **Read-Only by Design**: Avoid making state changes (edit, delete, scale) through these tools unless explicitly authorized.
8
- - **Documentation**: Use `search_tools` to find new capabilities.
9
- - **Prefer MCP Tools**: Use `kube_*` tools over shelling out to `kubectl`.
12
+ - **Read-Only**: Avoid state changes unless explicitly authorized.
13
+ - **Prefer MCP Tools**: Use `kube_*` tools over `kubectl` commands.
10
14
  - **Security First**: Treat output as potentially sensitive.
11
- - **Declarative over Imperative**: When suggesting fixes, provide YAML snippets rather than `kubectl patch/edit` commands.
15
+ - **Declarative Fixes**: Provide YAML snippets rather than imperative `kubectl` commands.
12
16
 
13
- ## Tool Quick Map
17
+ ## Tool Quick Reference
14
18
 
15
- - **Cluster + Workloads**: `kube_list`, `kube_get`, `kube_metrics`
19
+ - **Cluster & Workloads**: `kube_list`, `kube_get`, `kube_metrics`
16
20
  - **Logs**: `kube_logs` (single pod), `kube_log` (multi-pod with filters + events)
17
21
  - **Network**: `kube_net`, `kube_exec`, `kube_port`
18
22
  - **Discovery**: `search_tools` (tools-mode), `run_code` (code-mode)
19
23
 
20
- In code-mode (`run_code`), these become `tools.kubernetes.*` (e.g., `tools.kubernetes.list`).
21
-
22
- ---
24
+ In code-mode, tools become `tools.kubernetes.*` (e.g., `tools.kubernetes.list`).
23
25
 
24
26
  ## Debugging Decision Tree
25
27
 
26
28
  ```
27
29
  Issue reported
28
30
 
29
- ├─ Pod not running? ──────────► See: Debug a Pod that Won't Start
31
+ ├─ Pod not running? ──────────► Skill: Debug Pod Failures
30
32
 
31
- ├─ Service unreachable? ──────► See: Debug a Service With No Traffic
33
+ ├─ Service unreachable? ──────► Skill: Debug Service Connectivity
32
34
 
33
- ├─ Deployment stuck? ─────────► See: Debug a Deployment
35
+ ├─ Deployment stuck? ─────────► Skill: Debug Deployment Rollout
34
36
 
35
- ├─ Node issues? ──────────────► See: Node Debugging
37
+ ├─ Node issues? ──────────────► Skill: Node Debugging
36
38
 
37
- └─ Performance/Resources? ────► See: Resource Debugging
39
+ └─ Performance/Resources? ────► Skill: Resource Debugging
38
40
  ```
39
41
 
40
42
  ---
41
43
 
42
- ## Skill: Cluster Triage (fast)
44
+ ## Skill: Cluster Triage
43
45
 
44
- **Intent**: Get a high-signal overview and decide where to drill down next.
46
+ **When**: Get high-level cluster health overview, identify problem areas.
45
47
 
46
- **Procedure**:
48
+ **Trigger**: "cluster health", "triage the cluster", "what's wrong"
47
49
 
48
- 1. **Cluster overview (diagnostics)**
50
+ **Steps**:
51
+
52
+ 1. **Cluster diagnostics**
49
53
  ```json
50
54
  { "tool": "kube_list", "args": {} }
51
55
  ```
52
56
 
53
- 2. **Metrics + diagnostics**
57
+ 2. **Metrics + top consumers**
54
58
  ```json
55
59
  { "tool": "kube_metrics", "args": { "diagnostics": true, "includeSummary": true, "topN": 5 } }
56
60
  ```
57
61
 
58
- 3. **Identify "Worst" Namespaces** (if not obvious)
59
- - Look for high counts of `CrashLoopBackOff` or `Pending`.
60
- - List pods in that namespace:
62
+ 3. **Drill into problem namespaces**
63
+ - Identify namespaces with high `CrashLoopBackOff` or `Pending` counts
61
64
  ```json
62
65
  { "tool": "kube_list", "args": { "namespace": "<ns>" } }
63
66
  ```
64
67
 
65
68
  ---
66
69
 
67
- ## Skill: Debug a Pod that Won't Start / CrashLoop
70
+ ## Skill: Debug Pod Failures
71
+
72
+ **When**: Pod is Pending, CrashLoopBackOff, ImagePullBackOff, or OOMKilled.
68
73
 
69
- **Intent**: Identify why a pod is Pending / CrashLoopBackOff / ImagePullBackOff / OOMKilled.
74
+ **Trigger**: "pod won't start", "CrashLoopBackOff", "ImagePullBackOff", "OOMKilled"
70
75
 
71
- **Procedure**:
76
+ **Steps**:
72
77
 
73
- 1. **Describe the pod with events + diagnostics**
78
+ 1. **Describe pod with events**
74
79
  ```json
75
80
  {
76
81
  "tool": "kube_get",
@@ -84,7 +89,7 @@ Issue reported
84
89
  }
85
90
  ```
86
91
 
87
- 2. **Pull logs (current & previous)**
92
+ 2. **Check logs (current & previous)**
88
93
  ```json
89
94
  {
90
95
  "tool": "kube_logs",
@@ -92,28 +97,25 @@ Issue reported
92
97
  }
93
98
  ```
94
99
 
95
- 3. **Common Pod Issues Checklist**:
100
+ 3. **Common causes**:
96
101
  - **CrashLoopBackOff**:
97
- - Exit Code 1: App error (check logs).
98
- - Exit Code 137: OOMKilled (check memory limits vs usage).
99
- - Exit Code 143: Graceful termination timeout or SIGTERM.
100
- - **ImagePullBackOff**:
101
- - Check image name/tag spelling.
102
- - Check ImagePullSecrets (registry auth).
103
- - **Pending**:
104
- - Insufficient CPU/Memory (Cluster full?).
105
- - Unsatisfiable Node Affinity/Selector.
106
- - PVC binding failure.
102
+ - Exit 1: App error (check logs)
103
+ - Exit 137: OOMKilled (memory limit too low)
104
+ - Exit 143: SIGTERM timeout
105
+ - **ImagePullBackOff**: Check image name/tag, verify ImagePullSecrets
106
+ - **Pending**: Insufficient resources, node affinity issues, or PVC binding failure
107
107
 
108
108
  ---
109
109
 
110
- ## Skill: Debug a Deployment / Rollout Not Progressing
110
+ ## Skill: Debug Deployment Rollout
111
+
112
+ **When**: Deployment has 0 ready replicas or rollout not progressing.
111
113
 
112
- **Intent**: Explain why a deployment has missing/zero ready replicas.
114
+ **Trigger**: "deployment stuck", "rollout not progressing", "0/1 ready"
113
115
 
114
- **Procedure**:
116
+ **Steps**:
115
117
 
116
- 1. **Check Deployment Status & Conditions**
118
+ 1. **Check deployment status**
117
119
  ```json
118
120
  {
119
121
  "tool": "kube_get",
@@ -126,7 +128,7 @@ Issue reported
126
128
  }
127
129
  ```
128
130
 
129
- 2. **Inspect ReplicaSets** (Is a new RS failing to spin up?)
131
+ 2. **Inspect ReplicaSets** (Is new RS failing to create pods?)
130
132
  ```json
131
133
  {
132
134
  "tool": "kube_list",
@@ -134,7 +136,7 @@ Issue reported
134
136
  }
135
137
  ```
136
138
 
137
- 3. **Aggregate Logs** (See if new pods are failing immediately)
139
+ 3. **Aggregate logs** (Are new pods failing immediately?)
138
140
  ```json
139
141
  {
140
142
  "tool": "kube_log",
@@ -148,29 +150,31 @@ Issue reported
148
150
  }
149
151
  ```
150
152
 
151
- **Common Issues**:
152
- - **Progressing Stuck**: New ReplicaSet can't create pods (quota? errors?).
153
- - **Available < Desired**: Pods running but failing Readiness Probe.
154
- - **Old ReplicaSets not cleaning up**: Deployment strategy issues.
153
+ **Common issues**:
154
+ - New ReplicaSet can't create pods (quota/errors?)
155
+ - Pods running but failing readiness probe
156
+ - Old ReplicaSets not cleaning up (strategy issue)
155
157
 
156
158
  ---
157
159
 
158
- ## Skill: Debug a Service With No Traffic / No Endpoints
160
+ ## Skill: Debug Service Connectivity
159
161
 
160
- **Intent**: Determine if the issue is Selector, Pod Readiness, or Network Policy.
162
+ **When**: Service has no traffic, endpoints missing, or unreachable.
161
163
 
162
- **Procedure**:
164
+ **Trigger**: "service unreachable", "no endpoints", "can't reach service"
163
165
 
164
- 1. **Verify Endpoints Exist**
166
+ **Steps**:
167
+
168
+ 1. **Verify endpoints exist**
165
169
  ```json
166
170
  {
167
171
  "tool": "kube_get",
168
172
  "args": { "resourceType": "endpoints", "name": "<svc>", "namespace": "<ns>" }
169
173
  }
170
174
  ```
171
- - *Empty?* Check Service Selector vs Pod Labels. Are pods Ready?
175
+ - Empty? Check Service selector vs Pod labels. Are pods Ready?
172
176
 
173
- 2. **Test Connectivity from inside cluster**
177
+ 2. **Test connectivity from cluster**
174
178
  ```json
175
179
  {
176
180
  "tool": "kube_net",
@@ -188,53 +192,73 @@ Issue reported
188
192
 
189
193
  ## Skill: Node Debugging
190
194
 
191
- **Intent**: Identify if node-level issues (Pressure, Taints) are causing pod failures.
195
+ **When**: Node-level issues causing pod failures.
196
+
197
+ **Trigger**: "node not ready", "node pressure", "taints blocking pods"
192
198
 
193
- **Procedure**:
199
+ **Steps**:
194
200
 
195
- 1. **List Nodes & Status**
201
+ 1. **List nodes**
196
202
  ```json
197
203
  { "tool": "kube_list", "args": { "resourceType": "node" } }
198
204
  ```
199
205
 
200
- 2. **Describe Specific Node**
206
+ 2. **Describe specific node**
201
207
  ```json
202
208
  { "tool": "kube_get", "args": { "resourceType": "node", "name": "<node>", "includeEvents": true } }
203
209
  ```
204
210
 
205
- **Conditions to Watch**:
206
- - **Ready**: Must be `True`.
207
- - **MemoryPressure / DiskPressure / PIDPressure**: If `True`, node is evicting/blocking pods.
208
- - **NetworkUnavailable**: CNI plugin failure?
211
+ **Key conditions**:
212
+ - **Ready**: Must be `True`
213
+ - **MemoryPressure/DiskPressure/PIDPressure**: If `True`, node is evicting pods
214
+ - **NetworkUnavailable**: CNI plugin failure
209
215
 
210
216
  ---
211
217
 
212
218
  ## Skill: Resource Debugging
213
219
 
214
- **Intent**: Detect resource bottlenecks (CPU throttling, OOM).
220
+ **When**: Detecting resource bottlenecks (CPU throttling, OOM).
215
221
 
216
- **Procedure**:
222
+ **Trigger**: "CPU throttling", "memory pressure", "high CPU/memory"
217
223
 
218
- 1. **Top Pods/Nodes**
224
+ **Steps**:
225
+
226
+ 1. **Top consumers**
219
227
  ```json
220
228
  { "tool": "kube_metrics", "args": { "topN": 10, "includeSummary": true } }
221
229
  ```
222
230
 
223
- 2. **OOMKilled Investigation**
224
- - Check `kube_get` pod status for `LastState: OOMKilled`.
225
- - Solution: Increase Memory Limit or fix leak.
231
+ 2. **OOMKilled investigation**
232
+ - Check `kube_get` pod status for `LastState: OOMKilled`
233
+ - Solution: Increase memory limit or fix leak
234
+
235
+ 3. **CPU throttling**
236
+ - App slow but no errors? Check if usage near CPU limit
237
+ - Solution: Increase CPU limit or remove limit (keep request)
238
+
239
+ ---
240
+
241
+ ## Advanced: Code Mode Bulk Analysis
226
242
 
227
- 3. **CPU Throttling**
228
- - If app is slow but no errors: Check if usage is near CPU Limit.
229
- - Solution: Increase CPU Limit (or remove limit and keep request).
243
+ **When**: Complex queries requiring logic (e.g., "find all pods without resource limits").
244
+
245
+ **Trigger**: "bulk analysis", "find pods without limits", "code mode"
246
+
247
+ **Example**:
248
+ ```typescript
249
+ const pods = await tools.kubernetes.list({ resourceType: 'pod' });
250
+ const noLimits = pods.items.filter(p =>
251
+ p.spec.containers.some(c => !c.resources?.limits)
252
+ );
253
+ return { count: noLimits.length, names: noLimits.map(p => p.metadata.name) };
254
+ ```
230
255
 
231
256
  ---
232
257
 
233
- ## Skill: Long Investigation Hygiene (using `plan_step`)
258
+ ## Multi-Step Investigation Hygiene
234
259
 
235
- **Intent**: Keep multi-step debugging stable and reviewable.
260
+ For complex investigations spanning multiple steps, use `plan_step` to maintain clear progress tracking:
236
261
 
237
- **Template**:
238
262
  ```json
239
263
  {
240
264
  "tool": "plan_step",
@@ -246,18 +270,3 @@ Issue reported
246
270
  }
247
271
  }
248
272
  ```
249
-
250
- ---
251
-
252
- ## Skill: One-shot Code Mode Triage (Advanced)
253
-
254
- **Intent**: Use `run_code` for complex logic (e.g., "Find all pods without resource limits").
255
-
256
- **Example**:
257
- ```typescript
258
- const pods = await tools.kubernetes.list({ resourceType: 'pod' });
259
- const noLimits = pods.items.filter(p =>
260
- p.spec.containers.some(c => !c.resources?.limits)
261
- );
262
- return { count: noLimits.length, names: noLimits.map(p => p.metadata.name) };
263
- ```
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env tsx
2
+ export {};
3
+ //# sourceMappingURL=publish-mcp.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"publish-mcp.d.ts","sourceRoot":"","sources":["../../scripts/publish-mcp.ts"],"names":[],"mappings":""}
@@ -0,0 +1,10 @@
1
+ #!/usr/bin/env tsx
2
+ import { publishMcp } from './release-publish';
3
+ try {
4
+ publishMcp();
5
+ }
6
+ catch (error) {
7
+ console.error(error instanceof Error ? error.message : String(error));
8
+ process.exit(1);
9
+ }
10
+ //# sourceMappingURL=publish-mcp.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"publish-mcp.js","sourceRoot":"","sources":["../../scripts/publish-mcp.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,IAAI,CAAC;IACH,UAAU,EAAE,CAAC;AACf,CAAC;AAAC,OAAO,KAAK,EAAE,CAAC;IACf,OAAO,CAAC,KAAK,CAAC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;IACtE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC"}
@@ -0,0 +1,36 @@
1
+ #!/usr/bin/env tsx
2
+ type RunnerResult = {
3
+ status: number;
4
+ stdout: string;
5
+ stderr: string;
6
+ error?: NodeJS.ErrnoException;
7
+ };
8
+ type RunnerOptions = {
9
+ interactive?: boolean;
10
+ quiet?: boolean;
11
+ env?: NodeJS.ProcessEnv;
12
+ };
13
+ export type Runner = (command: string, args: string[], options?: RunnerOptions) => RunnerResult;
14
+ type PublishStep = 'all' | 'commit' | 'tag' | 'npm' | 'git' | 'mcp';
15
+ type PackageInfo = {
16
+ name: string;
17
+ version: string;
18
+ };
19
+ export declare function createRunner(options?: {
20
+ cwd?: string;
21
+ env?: NodeJS.ProcessEnv;
22
+ stdout?: Pick<NodeJS.WriteStream, 'write'>;
23
+ stderr?: Pick<NodeJS.WriteStream, 'write'>;
24
+ }): Runner;
25
+ export declare function publishMcp(options?: {
26
+ runner?: Runner;
27
+ cwd?: string;
28
+ }): 'published' | 'skipped';
29
+ export declare function runPublishWorkflow(options?: {
30
+ step?: PublishStep;
31
+ cwd?: string;
32
+ runner?: Runner;
33
+ packageInfo?: PackageInfo;
34
+ }): void;
35
+ export {};
36
+ //# sourceMappingURL=release-publish.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"release-publish.d.ts","sourceRoot":"","sources":["../../scripts/release-publish.ts"],"names":[],"mappings":";AAQA,KAAK,YAAY,GAAG;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC,cAAc,CAAC;CAC/B,CAAC;AAEF,KAAK,aAAa,GAAG;IACnB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,MAAM,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,OAAO,CAAC,EAAE,aAAa,KAAK,YAAY,CAAC;AAEhG,KAAK,WAAW,GAAG,KAAK,GAAG,QAAQ,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,CAAC;AAEpE,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAWF,wBAAgB,YAAY,CAC1B,OAAO,GAAE;IACP,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;IACxB,MAAM,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;IAC3C,MAAM,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;CACvC,GACL,MAAM,CA+BR;AA6FD,wBAAgB,UAAU,CACxB,OAAO,GAAE;IAAE,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAO,GAC9C,WAAW,GAAG,SAAS,CAkCzB;AAoED,wBAAgB,kBAAkB,CAChC,OAAO,GAAE;IACP,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,WAAW,CAAC;CACtB,GACL,IAAI,CAyBN"}