comfy-agent-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@comfy-agent-mcpGenerate a 16:9 cyberpunk city at night image"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
comfy-agent-mcp
Local MCP server and CLI that drive ComfyUI with Qwen Image 2.1 so Cursor (or any MCP client) can generate and edit images on your machine.
Features
generate_image— text-to-image with aspect ratio, megapixels, or exactwidth/height(64–2048)edit_image— edit an existing PNG/JPEG with an instruction (e.g. “remove Chinese text, keep the rest”)Seed reuse as a decimal string for reproducible runs
Same capabilities available from the Python CLI (
comfy_cli.py)
Related MCP server: comfyui-mcp
Requirements
Node.js 18+
Python 3.10+ with
requests(py -m pip install requests)ComfyUI running locally at
http://127.0.0.1:8188Qwen Image 2.1 models loaded in ComfyUI (matching
workflow.json)
Setup
npm install
py -m pip install requestsStart ComfyUI, then run the MCP server:
npm startCursor MCP config
Point Cursor at server.mjs (adjust the path to your clone):
{
"mcpServers": {
"comfyui-local": {
"command": "node",
"args": ["E:/path/to/comfy-agent/server.mjs"]
}
}
}On Windows the CLI is invoked with py. Ensure the Python launcher is on your PATH.
MCP tools
generate_image
Parameter | Description |
| Image description |
| 1–4 images (default 1) |
|
|
| ~0.05–4 (used if size not set) |
| Exact pixels 64–2048 (both required; rounded to multiples of 8) |
| Decimal string from a previous result |
Size tips: icons ~256–512, UI ~1024, cinematic up to 2048.
edit_image
Parameter | Description |
| Path to the source PNG/JPEG |
| Edit instruction |
| 1–4 variations |
| Optional decimal string |
| Optional (e.g. text, watermarks) |
Editing uses the source as a Qwen reference. Reusing a generation seed alone does not edit a picture — use edit_image.
CLI
# Generate
py comfy_cli.py --prompt "cyberpunk city at night" --aspect-ratio "16:9 (Widescreen)" --megapixels 1
# Exact size
py comfy_cli.py --prompt "app icon, flat" --width 256 --height 256
# Edit
py comfy_cli.py --image ./output/photo.png --prompt "Remove all overlaid text" --negative "text, letters"
# Machine-readable output
py comfy_cli.py --prompt "..." --jsonImages are written to output/ by default (gitignored).
Project layout
File | Role |
| MCP server (stdio) |
| ComfyUI HTTP client / CLI |
| Qwen Image 2.1 workflow graph |
License
MIT — see LICENSE.
This server cannot be deployed
Maintenance
Related MCP Connectors
Generate AI images and videos from any compatible MCP client.
MCP server for Qwen Image 3 AI image generation
Focused MCP server for OpenAI image/audio generation (v2.0.0). Wraps endpoints via HAPI CLI.
Generate images, video, audio and short films with 140+ AI models from any MCP client.
1
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables Claude to generate images through a local ComfyUI instance using Stable Diffusion and SDXL models via natural language. Users can trigger image generation, list available checkpoint models, and monitor the ComfyUI queue status directly from their MCP client.MIT
- AlicenseNot gradedqualityBmaintenanceMCP server that wraps ComfyUI for SDXL image generation. It exposes tools for generating images, listing models, and checking ComfyUI health, with presets and GPU resource coordination.MIT
- AlicenseNot gradedqualityCmaintenanceEnables MCP clients to generate images using local ComfyUI with FLUX.2 Klein models optimized for Apple Silicon, plus model management and system diagnostics.MIT
- AlicenseAqualityBmaintenanceGenerates and edits images using OpenAI GPT Image or Google Gemini models, saving every result to disk and returning local file paths so AI assistants can continue working with the images. It enables prompt-based image creation, editing, inpainting, multi-image composition, and model listing through MCP tools.17 npm1Apache 2.0