Run Command
run_commandExecute shell commands and return stdout, stderr, and exit code to inspect system state, debug issues, and validate fixes during authorized security assessments.
Instructions
Run a shell command and return stdout, stderr and exit code.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"command": "<command>"
},
"name": "run_command"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cwd | No | working directory (default: server cwd) | |
| env | No | extra environment variables to set | |
| sudo | No | run via sudo -n (needs passwordless sudo) or sudo -S when LINUXMCP_SUDO_PASSWORD is set on the server | |
| login | No | run as login shell (-lc) so profile/PATH is loaded | |
| shell | No | shell to use (default /bin/bash) | /bin/bash |
| command | Yes | shell command line, e.g. "systemctl status nginx | head" | |
| timeout | No | seconds before the command is killed (default 120) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |