Skip to content

docker_exec

MCP tools › Containers and Kubernetes

Runs one command (an argument list, no host shell) inside a running Docker container without a TTY and returns stdout and stderr in order, the exit code and whether output was cut at 1 MiB. Optional workdir, env (NAME=value), user, timeout_s (default 60, at most 600), engine. Defaults to dry_run=true, which only reports what would run; dry_run=false needs the user-granted run right and is logged in .ferris-idea/agent-log.jsonl.

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

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

Arguments

ArgumentTypeDescription
containerrequiredstringContainer name or id (must be running).
commandrequiredarray of stringThe command as an argument list, e.g. ["ls", "-l", "/srv"].
workdirstringWorking folder inside the container.
envarray of stringEnvironment entries NAME=value.
userstringUser (name or uid, optionally :group).
timeout_sintegerTime limit in seconds (default 60, at most 600).minimum 0
dry_runbooleanOnly report what would run (default true).
enginestringEngine by name or address.

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 docker_exec '{"container":"<string>","command":[]}'
Input schema as JSON
{
"type": "object",
"required": [
"container",
"command"
],
"properties": {
"container": {
"description": "Container name or id (must be running).",
"type": "string"
},
"command": {
"description": "The command as an argument list, e.g. `[\"ls\", \"-l\", \"/srv\"]`.",
"type": "array",
"items": {
"type": "string"
}
},
"workdir": {
"description": "Working folder inside the container.",
"type": [
"string",
"null"
]
},
"env": {
"description": "Environment entries `NAME=value`.",
"type": [
"array",
"null"
],
"items": {
"type": "string"
}
},
"user": {
"description": "User (name or uid, optionally `:group`).",
"type": [
"string",
"null"
]
},
"timeout_s": {
"description": "Time limit in seconds (default 60, at most 600).",
"type": [
"integer",
"null"
],
"minimum": 0
},
"dry_run": {
"description": "Only report what would run (default true).",
"type": [
"boolean",
"null"
]
},
"engine": {
"description": "Engine by name or address.",
"type": [
"string",
"null"
]
}
}
}