Skip to main content
Glama
heresun

OrbStack MCP Server

by heresun

orbstack_docker_ps

List Docker containers running on macOS via OrbStack. Shows active containers by default, with an option to display all containers including stopped ones.

Instructions

列出 Docker 容器。

默认只显示运行中的容器,设置 all=True 显示全部。

Args: params: 包含是否显示所有容器的选项

Returns: str: 容器列表(格式化表格)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
paramsYes

Implementation Reference

  • The handler function for the 'orbstack_docker_ps' tool, which executes 'docker ps' via '_run_docker'.
    async def orbstack_docker_ps(params: DockerPsInput) -> str:
        """列出 Docker 容器。
    
        默认只显示运行中的容器,设置 all=True 显示全部。
    
        Args:
            params: 包含是否显示所有容器的选项
    
        Returns:
            str: 容器列表(格式化表格)
        """
        args = ["ps", "--format", "table {{.ID}}\t{{.Names}}\t{{.Image}}\t{{.Status}}\t{{.Ports}}"]
        if params.all:
            args.append("-a")
    
        code, stdout, stderr = await _run_docker(args)
        if code != 0:
            return _format_error(stderr, "请确认 OrbStack 正在运行: orbstack_start")
        if not stdout or stdout.count("\n") == 0:
            return "当前没有运行中的容器。" + (" 使用 --all 查看所有容器。" if not params.all else "")
        return f"Docker 容器:\n{stdout}"
  • The tool registration for 'orbstack_docker_ps' using the '@mcp.tool' decorator.
    @mcp.tool(
        name="orbstack_docker_ps",
        annotations={
            "title": "列出 Docker 容器",
            "readOnlyHint": True,
            "destructiveHint": False,
            "idempotentHint": True,
            "openWorldHint": False,
        },
  • The Pydantic model 'DockerPsInput' defining the input schema for the tool.
    class DockerPsInput(BaseModel):
        """列出 Docker 容器的输入参数"""
        model_config = ConfigDict(extra="forbid")
    
        all: bool = Field(

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