Skip to content

kubernetes_exec

MCP tools › Containers and Kubernetes

Runs one command (an argument list) in a Kubernetes pod or in a pod of a Deployment, StatefulSet, DaemonSet or Job through kubectl exec without a TTY: output (stdout, then stderr), exit code, whether output was cut at 1 MiB. Optional context, namespace, container, timeout_s (default 60, at most 600). Defaults to dry_run=true and returns the command; dry_run=false needs the user-granted run right and is logged in .ferris-idea/agent-log.jsonl.

Its results carry text from remote: the client is told to treat that as data, never as instructions.

Capabilitycontainers.kubernetes_exec
AreaContainers and Kubernetes
Accesschanges processes
Reachesprocess, network
Rightsrun
Dry rundry_run, on unless the call turns it off

Arguments

ArgumentTypeDescription
contextstringContext (default: the current one).
namespacestringNamespace (default: the context's, else default).
kindrequiredstringPod, Deployment, StatefulSet, DaemonSet or Job.
namerequiredstringName of the object.
containerstringContainer of the pod (default: kubectl's choice).
commandrequiredarray of stringThe command as an argument list.
timeout_sintegerTime limit in seconds (default 60, at most 600).minimum 0
dry_runbooleanOnly report the command (default true).

Call it from a shell

ferris-idea call runs one tool with the rights and safe mode of ferris-idea mcp. Replace the folder and the placeholder values.

Terminal window
ferris-idea call ~/my-project kubernetes_exec '{"kind":"<string>","name":"<string>","command":[]}'
Input schema as JSON
{
"type": "object",
"required": [
"kind",
"name",
"command"
],
"properties": {
"context": {
"description": "Context (default: the current one).",
"type": [
"string",
"null"
]
},
"namespace": {
"description": "Namespace (default: the context's, else `default`).",
"type": [
"string",
"null"
]
},
"kind": {
"description": "`Pod`, `Deployment`, `StatefulSet`, `DaemonSet` or `Job`.",
"type": "string"
},
"name": {
"description": "Name of the object.",
"type": "string"
},
"container": {
"description": "Container of the pod (default: kubectl's choice).",
"type": [
"string",
"null"
]
},
"command": {
"description": "The command as an argument list.",
"type": "array",
"items": {
"type": "string"
}
},
"timeout_s": {
"description": "Time limit in seconds (default 60, at most 600).",
"type": [
"integer",
"null"
],
"minimum": 0
},
"dry_run": {
"description": "Only report the command (default true).",
"type": [
"boolean",
"null"
]
}
}
}