list_nodes
Discover available workflow nodes in ComfyUI by filtering results by name or category to identify components for building automation pipelines.
Instructions
List available ComfyUI nodes.
Args:
filter: Optional string to match node names (case-insensitive)
category: Optional category filter (exact match)
Returns a sorted list of node class names.
Use this to discover available nodes for workflow building.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filter | No | Filter by name (e.g., 'fal', 'image') | |
| category | No | Filter by category |
Implementation Reference
- The main handler function for the 'list_nodes' tool. It fetches cached nodes using get_cached_nodes(), applies optional filters for name and category, and returns a sorted list of matching node names.@mcp.tool() def list_nodes( filter: str = Field(default=None, description="Filter by name (e.g., 'fal', 'image')"), category: str = Field(default=None, description="Filter by category"), ctx: Context = None, ) -> list: """List available ComfyUI nodes. Args: filter: Optional string to match node names (case-insensitive) category: Optional category filter (exact match) Returns a sorted list of node class names. Use this to discover available nodes for workflow building. """ if ctx: ctx.info(f"Listing nodes{' matching: ' + filter if filter else ''}...") try: nodes = get_cached_nodes() result = [] for name, info in nodes.items(): if filter and filter.lower() not in name.lower(): continue if category and info.get("category", "").lower() != category.lower(): continue result.append(name) return sorted(result) except Exception as e: return [f"Error: {e}"]
- src/comfy_mcp_server/tools/__init__.py:23-29 (registration)The register_all_tools function calls register_discovery_tools(mcp), which defines and registers the list_nodes tool using @mcp.tool() decorator.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)
- src/comfy_mcp_server/__init__.py:92-92 (registration)Top-level registration call from the main server initialization that triggers registration of all tools including list_nodes.register_all_tools(mcp)
- Pydantic schema definitions for the list_nodes tool parameters using Field for validation and descriptions.filter: str = Field(default=None, description="Filter by name (e.g., 'fal', 'image')"), category: str = Field(default=None, description="Filter by category"), ctx: Context = None,