ComfyUI_MCP

neutrinotek/ComfyUI_MCP

3.1

If you are the rightful owner of ComfyUI_MCP and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.

ComfyUI_MCP is an MCP Server designed to enhance the functionality and integration of ComfyUI with other systems.

ComfyUI_MCP

This repository provides a Model Context Protocol (MCP) server that exposes local ComfyUI workflow files and the remote ComfyUI model catalog to compatible LLM clients.

Features

  • Discovers workflow .json files stored under the workflows/ directory and exposes them as MCP resources.
  • Tools for listing workflow metadata and reading workflow contents.
  • Tool for recursively querying the ComfyUI /api/models endpoints so an LLM can inspect the available checkpoints, LoRAs, and other assets.
  • Configuration via CLI arguments or environment variables so the server can be launched from JSON descriptors (e.g., Cursor MCP definitions).

Installation

Create a virtual environment (recommended) and install the package in editable mode with your preferred installer:

pip install -e .

The project also works with uv so you can install or run it without using pip directly:

uv pip install -e .

# or run without installing into the current environment
uvx --from . comfyui-mcp --help

Running the server

The installed comfyui-mcp entry point launches the MCP server over stdio. Common configuration options can be supplied either as CLI flags or environment variables:

PurposeCLI flagEnvironment variableDefault
Workflow directory--workflow-dirCOMFYUI_WORKFLOW_DIR<repo>/workflows
ComfyUI API base URL--api-base-urlCOMFYUI_API_BASE_URLhttp://127.0.0.1:8188/
HTTP timeout (seconds)--http-timeoutCOMFYUI_HTTP_TIMEOUT30
Log level--log-levelCOMFYUI_MCP_LOG_LEVELINFO

Example stdio launch configuration for a Cursor MCP JSON definition:

If you prefer uvx, the same configuration can be expressed as:

{
  "comfyui": {
    "command": "uvx",
    "args": [
      "--from",
      ".",
      "comfyui-mcp",
      "--workflow-dir",
      "./workflows",
      "--api-base-url",
      "http://127.0.0.1:8188/"
    ]
  }
}

When referencing the project locally with uvx, ensure the working directory is set to the repository root (or adjust the --from path accordingly) so the package can be resolved without requiring it to be published to an external index.

Place your ComfyUI workflow files in the workflows/ directory (or whatever directory you configure) so they are available to the LLM.