orbstack_docker_exec
Execute commands within running Docker containers to manage processes, inspect configurations, or perform maintenance tasks.
Instructions
在运行中的 Docker 容器中执行命令。
Args: params: 包含容器标识和要执行的命令
Returns: str: 命令输出
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| params | Yes |
Implementation Reference
- src/orbstack_mcp/server.py:819-832 (handler)The implementation of the orbstack_docker_exec tool, which executes commands in a Docker container.
async def orbstack_docker_exec(params: DockerExecInput) -> str: """在运行中的 Docker 容器中执行命令。 Args: params: 包含容器标识和要执行的命令 Returns: str: 命令输出 """ args = ["exec", params.container] + params.command.split() code, stdout, stderr = await _run_docker(args) if code != 0: return _format_error(stderr or stdout) return stdout if stdout else "(命令执行完毕,无输出)" - src/orbstack_mcp/server.py:810-818 (registration)The MCP tool registration for orbstack_docker_exec.
name="orbstack_docker_exec", annotations={ "title": "在容器中执行命令", "readOnlyHint": False, "destructiveHint": False, "idempotentHint": False, "openWorldHint": False, }, ) - src/orbstack_mcp/server.py:244-252 (schema)The input schema definition (Pydantic model) for the orbstack_docker_exec tool.
class DockerExecInput(BaseModel): """在容器中执行命令的输入参数""" model_config = ConfigDict(str_strip_whitespace=True, extra="forbid") container: str = Field( ..., description="容器 ID 或名称", min_length=1, )