Skip to main content
Glama

get_system_stats

Monitor ComfyUI server health and resource usage to verify system status and check memory, device information, and software versions.

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

  • The @mcp.tool()-decorated handler function that implements the core logic for get_system_stats, fetching data from ComfyUI /system_stats endpoint and validating with SystemStats model.
    @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 models (DeviceInfo, SystemInfo, SystemStats) defining the schema for system stats data validation and typing.
    class DeviceInfo(BaseModel): """Device information from ComfyUI /system_stats.""" name: str type: str index: int | None = None vram_total: int vram_free: int torch_vram_total: int torch_vram_free: int class SystemInfo(BaseModel): """System information from ComfyUI /system_stats.""" os: str ram_total: int ram_free: int comfyui_version: str python_version: str pytorch_version: str embedded_python: bool # Optional fields that may not exist in all versions required_frontend_version: str | None = None installed_templates_version: str | None = None class SystemStats(BaseModel): """Complete system statistics from /system_stats.""" system: SystemInfo devices: list[DeviceInfo]
  • Registration entry point calling register_system_tools(mcp) among others to register the get_system_stats tool with the MCP server.
    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)
  • Helper wrapper function for fetching raw system stats from ComfyUI API endpoint /system_stats, used by the tool handler.
    def get_system_stats() -> dict: """Get ComfyUI system statistics.""" return comfy_get("/system_stats")
  • Top-level call to register_all_tools(mcp), which indirectly registers the system tools including get_system_stats.
    register_all_tools(mcp)

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