ComfyUI MCP Server
Overview
ComfyUI MCP Server is a lightweight Python-based server that interfaces with a local ComfyUI instance to generate images programmatically via AI agent requests using the Model Context Protocol (MCP).
To use the ComfyUI MCP Server, clone the repository, install the required dependencies, start the ComfyUI instance, and run the MCP server. You can then send image generation requests through a client script.
- Supports flexible workflow selection for image generation. - Allows dynamic parameters such as prompt, width, height, and model. - Returns image URLs generated by ComfyUI.
- Automating image generation for various prompts.
- Integrating with AI agents for creative applications.
- Testing different workflows for image generation.
Add to your AI client
Use these steps to connect ComfyUI MCP Server in Cursor, Claude, VS Code, and other MCP-compatible apps. The same JSON appears in the Use with menu above for one-click copy.
Cursor
Add this to your .cursor/mcp.json file in your project root, then restart Cursor.
.cursor/mcp.json
{
"mcpServers": {
"comfyui-mcp-server-joenorton": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-comfyui-mcp-server-joenorton"
]
}
}
}Claude Desktop
Add this server entry to the mcpServers object in your Claude Desktop config, then restart the app.
~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows)
{
"mcpServers": {
"comfyui-mcp-server-joenorton": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-comfyui-mcp-server-joenorton"
]
}
}
}Claude Code
Add this to your project's .mcp.json file. Claude Code will detect it automatically.
.mcp.json (project root)
{
"mcpServers": {
"comfyui-mcp-server-joenorton": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-comfyui-mcp-server-joenorton"
]
}
}
}VS Code (Copilot)
Add this to your .vscode/mcp.json file. Requires the GitHub Copilot extension with MCP support enabled.
.vscode/mcp.json
{
"servers": {
"comfyui-mcp-server-joenorton": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-comfyui-mcp-server-joenorton"
]
}
}
}Windsurf
Add this to your Windsurf MCP config file, then restart Windsurf.
~/.codeium/windsurf/mcp_config.json
{
"mcpServers": {
"comfyui-mcp-server-joenorton": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-comfyui-mcp-server-joenorton"
]
}
}
}Cline
Open Cline settings, navigate to MCP Servers, and add this server configuration.
Cline MCP Settings (via UI)
{
"mcpServers": {
"comfyui-mcp-server-joenorton": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-comfyui-mcp-server-joenorton"
]
}
}
}FAQ
What are the prerequisites for using ComfyUI MCP Server?
You need Python 3.10+, a running instance of ComfyUI, and specific dependencies installed via pip.
How do I customize image generation requests?
You can modify the payload in the client script to change parameters like prompt, width, height, and model.
Is there a license for this project?
Yes, the project is licensed under the Apache License.7:["$","div",null,{"className":"container mx-auto flex flex-col gap-4","children":["$L26","$L27",["$","$L28",null,{"currentProject":{"id":2255,"uuid":"c82f5b68-e143-4459-8201-ba19fe597e1f","name":"comfyui-mcp-server","title":"ComfyUI MCP Server","description":"","avatar_url":"https://avatars.githubusercontent.com/u/16323?v=4","created_at":"2025-03-09T06:54:55.754Z","updated_at":"2025-03-12T10:20:56.071Z","status":"created","author_name":"joenorton","author_avatar_url":"https://avatars.githubusercontent.com/u/16323?v=4","tags":"[]","category":"developer-tools","is_featured":false,"sort":1,"url":"https://github.com/joenorton/comfyui-mcp-server","target":"_self","content":"$29","summary":"$2a","img_url":null,"type":null,"metadata":"{\"star\":\"2\",\"license\":\"Apache-2.0 license\",\"language\":\"Python\",\"is_official\":false,\"latest_commit_time\":\"2025-03-06 14:15:45\"}","user_uuid":null,"tools":null,"sse_url":null,"sse_provider":null,"sse_params":null,"is_official":false,"server_command":null,"server_params":null,"server_config":null,"allow_call":false,"is_innovation":false,"is_dxt":false,"dxt_manifest":null,"dxt_file_url":null,"is_audit":false},"randomProjects":[],"currentServerKey":"$undefined"}]]}]