Skip to main content
Glama

get_system_stats

Retrieve ComfyUI server health metrics including version details, memory usage, and device information to monitor system status and resource utilization.

Instructions

Get ComfyUI server health: version, memory, device info.

    Returns system information including:
    - ComfyUI and PyTorch versions
    - RAM usage
    - Device info (CPU/GPU)

    Use this to verify ComfyUI is running and check resource usage.
    

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • MCP tool handler for get_system_stats. Fetches and validates ComfyUI system statistics, decorated with @mcp.tool() for automatic registration.
    @mcp.tool()
    def get_system_stats(ctx: Context) -> dict:
        """Get ComfyUI server health: version, memory, device info.
    
        Returns system information including:
        - ComfyUI and PyTorch versions
        - RAM usage
        - Device info (CPU/GPU)
    
        Use this to verify ComfyUI is running and check resource usage.
        """
        ctx.info("Fetching system stats...")
        try:
            data = comfy_get("/system_stats")
            stats = SystemStats(**data)
            return stats.model_dump()
        except Exception as e:
            return ErrorResponse.unavailable(str(e)).model_dump()
  • Pydantic model used to validate and structure the response from ComfyUI's /system_stats endpoint.
    class SystemStats(BaseModel):
        """Complete system statistics from /system_stats."""
    
        system: SystemInfo
        devices: list[DeviceInfo]
  • Registers the system tools (including get_system_stats) by calling register_system_tools(mcp).
    def register_all_tools(mcp):
        """Register all tools with the MCP server."""
        register_system_tools(mcp)
        register_discovery_tools(mcp)
        register_workflow_tools(mcp)
        register_execution_tools(mcp)
  • Top-level registration of all MCP tools during server setup, which includes the system tools.
    # Register all tools
    register_all_tools(mcp)
  • API helper function providing a convenient wrapper for fetching system stats via ComfyUI's /system_stats endpoint.
    def get_system_stats() -> dict:
        """Get ComfyUI system statistics."""
        return comfy_get("/system_stats")

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/IO-AtelierTech/comfyui-mcp'

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