MCP.so
ログイン

ComfyUI MCP Server

@Overseer66

ComfyUI MCP Server について

comfyui-mcp-server

設定

以下の設定を使って、このサーバーを MCP 対応クライアントに追加してください。

{
  "mcpServers": {
    "comfyui-mcp-server-overseer66": {
      "command": "python",
      "args": [
        "src/test_comfyui.py"
      ]
    }
  }
}

ツール

ツールは検出されませんでした

ツールは README から自動的に抽出されます。メンテナーは ## Tools という見出しの下に記載することで、このタブに反映できます。

概要

What is ComfyUI MCP Server?

A server implementation for integrating ComfyUI with the Model Context Protocol (MCP). It requires a running ComfyUI server—either self-hosted or an existing server address—and provides tools to generate images and run workflows via MCP.

How to use ComfyUI MCP Server?

Configure the ComfyUI host and port in src/.env, place custom workflow JSON files in the workflows directory, then run the server using UV (with mcp run src/server.py:mcp) or Docker (using the prebuilt image overseer66/mcp-comfyui). Debug locally with python src/test_comfyui.py or mcp dev src/server.py.

Key features of ComfyUI MCP Server

  • Integrates ComfyUI with MCP for AI agent workflows.
  • Built-in tools: text_to_image, download_image, run_workflow_with_file, run_workflow_with_json.
  • Custom workflows added by placing JSON files in the workflows directory.
  • Supports UV and Docker deployment.
  • Offers SSE transport for remote connections.
  • Debugging scripts for ComfyUI and MCP are included.

Use cases of ComfyUI MCP Server

  • Generate images by running ComfyUI text-to-image workflows from an MCP client.
  • Download generated images via the download_image tool after a text_to_image call.
  • Execute arbitrary ComfyUI workflows by providing a JSON file path or inline JSON data.
  • Run ComfyUI workflows inside a Docker container for isolated or remote environments.
  • Connect to a remote ComfyUI server via SSE transport for cloud-based setups.

FAQ from ComfyUI MCP Server

What dependencies are required?

A running ComfyUI server (self-hosted or accessible) and Python packages: mcp, websocket-client, and python-dotenv.

How do I add a new workflow as a tool?

Place the workflow JSON file in the workflows directory and declare it as a new tool in the system.

Can I use Docker? Are there limitations?

Yes. When using Docker, the host filesystem is not shared, so downloading images to a local folder may be difficult. Set RETURN_URL=false to receive image data as bytes, and set COMFYUI_HOST to an appropriate address (e.g., host.docker.internal). Note that large image payloads may exceed response limits.

How do I connect via SSE transport?

Run the SSE server with Docker (docker run -i --rm -p 8001:8000 overseer66/mcp-comfyui-sse) and set the url in mcp.json to http://localhost:8001/sse.

Does text_to_image return the actual image?

No, it returns only the URL of the generated image. Use the download_image tool or access the URL in a browser to obtain the actual image.

よくある質問

What dependencies are required?

A running ComfyUI server (self-hosted or accessible) and Python packages: mcp, websocket-client, and python-dotenv.

How do I add a new workflow as a tool?

Place the workflow JSON file in the `workflows` directory and declare it as a new tool in the system.

Can I use Docker? Are there limitations?

Yes. When using Docker, the host filesystem is not shared, so downloading images to a local folder may be difficult. Set `RETURN_URL=false` to receive image data as bytes, and set `COMFYUI_HOST` to an appropriate address (e.g., `host.docker.internal`). Note that large image payloads may exceed response limits.

How do I connect via SSE transport?

Run the SSE server with Docker (`docker run -i --rm -p 8001:8000 overseer66/mcp-comfyui-sse`) and set the `url` in `mcp.json` to `http://localhost:8001/sse`.

Does text_to_image return the actual image?

No, it returns only the URL of the generated image. Use the `download_image` tool or access the URL in a browser to obtain the actual image.

コメント

「その他」の他のコンテンツ