comfyui-mcp
comfyui-mcp
ComfyUI용 MCP 서버입니다. MCP 호환 클라이언트에서 자연어 프롬프트를 사용하여 이미지를 생성하세요.
상태
v0.2 버전은 핵심 도구와 함께 업스케일, 이미지 프록시, 공개 URL 지원 기능을 제공합니다. 현재 도구 목록: generate_image, generate_variations, generate_with_workflow, refine_image, upscale_image, list_models, list_workflows, upload_image, generate_with_controlnet, generate_with_ip_adapter 및 워크플로우 템플릿 레지스트리. 향후 계획은 로드맵을 참조하세요.
Related MCP server: ComfyUI MCP
설치
npx (설치 불필요)
npx @miller-joe/comfyui-mcp --comfyui-url http://your-comfyui-host:8188npm
npm install -g @miller-joe/comfyui-mcp
comfyui-mcp --comfyui-url http://your-comfyui-host:8188Docker
docker run -p 9100:9100 \
-e COMFYUI_URL=http://your-comfyui-host:8188 \
ghcr.io/miller-joe/comfyui-mcp:latestMCP 클라이언트 연결
Claude Code:
claude mcp add --transport http comfyui http://localhost:9100/mcp또는 스트리밍 가능한 HTTP 엔드포인트를 MCP 게이트웨이(예: MetaMCP)에 등록하여 다른 서버와 통합할 수 있습니다.
구성
모든 옵션은 CLI 플래그 또는 환경 변수를 통해 설정할 수 있습니다:
CLI 플래그 | 환경 변수 | 기본값 | 설명 |
|
|
| 바인드 호스트 (HTTP 모드 전용) |
|
|
| 바인드 포트 (HTTP 모드 전용) |
|
| (설정 안 됨) | HTTP 대신 stdio를 통해 MCP 통신. stdio 우선 MCP 클라이언트(Claude Desktop, mcp-inspector)에 의해 하위 프로세스로 실행될 때 사용합니다. |
|
|
| 이 서버가 내부적으로 사용하는 ComfyUI HTTP URL |
|
|
| 클라이언트에 반환되는 이미지 URL의 외부 URL. 내부 URL에 MCP 클라이언트가 접근할 수 없는 경우(Docker 네트워크에서 흔함) 설정하세요. |
(플래그 없음) |
|
| 기본 체크포인트 파일명 |
전송 방식
서버는 기본적으로 스트리밍 가능한 HTTP를 사용합니다(Claude Code, MetaMCP, 원시 fetch에 적합). --stdio를 전달하거나 MCP_TRANSPORT=stdio를 설정하여 stdio 모드로 전환할 수 있으며, 이는 Claude Desktop 및 MCP Inspector와 같은 stdio 우선 클라이언트에서 기대하는 방식입니다:
# Claude Desktop config (claude_desktop_config.json):
{
"mcpServers": {
"comfyui": {
"command": "npx",
"args": ["-y", "@miller-joe/comfyui-mcp", "--stdio", "--comfyui-url", "http://127.0.0.1:8188"]
}
}
}클라이언트에 반환되는 이미지 URL
생성 도구는 <comfyui-public-url>/view?filename=…와 같은 이미지 URL을 반환합니다. --comfyui-public-url이 설정되지 않은 경우, URL은 내부 --comfyui-url 값을 사용합니다.
또한 서버는 프록시 엔드포인트를 노출합니다: GET /images/<filename>?subfolder=&type=output은 이 서버를 통해 이미지 바이트를 스트리밍하며, 클라이언트가 MCP 서버에는 접근할 수 있지만 ComfyUI에는 직접 접근할 수 없는 경우 유용합니다.
기본 체크포인트는 ComfyUI models/checkpoints/ 디렉토리에 있는 파일과 일치해야 합니다. COMFYUI_DEFAULT_CKPT를 통해 재정의하거나 도구 인수로 checkpoint를 전달하세요.
도구
generate_image
ComfyUI의 기본 txt2img 워크플로우를 사용하여 텍스트 프롬프트에서 이미지를 생성합니다.
매개변수: prompt (필수), negative_prompt, width, height, steps, cfg, seed, checkpoint.
generate_variations
시드를 변경하여 동일한 프롬프트의 여러 변형을 생성합니다. 모든 이미지를 한 번에 반환합니다.
매개변수: prompt (필수), count (2~16, 기본값 4), 그리고 generate_image와 동일한 생성 매개변수(seed 대신 base_seed 사용).
generate_with_workflow
임의의 ComfyUI 워크플로우 JSON(전체 노드 그래프)을 제출하고 결과 이미지 URL을 반환합니다. 사용자 지정 워크플로우(ControlNet, 업스케일링 또는 ComfyUI의 **Save (API Format)**에서 내보낸 모든 것)에 사용하세요.
매개변수: workflow (객체), 전체 노드 그래프.
refine_image
소스 이미지에 img2img를 실행합니다. 서버가 소스 URL을 가져와 ComfyUI에 업로드하고, 새 프롬프트에 따라 디노이징 패스를 실행합니다. denoise 값이 낮을수록 원본을 더 많이 보존하며, 높을수록 프롬프트에 더 많은 자유도를 부여합니다.
매개변수: prompt, source_image_url (필수), denoise (0~1, 기본값 0.5), 그리고 표준 생성 매개변수.
list_models
ComfyUI 인스턴스에서 사용 가능한 체크포인트, LoRA, 샘플러 또는 스케줄러를 나열합니다.
매개변수: kind, checkpoints(기본값), loras, samplers, schedulers 중 하나.
list_workflows
이 서버와 함께 제공되는 내장 워크플로우 템플릿(txt2img, img2img, upscale, controlnet, ip_adapter)을 나열합니다.
upload_image
img2img, ControlNet 또는 IP-Adapter 워크플로우에서 사용할 참조 이미지를 ComfyUI에 업로드합니다.
매개변수: source_url 또는 image_base64 (둘 중 하나 필수), filename (선택 사항), overwrite (기본값 false).
반환값: 저장된 파일명. 이는 LoadImage와 같은 워크플로우 노드에서 image 입력으로 사용할 수 있습니다.
generate_with_controlnet
ControlNet 전처리 이미지(포즈 스켈레톤, 깊이 맵, Canny 엣지, 노멀 맵 등)와 텍스트 프롬프트를 사용하여 이미지를 생성합니다.
매개변수: prompt, control_image_url (전처리된 컨디셔닝 이미지; 이 도구는 전처리기를 실행하지 않음), controlnet_model (models/controlnet/의 파일명), strength (02, 기본값 1), start_percent / end_percent (01, 샘플링 중 CN 활성화 시점 제어), 그리고 표준 생성 매개변수.
ComfyUI models/controlnet/ 디렉토리에 ControlNet 모델이 설치되어 있어야 합니다.
generate_with_ip_adapter
IP-Adapter를 통해 참조 이미지를 시각적/스타일/주제 가이드로 사용하여 이미지를 생성합니다.
매개변수: prompt, reference_image_url, preset (예: "STANDARD (medium strength)", "PLUS FACE (portraits)", "VIT-G (medium strength)"), weight (03, 기본값 1), start_at / end_at (01), 그리고 표준 생성 매개변수.
ComfyUI-IPAdapter-plus 커스텀 노드 팩과 프리셋에 맞는 IPAdapter 가중치 및 CLIP Vision 모델이 필요합니다.
워크플로우 템플릿 레지스트리
복잡한 워크플로우 JSON을 한 번 저장하고 나중에 이름으로 실행하세요. 템플릿은 --templates-dir 아래 디스크에 저장되므로(~/.config/comfyui-mcp/templates/<name>.json 기본값) 재시작 후에도 유지되며 MCP 클라이언트 간에 이식 가능합니다.
도구 | 설명 |
| 워크플로우 JSON을 이름이 지정된 슬롯에 저장합니다. |
| 설명 및 마지막 업데이트 타임스탬프와 함께 저장된 템플릿을 나열합니다. |
| 저장된 템플릿의 JSON과 메타데이터를 가져옵니다. |
| 저장된 템플릿을 삭제합니다. |
| 저장된 템플릿을 ComfyUI에서 실행하고 이미지 URL을 반환합니다. |
템플릿 이름은 영문자와 숫자로 시작해야 합니다. 허용 문자: a-z, A-Z, 0-9, -, _. 최대 64자.
반환 형식
모든 생성 도구는 ComfyUI 인스턴스에서 직접 제공하는 이미지 URL(http://<comfyui>/view?filename=…)을 반환합니다. 이 URL은 이미지 URL을 허용하는 모든 클라이언트에 바로 전달할 수 있습니다.
아키텍처
┌────────────────┐ ┌──────────────────┐ ┌──────────────┐
│ MCP client │────▶│ comfyui-mcp │────▶│ ComfyUI │
│ (Claude, etc.)│◀────│ (this server) │◀────│ instance │
└────────────────┘ └──────────────────┘ └──────────────┘
streamable HTTP HTTP REST + poll서버는 상태를 저장하지 않습니다. 단일 MCP 요청이 ComfyUI에 워크플로우를 제출하고, 완료될 때까지 /history/{id}를 폴링한 후 이미지 URL을 반환합니다.
개발
git clone https://github.com/miller-joe/comfyui-mcp
cd comfyui-mcp
npm install
npm run dev # hot-reload via tsx watch
npm run build # compile TS to dist/
npm run typecheck # strict type checkingNode 20+가 필요합니다.
로드맵
v0.2 포함 사항:
generate_image,generate_variations,generate_with_workflowrefine_image(소스 URL에서 img2img)upscale_image(ESRGAN / SwinIR 스타일 모델 업스케일)list_models,list_workflows,upload_imageComfyUI에 직접 접근할 수 없는 클라이언트를 위한 이미지 프록시 엔드포인트 (
/images/<filename>)외부에서 올바른 이미지 URL을 위한 구성 가능한 공개 URL
워크플로우 템플릿 레지스트리 (저장/나열/가져오기/삭제/실행)
generate_with_controlnet(ComfyUI 측에 ControlNet 모델 필요)generate_with_ip_adapter(ComfyUI-IPAdapter-plus 팩 필요)
계획 중:
장시간 생성 작업을 위한 WebSocket 진행 상황 이벤트.
라이선스
MIT © Joe Miller
지원
이 도구가 시간을 절약해 주었다면 개발 지원을 고려해 주세요:
모든 기여는 유지 관리, 문서화 및 다음 릴리스를 지원합니다.
Available Tools
15 toolsdelete_workflow_templateB
Delete a saved workflow template.
Inputs: name (required).
generate_imageB
Generate an image from a text prompt using ComfyUI's default txt2img workflow. Returns one or more image URLs served directly by the ComfyUI instance.
Inputs: prompt (required), negative_prompt, width, height, +4 more.
generate_variationsB
Generate multiple variations of the same prompt by varying the seed. Useful for picking the best result or exploring a concept.
Inputs: prompt (required), count, negative_prompt, width, +5 more.
generate_with_controlnetA
Generate an image conditioned by a ControlNet preprocessed image (pose, depth, canny, etc.) plus a prompt. Requires a ControlNet model installed in ComfyUI's models/controlnet/ directory. The control_image_url must already be the preprocessed conditioning image — this tool does not run preprocessors itself.
Inputs: prompt (required), control_image_url (required), controlnet_model (required), negative_prompt, +9 more.
generate_with_ip_adapterB
Generate an image using a reference image as an IP-Adapter visual/style/subject guide. Requires the ComfyUI-IPAdapter-plus custom node pack and the preset's matching models (IPAdapter weights + CLIP vision). Weight tunes how strongly the reference guides generation.
Inputs: prompt (required), reference_image_url (required), negative_prompt, preset, +9 more.
generate_with_workflowA
Submit an arbitrary ComfyUI workflow (full node graph) and return the resulting image URLs. Use this when you need a custom workflow like ControlNet, upscaling, or a node graph exported from ComfyUI's 'Save (API Format)'.
Inputs: workflow (required).
get_workflow_templateB
Fetch a saved workflow template's JSON and metadata.
Inputs: name (required).
list_modelsA
List available models or samplers on the ComfyUI instance. Use this to discover valid values for the 'checkpoint' parameter of other tools, or to see what LoRAs and samplers are installed.
Inputs: kind.
list_workflowsA
List built-in workflow templates shipped with this MCP server. These are the named workflows that can be used as a baseline; for arbitrary workflows use generate_with_workflow.
Inputs: no named parameters.
list_workflow_templatesA
List all saved workflow templates in the registry.
Inputs: no named parameters.
refine_imageA
Refine an existing image using img2img: fetch the source image, upload it to ComfyUI, and run a denoising pass guided by the prompt. Lower denoise preserves more of the original; higher denoise gives more freedom to the prompt.
Inputs: prompt (required), source_image_url (required), denoise, negative_prompt, +4 more.
run_workflow_templateB
Run a saved workflow template against ComfyUI and return the resulting image URLs.
Inputs: name (required).
save_workflow_templateA
Save a ComfyUI workflow JSON to the server's template registry under a named slot. Overwrites are disabled by default.
Inputs: name (required), workflow (required), description, overwrite.
upload_imageA
Upload a reference image to ComfyUI for use in img2img, ControlNet, or IP-Adapter workflows. Accepts either a source URL (will be fetched) or base64-encoded image data. Returns the stored filename for use as 'image' in workflow nodes like LoadImage.
Inputs: source_url, image_base64, filename, overwrite.
upscale_imageA
Upscale an image using a loaded upscaler model (ESRGAN, SwinIR, etc.). Fetches the source image, uploads to ComfyUI, runs the upscale node, and returns the output URL. Requires at least one upscaler model in ComfyUI's models/upscale_models/ directory.
Inputs: source_image_url (required), upscale_model (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 15 tools
Each tool has a clearly distinct purpose: generation methods (standard, variations, ControlNet, IP-Adapter, custom workflow), image manipulation (refine, upscale), workflow management (list, get, save, delete, run templates), and utilities (upload_image, list_models). No overlap in functionality.
All tools follow a consistent verb_noun pattern in snake_case (e.g., generate_image, list_models, save_workflow_template). No mixing of styles or ambiguous verbs.
15 tools cover the core capabilities of a ComfyUI integration (generation, conditioning, upscaling, workflow templates, and utilities) without being excessive. Each tool earns its place for a comprehensive image generation server.
The tool surface covers major workflows: txt2img, img2img, ControlNet, IP-Adapter, upscaling, and custom workflows via templates. Minor gaps like explicit inpainting/outpainting tools exist, but these can be handled through custom workflows.
Maintenance
Related MCP Connectors
AI image & video generation MCP server (16 models, DAG projects, MCP Apps UI, OAuth 2.1).
Remote MCP server for anime art, OCs, style pickers, inpainting, upscaling & anime video.
MCP server for Qwen Image 3 AI image generation
Remote MCP for RunComfy: ComfyUI deployments, hosted models, LoRA training. 31 tools.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables Claude Desktop to interact with local ComfyUI installations for AI-powered image generation, including workflow management, model selection, real-time monitoring, and custom workflow execution through natural language.1418MIT
- AlicenseAqualityAmaintenanceMCP server + Claude Code plugin for ComfyUI: execute workflows, generate images, visualize pipelines as Mermaid diagrams, compose/validate workflows, manage and download models, control VRAM, and explore custom nodes. 36 tools, cross-platform, installs via npx -y comfyui-mcp.4112,767 npm971MIT
- FlicenseNot gradedqualityDmaintenanceMCP server that connects local ComfyUI to AI agents, enabling natural language control of ComfyUI for creating workflows, generating images, and managing the queue.1-
- AlicenseAqualityDmaintenanceMCP server that provides image generation, captioning, and tagging via ComfyUI API, configurable for agent tools.43MIT