Comfy
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.
What is Comfy?
Comfy is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to 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.
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.
This server falls under the Business Applications category on MCPgee, the world's largest MCP server directory with 33,000+ servers.
Features
- The Comfy MCP Server uses the FastMCP framework to generate
Use Cases
Maintainer
Works with
Installation
Manual Installation
npx comfy-mcp-serverConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
How to Set Up and Use Comfy
The Comfy MCP Server bridges Claude and a running ComfyUI instance, allowing AI assistants to generate images by submitting workflow-based prompts to a remote or local ComfyUI server. It exposes two tools: generate_image, which takes a text prompt and submits it to the configured ComfyUI workflow, and generate_prompt, which uses an optional Ollama model to expand a topic into a detailed image generation prompt. This makes it possible to drive the full ComfyUI image generation pipeline through conversational AI without touching the ComfyUI web interface.
Prerequisites
- A running ComfyUI instance accessible via URL (local or remote)
- Python with uv package manager installed
- An exported ComfyUI workflow JSON file with a known prompt node ID and output node ID
- An MCP client such as Claude Desktop or Claude Code
- Optional: a running Ollama instance with a model for automated prompt expansion
Set up and export your ComfyUI workflow
In ComfyUI, build and test your image generation workflow. Export it as an API JSON file (Enable Dev Mode in ComfyUI settings first, then use 'Save (API Format)'). Note the node IDs for the text prompt node and the final image output node.
Install uv and test comfy-mcp-server
Install uv if not already available. You can run comfy-mcp-server directly via uvx without a permanent installation.
# Install uv:
curl -LsSf https://astral.sh/uv/install.sh | sh
# Test run:
uvx comfy-mcp-serverIdentify your workflow node IDs
Open your exported workflow JSON and find the node IDs for the text prompt input node (typically a CLIPTextEncode node) and the image output node (typically a SaveImage or PreviewImage node). These become PROMPT_NODE_ID and OUTPUT_NODE_ID.
Configure Claude Desktop with the Comfy MCP server
Add the server to your claude_desktop_config.json with all required environment variables pointing to your ComfyUI instance and workflow file.
Restart Claude Desktop and test image generation
Restart Claude Desktop. Ask Claude to generate an image. It will call generate_image, submit the workflow to ComfyUI, and poll for results. With OUTPUT_MODE=url, Claude will return a URL; with file mode, the image is saved locally.
Comfy Examples
Client configuration
Add comfy-mcp-server to claude_desktop_config.json. Replace the env values with your actual ComfyUI server URL, workflow file path, and node IDs.
{
"mcpServers": {
"comfy-mcp-server": {
"command": "uvx",
"args": ["comfy-mcp-server"],
"env": {
"COMFY_URL": "http://127.0.0.1:8188",
"COMFY_WORKFLOW_JSON_FILE": "/absolute/path/to/your/workflow_api.json",
"PROMPT_NODE_ID": "6",
"OUTPUT_NODE_ID": "9",
"OUTPUT_MODE": "file"
}
}
}
}Prompts to try
Use these prompts to generate images through ComfyUI via Claude. The generate_prompt tool can expand a simple topic into a detailed prompt before submitting to ComfyUI.
- "Generate an image of a futuristic city at night with neon lights and rain"
- "Create an image of a serene mountain lake at sunrise in photorealistic style"
- "Generate a prompt for a fantasy forest scene, then use it to create an image"
- "Make an image of an astronaut riding a horse on Mars in the style of an oil painting"
- "Generate an image based on this description: a cozy coffee shop interior with warm lighting"Troubleshooting Comfy
generate_image fails with connection refused or timeout
Verify your ComfyUI instance is running and accessible at the URL set in COMFY_URL. Test the connection by opening the ComfyUI URL in a browser. If ComfyUI is on a different machine, ensure firewall rules allow access on port 8188 (or your custom port).
Workflow executes but output image is never returned
Check that OUTPUT_NODE_ID matches the actual node ID of your SaveImage or PreviewImage node in the exported workflow JSON. Open the workflow JSON and look for the node with 'class_type': 'SaveImage' — its key is the correct OUTPUT_NODE_ID.
Prompt node ID mismatch causes empty or wrong images
Set PROMPT_NODE_ID to the ID of the CLIPTextEncode node that receives the positive text prompt in your workflow. In the exported API JSON, look for the node with 'class_type': 'CLIPTextEncode' and inputs containing 'text'. Its key is the correct PROMPT_NODE_ID.
Frequently Asked Questions about Comfy
What is Comfy?
Comfy is a Model Context Protocol (MCP) server that 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. It connects AI assistants to external tools and data sources through a standardized interface.
How do I install Comfy?
Follow the installation instructions on the Comfy GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.
Which AI clients work with Comfy?
Comfy works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.
Is Comfy free to use?
Yes, Comfy is open source and available under the MIT License license. You can use it freely in both personal and commercial projects.
Comfy Alternatives — Similar Business Applications Servers
Looking for alternatives to Comfy? Here are other popular business applications servers you can use with Claude, Cursor, and VS Code.
n8n
★ 189.1kA comprehensive MCP server that provides full control over n8n automation workflows through natural language. It offers 43 tools for managing workflows, executions, credentials, and data tables, with safety features like write-mode protection and dou
LobeHub
★ 77.5k🤯 LobeHub is your Chief Agent Operator, organizing your agents into 7×24 operations by hiring, scheduling, and reporting on your entire AI team.
Jeecgboot
★ 46.4kAI 低代码平台,「低代码 + 零代码」双模式驱动:低代码一键生成前后端代码,零代码 5 分钟搭建系统,AI Skills 一句话画流程、设计表单、生成整套系统。内置 AI聊天、知识库、流程编排、MCP插件等,兼容主流大模型。引领「AI 生成 → 在线配置 → 代码生成 → 手工合并->AI修改」开发模式,消除 Java 项目 80% 的重复工作,提效而不失灵活。
CowAgent
★ 44.7kCowAgent (chatgpt-on-wechat) 是基于大模型的超级AI助理,能主动思考和任务规划、访问操作系统和外部资源、创造和执行Skills、通过长期记忆和知识库不断成长,比OpenClaw更轻量和便捷。同时支持微信、飞书、钉钉、企微、QQ、公众号、网页等接入,可选择DeepSeek/OpenAI/Claude/Gemini/ MiniMax/Qwen/GLM/LinkAI,能处理文本、语音、图片和文件,可快速搭建个人AI助理和企业数字员工。
Minds Platform
★ 39.2kPlatform dedicated to building an open foundation for applied Artificial Intelligence, designed for people seeking production-ready AI systems they can truly control, extend and deploy anywhere.
Astrbot
★ 32.8kAI Agent Assistant & development framework that integrates lots of IM platforms, LLMs, plugins and AI feature, and can be your openclaw alternative. ✨
Browse More Business Applications MCP Servers
Explore all business applications servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.
Set Up Comfy in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
Ready to use Comfy?
Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.