mcp-server-kubernetes 4.0.2 → 4.0.4
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.
package/README.md
CHANGED
|
@@ -2,15 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://github.com/yourusername/mcp-server-kubernetes/actions/workflows/ci.yml)
|
|
4
4
|
[](https://github.com/yourusername/mcp-server-kubernetes)
|
|
5
|
-
[](https://bun.sh)
|
|
6
5
|
[](https://kubernetes.io/)
|
|
7
6
|
[](https://www.docker.com/)
|
|
8
7
|
[](https://github.com/Flux159/mcp-server-kubernetes/stargazers)
|
|
9
8
|
[](https://github.com/Flux159/mcp-server-kubernetes/issues)
|
|
10
9
|
[](https://github.com/Flux159/mcp-server-kubernetes/pulls)
|
|
11
10
|
[](https://github.com/Flux159/mcp-server-kubernetes/commits/main)
|
|
12
|
-
[](https://archestra.ai/mcp-catalog/flux159__mcp-server-kubernetes)
|
|
13
|
-
[](https://deepwiki.com/Flux159/mcp-server-kubernetes)
|
|
14
11
|
|
|
15
12
|
<p align="center">
|
|
16
13
|
<img src="https://raw.githubusercontent.com/Flux159/mcp-server-kubernetes/refs/heads/main/icon.png" width="200">
|
|
@@ -20,8 +17,6 @@ MCP Server that can connect to a Kubernetes cluster and manage it. Supports load
|
|
|
20
17
|
|
|
21
18
|
https://github.com/user-attachments/assets/f25f8f4e-4d04-479b-9ae0-5dac452dd2ed
|
|
22
19
|
|
|
23
|
-
<a href="https://glama.ai/mcp/servers/w71ieamqrt"><img width="380" height="200" src="https://glama.ai/mcp/servers/w71ieamqrt/badge" /></a>
|
|
24
|
-
|
|
25
20
|
## Installation & Usage
|
|
26
21
|
|
|
27
22
|
### Prerequisites
|
|
@@ -47,6 +42,16 @@ claude mcp add kubernetes -- npx mcp-server-kubernetes
|
|
|
47
42
|
|
|
48
43
|
This will automatically configure the server in your Claude Code MCP settings.
|
|
49
44
|
|
|
45
|
+
### Codex
|
|
46
|
+
|
|
47
|
+
Add the MCP server to [Codex CLI](https://developers.openai.com/codex/cli/) using the built-in command:
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
codex mcp add kubernetes -- npx mcp-server-kubernetes
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
This registers the server globally in `~/.codex/config.toml` and makes its tools available in all Codex sessions.
|
|
54
|
+
|
|
50
55
|
### Claude Desktop
|
|
51
56
|
|
|
52
57
|
Add the following configuration to your Claude Desktop config file:
|
|
@@ -128,14 +133,6 @@ Windows:
|
|
|
128
133
|
npx mcp-chat --config "%APPDATA%\Claude\claude_desktop_config.json"
|
|
129
134
|
```
|
|
130
135
|
|
|
131
|
-
## Gemini CLI
|
|
132
|
-
|
|
133
|
-
[Gemini CLI](https://geminicli.com/) allows you to install mcp servers as extensions. From a shell, install the extension by pointing to this repo:
|
|
134
|
-
|
|
135
|
-
```shell
|
|
136
|
-
gemini extensions install https://github.com/Flux159/mcp-server-kubernetes
|
|
137
|
-
```
|
|
138
|
-
|
|
139
136
|
## Features
|
|
140
137
|
|
|
141
138
|
- [x] Connect to a Kubernetes cluster
|
|
@@ -113,10 +113,10 @@ export async function kubectlGet(k8sManager, input) {
|
|
|
113
113
|
}
|
|
114
114
|
else if (output === "custom") {
|
|
115
115
|
if (resourceType === "events") {
|
|
116
|
-
args.push("-o", "
|
|
116
|
+
args.push("-o", "custom-columns=LASTSEEN:.lastTimestamp,TYPE:.type,REASON:.reason,OBJECT:.involvedObject.name,MESSAGE:.message");
|
|
117
117
|
}
|
|
118
118
|
else {
|
|
119
|
-
args.push("-o", "
|
|
119
|
+
args.push("-o", "custom-columns=NAME:.metadata.name,NAMESPACE:.metadata.namespace,STATUS:.status.phase,AGE:.metadata.creationTimestamp");
|
|
120
120
|
}
|
|
121
121
|
}
|
|
122
122
|
// Execute the command
|
|
@@ -63,7 +63,7 @@ export const kubectlLogsSchema = {
|
|
|
63
63
|
};
|
|
64
64
|
export async function kubectlLogs(k8sManager, input) {
|
|
65
65
|
try {
|
|
66
|
-
const resourceType = input.resourceType.toLowerCase();
|
|
66
|
+
const resourceType = (input.resourceType ?? "pod").toLowerCase();
|
|
67
67
|
const name = input.name;
|
|
68
68
|
const namespace = input.namespace || "default";
|
|
69
69
|
const context = input.context || "";
|
|
@@ -108,7 +108,7 @@ export async function kubectlLogs(k8sManager, input) {
|
|
|
108
108
|
"deployment",
|
|
109
109
|
name,
|
|
110
110
|
"-o",
|
|
111
|
-
"jsonpath=
|
|
111
|
+
"jsonpath={.spec.selector.matchLabels}",
|
|
112
112
|
];
|
|
113
113
|
}
|
|
114
114
|
else if (resourceType === "job") {
|
|
@@ -124,7 +124,7 @@ export async function kubectlLogs(k8sManager, input) {
|
|
|
124
124
|
"jobs",
|
|
125
125
|
"--selector=job-name=" + name,
|
|
126
126
|
"-o",
|
|
127
|
-
"jsonpath=
|
|
127
|
+
"jsonpath={.items[*].metadata.name}",
|
|
128
128
|
];
|
|
129
129
|
try {
|
|
130
130
|
const jobs = execFileSyncSafe(command, jobsArgs, {
|
|
@@ -182,7 +182,7 @@ export async function kubectlLogs(k8sManager, input) {
|
|
|
182
182
|
maxBuffer: getSpawnMaxBuffer(),
|
|
183
183
|
env: { ...process.env, KUBECONFIG: process.env.KUBECONFIG },
|
|
184
184
|
}).trim();
|
|
185
|
-
const selector = JSON.parse(selectorJson
|
|
185
|
+
const selector = JSON.parse(selectorJson);
|
|
186
186
|
// Convert to label selector format
|
|
187
187
|
const labelSelector = Object.entries(selector)
|
|
188
188
|
.map(([key, value]) => `${key}=${value}`)
|
|
@@ -258,7 +258,7 @@ async function getLabelSelectorLogs(labelSelector, namespace, input) {
|
|
|
258
258
|
"pods",
|
|
259
259
|
`--selector=${labelSelector}`,
|
|
260
260
|
"-o",
|
|
261
|
-
"jsonpath=
|
|
261
|
+
"jsonpath={.items[*].metadata.name}",
|
|
262
262
|
];
|
|
263
263
|
const pods = execFileSyncSafe(command, podsArgs, {
|
|
264
264
|
encoding: "utf8",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mcp-server-kubernetes",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.4",
|
|
4
4
|
"description": "MCP server for interacting with Kubernetes clusters via kubectl",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -57,6 +57,6 @@
|
|
|
57
57
|
"@types/node": "22.9.3",
|
|
58
58
|
"shx": "0.3.4",
|
|
59
59
|
"typescript": "5.6.2",
|
|
60
|
-
"vitest": "2.
|
|
60
|
+
"vitest": "3.2.6"
|
|
61
61
|
}
|
|
62
62
|
}
|