mcp-server-kubernetes 4.0.2 → 4.0.3
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
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
[](https://github.com/Flux159/mcp-server-kubernetes/pulls)
|
|
11
11
|
[](https://github.com/Flux159/mcp-server-kubernetes/commits/main)
|
|
12
12
|
[](https://archestra.ai/mcp-catalog/flux159__mcp-server-kubernetes)
|
|
13
|
+
[](https://hvtracker.net/agents/kubernetes-mcp-server/)
|
|
13
14
|
[](https://deepwiki.com/Flux159/mcp-server-kubernetes)
|
|
14
15
|
|
|
15
16
|
<p align="center">
|
|
@@ -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.3",
|
|
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
|
}
|