compose_run
Execute a one-off command inside a Docker Compose service without a TTY, returning stdout, stderr, and exit code. Runs detached with automatic container removal by default.
Instructions
Run a one-off command against a compose service.
Always passes -T (no TTY under MCP). Defaults to detached with --rm so the call returns promptly.
args:
service - Service name from the compose file
command - Command + args to run (exec-form; no shell unless you invoke one)
project_dir - Dir with the compose file (default: server cwd)
files - Explicit compose file paths (repeatable, -f)
project_name - Compose project name override
detach - Run detached (default True)
rm - Remove the container after the run (default True)
no_deps - Don't start linked services
workdir - Working directory inside the container
user - User to run as inside the container (uid or name)
env - Environment variables to set inside the container
name - Optional container name
timeout_seconds - Subprocess timeout (default 600s)
returns: dict - {"returncode": int, "stdout": str, "stderr": str, "truncated": bool}
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rm | No | ||
| env | No | ||
| name | No | ||
| user | No | ||
| files | No | ||
| detach | No | ||
| command | No | ||
| no_deps | No | ||
| service | Yes | ||
| workdir | No | ||
| project_dir | No | ||
| project_name | No | ||
| timeout_seconds | No |