From d5bc60ecf8df0f59c422333f582c297c11c0e26c Mon Sep 17 00:00:00 2001 From: Brian Gebel Date: Fri, 1 May 2026 20:03:26 -0700 Subject: [PATCH 1/3] feat(mcp): add ComfyUI MCP server Dockerfile --- services/mcp/dockerfile.comfy.mcp | 47 +++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 services/mcp/dockerfile.comfy.mcp diff --git a/services/mcp/dockerfile.comfy.mcp b/services/mcp/dockerfile.comfy.mcp new file mode 100644 index 0000000..679410e --- /dev/null +++ b/services/mcp/dockerfile.comfy.mcp @@ -0,0 +1,47 @@ +# MCP server for ComfyUI — joenorton/comfyui-mcp-server +# Standalone Python image; does NOT depend on the ComfyUI runtime image. +# Communicates with ComfyUI over HTTP (COMFYUI_URL env var). +# +# Published as: ghcr.io/pixeloven/comfyui/mcp: + +ARG MCP_VERSION=v1.1.1 + +FROM python:3.12-slim + +SHELL ["/bin/bash", "-o", "pipefail", "-c"] + +RUN apt-get update && \ + apt-get install -y --no-install-recommends git && \ + rm -rf /var/lib/apt/lists/* + +# Create non-root user +ARG APP_UID=1000 +ARG APP_GID=1000 +RUN groupadd -g "$APP_GID" comfy && \ + useradd -u "$APP_UID" -g "$APP_GID" -d /app -s /bin/bash -M comfy && \ + mkdir -p /app + +WORKDIR /app + +# Fetch pinned upstream source +ARG MCP_VERSION +RUN git clone --depth 1 --branch "$MCP_VERSION" \ + https://github.com/joenorton/comfyui-mcp-server.git . && \ + pip install --no-cache-dir -r requirements.txt && \ + rm -rf .git + +# Upstream FastMCP() defaults host="127.0.0.1" via its __init__ kwarg default, +# which explicit-kwarg initialization makes impossible to override via env var. +# Patch the constructor call directly so the server binds all interfaces. +RUN sed -i 's/port=9000,/port=9000, host="0.0.0.0",/' server.py + +RUN chown -R comfy:comfy /app + +USER comfy + +# COMFYUI_URL is required at runtime — point to the ComfyUI service +ENV COMFYUI_URL=http://localhost:8188 + +EXPOSE 9000 + +CMD ["python", "server.py"] From e17c0700c8330798c14441c17a7b9447acc76d7c Mon Sep 17 00:00:00 2001 From: Brian Gebel Date: Fri, 1 May 2026 20:17:57 -0700 Subject: [PATCH 2/3] feat(mcp): add mcp bake target and group --- docker-bake.hcl | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/docker-bake.hcl b/docker-bake.hcl index 3e00bff..64849a2 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -115,13 +115,33 @@ target "complete-cuda" { depends_on = ["core-cuda"] } +target "mcp" { + context = "services/mcp" + dockerfile = "dockerfile.comfy.mcp" + platforms = PLATFORMS + tags = [ + "${REGISTRY_URL}mcp:${IMAGE_LABEL}", + "${REGISTRY_URL}mcp:cache", + notequal("",IMAGE_LABEL) && notequal("latest",IMAGE_LABEL) ? "${REGISTRY_URL}mcp:latest" : "" + ] + cache-from = ["type=registry,ref=${REGISTRY_URL}mcp:cache,optional=true"] + cache-to = ["type=inline"] + args = { + MCP_VERSION = "v1.1.1" + } +} + +group "mcp" { + targets = ["mcp"] +} + // Convenience groups group "default" { targets = ["all"] } group "all" { - targets = ["runtime", "cuda", "cpu"] + targets = ["runtime", "cuda", "cpu", "mcp"] } group "core" { @@ -139,4 +159,3 @@ group "cuda" { group "cpu" { targets = ["runtime-cpu", "core-cpu"] } - From 8fe95ce1ba0a26dc1f34c9ce310c5d203dfd7984 Mon Sep 17 00:00:00 2001 From: Brian Gebel Date: Fri, 1 May 2026 20:20:37 -0700 Subject: [PATCH 3/3] feat(mcp): add mcp bake target to CI validation --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e2d58a5..da8aee8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -43,6 +43,7 @@ jobs: docker buildx bake --file docker-bake.hcl --print | grep -q "runtime-cpu" docker buildx bake --file docker-bake.hcl --print | grep -q "runtime-cuda" docker buildx bake --file docker-bake.hcl --print | grep -q "complete-cuda" + docker buildx bake --file docker-bake.hcl --print | grep -q "mcp" build-cuda: runs-on: ubuntu-latest