mcp-server-kubernetes 2.7.0 → 2.8.0

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,7 @@
1
1
  import { execFileSync } from "child_process";
2
2
  import { McpError, ErrorCode } from "@modelcontextprotocol/sdk/types.js";
3
3
  import { getSpawnMaxBuffer } from "../config/max-buffer.js";
4
+ import { contextParameter, namespaceParameter } from "../models/common-parameters.js";
4
5
  export const kubectlScaleSchema = {
5
6
  name: "kubectl_scale",
6
7
  description: "Scale a Kubernetes deployment",
@@ -11,11 +12,7 @@ export const kubectlScaleSchema = {
11
12
  type: "string",
12
13
  description: "Name of the deployment to scale",
13
14
  },
14
- namespace: {
15
- type: "string",
16
- description: "Namespace of the deployment",
17
- default: "default",
18
- },
15
+ namespace: namespaceParameter,
19
16
  replicas: {
20
17
  type: "number",
21
18
  description: "Number of replicas to scale to",
@@ -25,6 +22,7 @@ export const kubectlScaleSchema = {
25
22
  description: "Resource type to scale (deployment, replicaset, statefulset)",
26
23
  default: "deployment",
27
24
  },
25
+ context: contextParameter,
28
26
  },
29
27
  required: ["name", "replicas"],
30
28
  },
@@ -33,6 +31,7 @@ export async function kubectlScale(k8sManager, input) {
33
31
  try {
34
32
  const namespace = input.namespace || "default";
35
33
  const resourceType = input.resourceType || "deployment";
34
+ const context = input.context || "";
36
35
  const command = "kubectl";
37
36
  const args = [
38
37
  "scale",
@@ -41,6 +40,10 @@ export async function kubectlScale(k8sManager, input) {
41
40
  `--replicas=${input.replicas}`,
42
41
  `--namespace=${namespace}`,
43
42
  ];
43
+ // Add context if provided
44
+ if (context) {
45
+ args.push("--context", context);
46
+ }
44
47
  // Execute the command
45
48
  try {
46
49
  const result = execFileSync(command, args, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mcp-server-kubernetes",
3
- "version": "2.7.0",
3
+ "version": "2.8.0",
4
4
  "description": "MCP server for interacting with Kubernetes clusters via kubectl",
5
5
  "license": "MIT",
6
6
  "type": "module",