ComfyUI MCP Server

by Overseer66
Integrations
  • Supports environment variable configuration for ComfyUI connections through .env files, allowing users to customize host and port settings.

  • Supports containerized deployment of the MCP server through Docker, with instructions for building and configuring the Docker image.

  • Provides integration with ComfyUI, a Python-based stable diffusion interface, enabling AI image generation through tools like text_to_image and download_image capabilities.

Servidor MCP ComfyUI

1. Descripción general

  • Una implementación de servidor para integrar ComfyUI con MCP.
  • ⚠️ IMPORTANTE: Este servidor requiere un servidor ComfyUI en ejecución.
    • Debes alojar tu propio servidor ComfyUI,
    • o tener acceso a una dirección de servidor ComfyUI existente.

2. Depuración

2.1 Depuración de ComfyUI

python src/test_comfyui.py

2.2 Depuración de MCP

mcp dev src/server.py

3. Instalación y configuración

3.1 Configuración de ComfyUI

  • Edite src/.env para configurar el host y el puerto de ComfyUI:
    COMFYUI_HOST=localhost COMFYUI_PORT=8188

3.2 Agregar flujos de trabajo personalizados

  • Para agregar nuevas herramientas, coloque los archivos JSON de su flujo de trabajo en el directorio de workflows y declárelos como nuevas herramientas en el sistema.

4. Herramientas integradas

  • texto a imagen
    • Devuelve solo la URL de la imagen generada.
    • Para obtener la imagen real:
      • Utilice la herramienta download_image , o
      • Accede a la URL directamente en tu navegador.
  • descargar imagen
    • Descarga imágenes generadas por otras herramientas (como text_to_image ) utilizando la URL de la imagen.
  • ejecutar_flujo_de_trabajo_con_archivo
    • Ejecute un flujo de trabajo proporcionando la ruta a un archivo JSON de flujo de trabajo.
      # You should ask to agent like this. Run comfyui workflow with text_to_image.json
    • imagen de ejemplo de CursorAI
  • ejecutar_flujo_de_trabajo_con_json
    • Ejecute un flujo de trabajo proporcionando los datos JSON del flujo de trabajo directamente.
      # You should ask to agent like this. Run comfyui workflow with this { "3": { "inputs": { "seed": 156680208700286, "steps": 20, ... (workflow JSON example) }

5. Cómo correr

5.1 Uso de UV (recomendado)

  • Ejemplo 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 Uso de Docker

  • Descargar imágenes a una carpeta local con download_image puede resultar difícil ya que el contenedor Docker no comparte el sistema de archivos del host.
  • Al utilizar Docker, tenga en cuenta lo siguiente:
    1. Establezca RETURN_URL=false en .env para recibir datos de imagen como bytes.
    2. Establezca COMFYUI_HOST en .env en la dirección adecuada (por ejemplo, host.docker.internal o la IP de su servidor).
    3. Nota: Las cargas útiles de imágenes grandes pueden exceder los límites de respuesta cuando se utilizan datos binarios.
5.2.1 Crear imagen de 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 Uso de imágenes existentes

También puedes utilizar imágenes prediseñadas.

{ "mcpServers": { "comfyui": { "command": "docker", "args": [ "run", "-i", "--rm", "-p", "3001:3000", "overseer66/mcp-comfyui" ] } } }
5.2.3 Uso del transporte SSE
  1. Ejecute el servidor SSE con Docker:
    docker run -i --rm -p 8001:8000 overseer66/mcp-comfyui-sse
  2. Configure mcp.json (cambie localhost a su IP o dominio si es necesario):
    { "mcpServers": { "comfyui": { "url": "http://localhost:8001/sse" } } }

NOTA: Al agregar nuevos flujos de trabajo como herramientas, debe reconstruir y volver a implementar las imágenes de Docker para que estén disponibles.


-
security - not tested
A
license - permissive license
-
quality - not tested

hybrid server

The server is able to function both locally and remotely, depending on the configuration or use case.

Un servidor que integra ComfyUI con MCP, permitiendo a los usuarios generar imágenes y descargarlas a través de interacciones de lenguaje natural.

  1. Descripción general
    1. Depuración
      1. 2.1 Depuración de ComfyUI
      2. 2.2 Depuración de MCP
    2. Instalación y configuración
      1. 3.1 Configuración de ComfyUI
      2. 3.2 Agregar flujos de trabajo personalizados
    3. Herramientas integradas
      1. Cómo correr
        1. 5.1 Uso de UV (recomendado)
        2. 5.2 Uso de Docker

      Related MCP Servers

      • A
        security
        A
        license
        A
        quality
        A powerful MCP server for fetching and transforming web content into various formats (HTML, JSON, Markdown, Plain Text) with ease.
        Last updated -
        4
        146
        12
        TypeScript
        MIT License
        • Apple
        • Linux
      • -
        security
        A
        license
        -
        quality
        The Comfy MCP Server uses the FastMCP framework to generate images from prompts by interacting with a remote Comfy server, allowing automated image creation based on workflow configurations.
        Last updated -
        7
        Python
        MIT License
      • -
        security
        A
        license
        -
        quality
        A MCP server that integrates with Cursor IDE to generate images based on text descriptions using JiMeng AI, allowing users to create and save custom images directly within their development environment.
        Last updated -
        82
        Python
        MIT License
        • Apple
        • Linux
      • -
        security
        -
        license
        -
        quality
        A TypeScript-based MCP server that lets users generate images using OpenAI's dall-e-3 model by providing a prompt and image name.
        Last updated -
        1

      View all related MCP servers

      ID: 1ohqlsrp1j