mcp-server-kubernetes 4.1.1 → 4.1.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.
@@ -1,6 +1,6 @@
1
1
  export declare const serverConfig: {
2
2
  readonly name: "kubernetes";
3
- readonly version: "4.1.1";
3
+ readonly version: "4.1.3";
4
4
  readonly capabilities: {
5
5
  readonly resources: {};
6
6
  readonly tools: {};
@@ -1,6 +1,6 @@
1
1
  export const serverConfig = {
2
2
  name: "kubernetes",
3
- version: "4.1.1",
3
+ version: "4.1.3",
4
4
  capabilities: {
5
5
  resources: {},
6
6
  tools: {},
package/dist/index.d.ts CHANGED
@@ -810,4 +810,10 @@ declare const allTools: ({
810
810
  readOnlyHint: boolean;
811
811
  };
812
812
  })[];
813
+ /**
814
+ * Returns the names in `allowedToolNames` that no tool actually provides.
815
+ *
816
+ * Exported for testing.
817
+ */
818
+ export declare function findUnknownToolNames(allowedToolNames: Iterable<string>, knownToolNames: Iterable<string>): string[];
813
819
  export { allTools, destructiveTools };
package/dist/index.js CHANGED
@@ -105,6 +105,28 @@ const allTools = [
105
105
  // Ping utility
106
106
  pingSchema,
107
107
  ];
108
+ /**
109
+ * Returns the names in `allowedToolNames` that no tool actually provides.
110
+ *
111
+ * Exported for testing.
112
+ */
113
+ export function findUnknownToolNames(allowedToolNames, knownToolNames) {
114
+ const known = new Set(knownToolNames);
115
+ return [...allowedToolNames].filter((name) => !known.has(name)).sort();
116
+ }
117
+ // A misspelled name in ALLOWED_TOOLS would otherwise be dropped silently,
118
+ // leaving a narrower tool surface than was configured. Refuse to start instead.
119
+ if (explicitlyAllowedToolNames) {
120
+ const unknownToolNames = findUnknownToolNames(explicitlyAllowedToolNames, allTools.map((tool) => tool.name));
121
+ if (unknownToolNames.length > 0) {
122
+ console.error(`ALLOWED_TOOLS contains unknown tool ${unknownToolNames.length === 1 ? "name" : "names"}: ${unknownToolNames.join(", ")}`);
123
+ console.error(`Available tools: ${allTools
124
+ .map((tool) => tool.name)
125
+ .sort()
126
+ .join(", ")}`);
127
+ process.exit(1);
128
+ }
129
+ }
108
130
  const k8sManager = new KubernetesManager();
109
131
  const server = new Server({
110
132
  name: serverConfig.name,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mcp-server-kubernetes",
3
- "version": "4.1.1",
3
+ "version": "4.1.3",
4
4
  "description": "MCP server for interacting with Kubernetes clusters via kubectl",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -45,7 +45,7 @@
45
45
  "@opentelemetry/resources": "2.7.1",
46
46
  "@opentelemetry/sdk-node": "0.219.0",
47
47
  "@opentelemetry/semantic-conventions": "1.40.0",
48
- "express": "4.21.2",
48
+ "express": "4.22.2",
49
49
  "js-yaml": "4.3.0",
50
50
  "yaml": "2.8.3",
51
51
  "zod": "3.25.76"