Skip to main content
Glama

ComfyUI MCP 서버

1. 개요

  • ComfyUI를 MCP와 통합하기 위한 서버 구현.

  • ⚠️ 중요: 이 서버에는 ComfyUI 서버가 실행 중이어야 합니다.

    • 자신의 ComfyUI 서버를 호스팅해야 합니다.

    • 또는 기존 ComfyUI 서버 주소에 액세스할 수 있습니다.


Related MCP server: ComfyUI MCP

2. 디버깅

2.1 ComfyUI 디버깅

지엑스피1

2.2 MCP 디버깅

mcp dev src/server.py

3. 설치 및 구성

3.1 ComfyUI 구성

  • src/.env 편집하여 ComfyUI 호스트와 포트를 설정합니다.

    COMFYUI_HOST=localhost
    COMFYUI_PORT=8188

3.2 사용자 정의 워크플로 추가

  • 새로운 도구를 추가하려면 워크플로 JSON 파일을 workflows 디렉토리에 넣고 시스템에서 새 도구로 선언합니다.


4. 내장 도구

  • 텍스트를 이미지로

    • 생성된 이미지의 URL만 반환합니다.

    • 실제 이미지를 얻으려면:

      • download_image 도구를 사용하거나

      • 브라우저에서 URL에 직접 접근하세요.

  • 다운로드_이미지

    • 이미지 URL을 사용하여 다른 도구(예: text_to_image )에서 생성된 이미지를 다운로드합니다.

  • 파일과 함께 워크플로 실행

    • 워크플로 JSON 파일의 경로를 제공하여 워크플로를 실행합니다.

      # You should ask to agent like this.
      Run comfyui workflow with text_to_image.json
    • CursorAI의 예시 이미지

  • json으로 워크플로 실행

    • 워크플로 JSON 데이터를 직접 제공하여 워크플로를 실행합니다.

      # You should ask to agent like this.
      Run comfyui workflow with this 
      {
        "3": {
            "inputs": {
                "seed": 156680208700286,
                "steps": 20,
          ... (workflow JSON example)
      }

5. 실행 방법

5.1 UV 사용(권장)

  • 예시 mcp.json :

    {
      "mcpServers": {
        "comfyui": {
          "command": "uv",
          "args": [
            "--directory",
            "PATH/MCP/comfyui",
            "run",
            "--with",
            "mcp",
            "--with",
            "websocket-client",
            "--with",
            "python-dotenv",
            "mcp",
            "run",
            "src/server.py:mcp"
          ]
        }
      }
    }

5.2 Docker 사용하기

  • download_image 사용하여 로컬 폴더에 이미지를 다운로드하는 것은 Docker 컨테이너가 호스트 파일 시스템을 공유하지 않기 때문에 어려울 수 있습니다.

  • Docker를 사용할 때 다음 사항을 고려하세요.

    1. .env 에서 RETURN_URL=false 설정하여 이미지 데이터를 바이트로 받습니다.

    2. .env 에서 COMFYUI_HOST 적절한 주소(예: host.docker.internal 또는 서버의 IP)로 설정합니다.

    3. 참고: 이진 데이터를 사용하면 대용량 이미지 페이로드가 응답 한도를 초과할 수 있습니다.

5.2.1 Docker 이미지 빌드

# First build image
docker image build -t mcp/comfyui .
{
  "mcpServers": {
    "comfyui": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-p",
        "3001:3000",
        "mcp/comfyui"
      ]
    }
  }
}

5.2.2 기존 이미지 사용

미리 만들어진 이미지를 사용할 수도 있습니다.

{
  "mcpServers": {
    "comfyui": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-p",
        "3001:3000",
        "overseer66/mcp-comfyui"
      ]
    }
  }
}

5.2.3 SSE 전송 사용

  1. Docker로 SSE 서버를 실행합니다.

    docker run -i --rm -p 8001:8000 overseer66/mcp-comfyui-sse
  2. mcp.json 구성합니다(필요한 경우 localhost를 IP 또는 도메인으로 변경합니다):

    {
      "mcpServers": {
        "comfyui": {
          "url": "http://localhost:8001/sse" 
        }
      }
    }

참고: 새로운 워크플로를 도구로 추가하는 경우 Docker 이미지를 다시 빌드하고 다시 배포해야 사용할 수 있습니다.


A
license - permissive license
B
quality
D
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

View all related MCP servers

Related MCP Connectors

  • MCP server for Flux AI image generation

  • Generate AI images, video, music, and sound effects, and upscale them, from any MCP client.

  • MCP server for NanoBanana AI image generation and editing

View all MCP Connectors

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/Overseer66/comfyui-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server