Skip to main content
Glama
heresun

OrbStack MCP Server

by heresun

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
NameRequiredDescriptionDefault
paramsYes

Implementation Reference

  • 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 "(命令执行完毕,无输出)"
  • The MCP tool registration for orbstack_docker_exec.
        name="orbstack_docker_exec",
        annotations={
            "title": "在容器中执行命令",
            "readOnlyHint": False,
            "destructiveHint": False,
            "idempotentHint": False,
            "openWorldHint": False,
        },
    )
  • 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,
        )

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/heresun/orbstack-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server