ComfyUI MCP Server
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.
Related MCP server: ComfyUI MCP
2. Depuración
2.1 Depuración de ComfyUI
python src/test_comfyui.py2.2 Depuración de MCP
mcp dev src/server.py3. Instalación y configuración
3.1 Configuración de ComfyUI
Edite
src/.envpara 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
workflowsy 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, oAccede 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.jsonimagen 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_imagepuede resultar difícil ya que el contenedor Docker no comparte el sistema de archivos del host.Al utilizar Docker, tenga en cuenta lo siguiente:
Establezca
RETURN_URL=falseen.envpara recibir datos de imagen como bytes.Establezca
COMFYUI_HOSTen.enven la dirección adecuada (por ejemplo,host.docker.internalo la IP de su servidor).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
Ejecute el servidor SSE con Docker:
docker run -i --rm -p 8001:8000 overseer66/mcp-comfyui-sseConfigure
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.
Maintenance
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
- AlicenseNot gradedqualityCmaintenanceA lightweight MCP server that bridges AI agents with a local ComfyUI instance to generate and iteratively refine images, audio, and video through conversational tool calls.41MIT
- FlicenseNot gradedqualityBmaintenanceMCP server that connects local ComfyUI to AI agents, enabling natural language control of ComfyUI for creating workflows, generating images, and managing the queue.
- AlicenseAqualityDmaintenanceMCP server that provides image generation, captioning, and tagging via ComfyUI API, configurable for agent tools.43MIT
- AlicenseAqualityCmaintenanceMCP server that lets OpenCode (or any MCP-compatible AI coding tool) directly control ComfyUI for AI image generation.142MIT
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
Appeared in Searches
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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