server_run
Execute shell commands directly on the Docker host with safety previews, confirmation for risky actions, sudo support, and background job handling.
Instructions
Run one shell command on the Docker host itself (not inside a container).
It starts in the stacks folder. Safe read-only commands (ls, cat, head, tail, grep, find, df, free, uptime, git status/log/diff, ps, ss, ip, and pipes between them) run right away. Anything else needs confirm=true after the user says yes. Risky ones (rm, mv, dd, chmod, chown, kill, systemctl, apt, reboot, sudo ...) are marked destructive in the preview. as_root=true runs it with sudo. Root commands always show a preview first. background=true starts it as a background job and returns a job id at once (use it for anything that can take more than about 40 seconds). Check it with server_job. Files with passwords or keys (.env, keys, credentials) are blocked. For files, prefer server_file_read, server_file_write and server_file_edit.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| host | No | ||
| as_root | No | ||
| command | Yes | ||
| confirm | No | ||
| timeout | No | ||
| background | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |