mcp-server-kubernetes 3.0.0 → 3.0.2

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.
@@ -4,7 +4,7 @@ import * as fs from "fs";
4
4
  import * as path from "path";
5
5
  import * as os from "os";
6
6
  import { getSpawnMaxBuffer } from "../config/max-buffer.js";
7
- import { contextParameter, dryRunParameter, namespaceParameter } from "../models/common-parameters.js";
7
+ import { contextParameter, dryRunParameter, namespaceParameter, } from "../models/common-parameters.js";
8
8
  export const kubectlPatchSchema = {
9
9
  name: "kubectl_patch",
10
10
  description: "Update field(s) of a resource using strategic merge patch, JSON merge patch, or JSON patch",
@@ -68,6 +68,9 @@ export async function kubectlPatch(k8sManager, input) {
68
68
  }
69
69
  // Handle patch data
70
70
  if (input.patchData) {
71
+ if (input.patchData === null || typeof input.patchData !== "object") {
72
+ throw new McpError(ErrorCode.InvalidRequest, "patchData must be a valid JSON object, not a string.");
73
+ }
71
74
  // Create a temporary file for the patch data
72
75
  const tmpDir = os.tmpdir();
73
76
  tempFile = path.join(tmpDir, `patch-${Date.now()}.json`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mcp-server-kubernetes",
3
- "version": "3.0.0",
3
+ "version": "3.0.2",
4
4
  "description": "MCP server for interacting with Kubernetes clusters via kubectl",
5
5
  "license": "MIT",
6
6
  "type": "module",