Comfyui (joenorton)

Design and media

Lightweight Python-based MCP (Model Context Protocol) server for local ComfyUI.

Your AI app calls the Comfyui (joenorton) MCP server, which does the work through tools like generate_image, generate_song, view_image and get_queue_status and sends the result back to the chat.

About Comfyui (joenorton)

Comfyui (joenorton) is a community MCP server from joenorton, filed in our directory under design and media. Lightweight Python-based MCP (Model Context Protocol) server for local ComfyUI.

The README for Comfyui (joenorton) lists tools such as generate_image, generate_song, regenerate and view_image, which your AI app can call once the server is connected.

At a glance

Publisher
joenorton (community)
Runs
See the README for setup
Written in
Python
License
Apache-2.0
GitHub stars
412

Tools Comfyui (joenorton) gives your AI app

  • generate_imageGenerate images (requires prompt).
  • generate_songGenerate audio (requires tags and lyrics).
  • regenerateRegenerate an existing asset with optional parameter overrides (requires assetid).
  • view_imageView generated images inline (images only, not audio/video).
  • get_queue_statusCheck ComfyUI queue state (running/pending jobs) - provides async awareness.
  • get_jobPoll job completion status by promptid - check if a job has finished.
  • list_assetsBrowse recently generated assets - enables AI memory and iteration.
  • get_asset_metadataGet full provenance and parameters for an asset - includes workflow history.
  • cancel_jobCancel a queued or running job.
  • list_workflowsList all available workflows.
  • run_workflowRun any workflow with custom parameters.
  • get_publish_infoShow publish status (detected project root, publish dir, ComfyUI output root, and any missing setup).
  • set_comfyui_output_rootSet ComfyUI output directory (recommended for Comfy Desktop / nonstandard installs; persisted across restarts).
  • publish_assetPublish a generated asset into the project's web directory with deterministic compression (default 600KB).

Tool names as the Comfyui (joenorton) README lists them. Your AI app shows the live list once Comfyui (joenorton) is connected.

How to set up Comfyui (joenorton)

  1. Follow the install steps in the Comfyui (joenorton) README; it is written in Python, so have that toolchain ready.
  2. Check the Comfyui (joenorton) README for keys or settings; the registry lists none that Comfyui (joenorton) requires.
  3. Add Comfyui (joenorton) to Claude Code, Claude Desktop, VS Code or Cursor with the config in the setup box on this page.
  4. Restart the app or reload its MCP servers, then ask it to list the Comfyui (joenorton) tools to confirm the connection.
  5. Run one read-only task with Comfyui (joenorton) first, such as a call to generate_image, before you allow anything that writes or sends.

Comfyui (joenorton) compared with similar servers

  • Nanobanana by zhongweili has fewer GitHub stars than Comfyui (joenorton) (408 against 412); both are community servers, and both run locally.
  • 3dsmax by cl0nazepamm has more GitHub stars than Comfyui (joenorton) (420 against 412); both are community servers, and both run locally.
  • Bambu Printer by DMontgomery40 has fewer GitHub stars than Comfyui (joenorton) (405 against 412); both are community servers, and both run locally. The Bambu Printer README lists 20 tools to Comfyui (joenorton)'s 14.

Before you connect Comfyui (joenorton)

  • Give Comfyui (joenorton) its own API key or account with the smallest permissions the job needs, never an admin key.
  • Keep your AI app asking before each Comfyui (joenorton) tool call until you trust what it does with them.
  • Treat text that Comfyui (joenorton) fetches as data. Pages, files and messages can hold instructions written to steer an AI.
  • Read the open issues for Comfyui (joenorton) on GitHub to see what breaks and how fast the maintainers reply.

Marketing use cases for Comfyui (joenorton)

How marketing and sales teams put Comfyui (joenorton) to work, by company size. Pick the size closest to yours and start Comfyui (joenorton) on one use case.

Small business

  • A small business can use Comfyui (joenorton) to resize and adapt one design for every channel instead of hiring for each version.
  • Owners can ask Comfyui (joenorton) to pull brand assets and make quick ad and social variations that still look on brand.
  • Comfyui (joenorton) runs on your own computer, which keeps data local; it needs a little setup, so a small team should plan an hour for it.

Mid-market

  • Creative teams can connect Comfyui (joenorton) so agents produce variants for testing while designers keep control of the master files.
  • Marketing teams can use Comfyui (joenorton) to hand off designs to web and ads with specs attached, cutting review rounds.
  • Start with generate_image and generate_song, the tools Comfyui (joenorton) lists first, and add more once the team trusts the results.

Enterprise

  • Enterprises can use Comfyui (joenorton) with brand rules and approved assets only, so generated work stays inside the brand system.
  • Large creative ops teams can use Comfyui (joenorton) to localize and version assets for many markets with review built in.
  • Comfyui (joenorton) is a community server, so have security review the code and pin a version before Comfyui (joenorton) touches company data.

Need help becoming an AI-forward company?

We connect MCP servers and AI agents to your CRM, content and data, with the guardrails your team needs.

Contact us

Comfyui (joenorton) README

From joenorton/comfyui-mcp-server on GitHub, shared under its Apache-2.0 license. Images are left out; the original has them.

README.md

ComfyUI MCP Server

Generate and refine AI images/audio/video through natural conversation

A lightweight MCP (Model Context Protocol) server that lets AI agents generate and iteratively refine images, audio, and video using a local ComfyUI instance.

You run the server, connect a client, and issue tool calls. Everything else is optional depth.

Quick Start (2–3 minutes)

This proves everything is working.

1) Clone and set up
git clone https://github.com/joenorton/comfyui-mcp-server.git
cd comfyui-mcp-server
pip install -r requirements.txt
2) Start ComfyUI

Make sure ComfyUI is installed and running locally.

cd <ComfyUI_dir>
python main.py --port 8188
3) Run the MCP server

From the repository directory:

python server.py

The server listens at:

http://127.0.0.1:9000/mcp
4) Verify it works (no AI client required)

Run the included test client:

# Use default prompt
python test_client.py

# Or provide your own prompt
python test_client.py -p "a beautiful sunset over mountains"
python test_client.py --prompt "a cat on a mat"

test_client.py will:

  • connect to the MCP server
  • list available tools
  • fetch and display server defaults (width, height, steps, model, etc.)
  • run generate_image with your prompt (or a default)
  • automatically use server defaults for all other parameters
  • print the resulting asset information

If this step succeeds, the system is working.

Note: The test client respects server defaults configured via config files, environment variables, or set_defaults calls. Only the prompt parameter is required; all other parameters use server defaults automatically.

That’s it.

Use with an AI Agent (Cursor / Claude / n8n)

Once the server is running, you can connect it to an AI client.

Create a project-scoped .mcp.json file:

{
  "mcpServers": {
    "comfyui-mcp-server": {
      "type": "streamable-http",
      "url": "http://127.0.0.1:9000/mcp"
    }
  }
}

Note: Some clients use "type": "http" instead of "streamable-http". Both work with this server. If auto-discovery doesn't work, try changing the type field.

Restart your AI client. You can now call tools such as:

  • generate_image
  • view_image
  • regenerate
  • get_job
  • list_assets

This is the primary intended usage mode.

What You Can Do After It Works

Once you’ve confirmed the server runs and a client can connect, the system supports:

  • Iterative refinement via regenerate (no re-prompting)
  • Explicit asset identity for reliable follow-ups
  • Job polling and cancellation for long-running generations
  • Optional image injection into the AI’s context (view_image)
  • Auto-discovered ComfyUI workflows with parameter exposure
  • Configurable defaults to avoid repeating common settings

Everything below builds on the same basic loop you just tested.

Migration Notes (Previous Versions)

If you’ve used earlier versions of this project, a few things have changed.

What’s the Same
  • You still run a local MCP server that delegates execution to ComfyUI
  • Workflows are still JSON files placed in the workflows/ directory
  • Image generation behavior is unchanged at its core
What’s New
  • Streamable HTTP transport replaces the older WebSocket-based approach
  • Explicit job management (get_job, get_queue_status, cancel_job)
  • Asset identity instead of ad-hoc URLs (stable across hostname changes)
  • Iteration support via regenerate (replay with parameter overrides)
  • Optional visual feedback for agents via view_image
  • Configurable defaults to avoid repeating common parameters
What Changed Conceptually

Earlier versions were a thin request/response bridge. The current version is built around iteration and stateful control loops.

You can still generate an image with a single call, but you now have the option to:

  • refer back to specific outputs
  • refine results without re-specifying everything
  • poll and cancel long-running jobs
  • let AI agents inspect generated images directly
Looking for the Old Behavior?

If you want the minimal, single-shot behavior from earlier versions:

  • run test_client.py (this mirrors the original usage pattern)
  • call generate_image with just a prompt (server defaults handle the rest)
  • ignore the additional tools

No migration is required unless you want the new capabilities.

Available Tools

Generation Tools
  • generate_image: Generate images (requires prompt)
  • generate_song: Generate audio (requires tags and lyrics)
  • regenerate: Regenerate an existing asset with optional parameter overrides (requires asset_id)
Viewing Tools
  • view_image: View generated images inline (images only, not audio/video)
Job Management Tools
  • get_queue_status: Check ComfyUI queue state (running/pending jobs) - provides async awareness
  • get_job: Poll job completion status by prompt_id - check if a job has finished
  • list_assets: Browse recently generated assets - enables AI memory and iteration
  • get_asset_metadata: Get full provenance and parameters for an asset - includes workflow history
  • cancel_job: Cancel a queued or running job
Configuration Tools
  • list_models: List available ComfyUI models
  • get_defaults: Get current default values
  • set_defaults: Set default values (with optional persistence)
Workflow Tools
  • list_workflows: List all available workflows
  • run_workflow: Run any workflow with custom parameters
Publish Tools
  • get_publish_info: Show publish status (detected project root, publish dir, ComfyUI output root, and any missing setup)
  • set_comfyui_output_root: Set ComfyUI output directory (recommended for Comfy Desktop / nonstandard installs; persisted across restarts)
  • publish_asset: Publish a generated asset into the project's web directory with deterministic compression (default 600KB)

Publish Notes:

  • Session-scoped: asset_ids are valid only for the current server session; restart invalidates them.
  • Zero-config in common cases: Publish dir auto-detected (public/gen, static/gen, or assets/gen); if ComfyUI output can't be detected, set it once via set_comfyui_output_root.
  • Two modes: Demo (explicit filename) and Library (auto filename + manifest update). In library mode, manifest_key is required.
  • Manifest: Updated only when manifest_key is provided.
  • Compression: Deterministic ladder to meet size limits; fails with a clear error if it can't.

Quick Start:

Example agent conversation flow:

User: "Generate a hero image for my website and publish it as hero.webp"

Agent: Checks publish configuration

  • Calls get_publish_info() → sees status "ready"

Agent: Generates image

  • Calls generate_image(prompt="a hero image for a website") → gets asset_id

Agent: Publishes asset

  • Calls publish_asset(asset_id="...", target_filename="hero.webp") → success

User: "Now generate a logo and add it to the manifest as 'site-logo'"

Agent: Generates and publishes with manifest

  • Calls generate_image(prompt="a modern logo") → gets asset_id
  • Calls publish_asset(asset_id="...", manifest_key="site-logo") → auto-generates filename, updates manifest

See docs/HOW_TO_TEST_PUBLISH.md for detailed usage and testing instructions.

Custom Workflows

Add custom workflows by placing JSON files in the workflows/ directory. Workflows are automatically discovered and exposed as MCP tools.

Workflow Placeholders

Use PARAM_* placeholders in workflow JSON to expose parameters:

  • PARAM_PROMPT → prompt: str (required)
  • PARAM_INT_STEPS → steps: int (optional)
  • PARAM_FLOAT_CFG → cfg: float (optional)

Example:

{
  "3": {
    "inputs": {
      "text": "PARAM_PROMPT",
      "steps": "PARAM_INT_STEPS"
    }
  }
}

The tool name is derived from the filename (e.g., my_workflow.json → my_workflow tool).

Configuration

The server supports configurable defaults to avoid repeating common parameters. Defaults can be set via:

  • Runtime defaults: Use set_defaults tool (ephemeral, lost on restart)
  • Config file: ~/.config/comfy-mcp/config.json (persistent)
  • Environment variables: COMFY_MCP_DEFAULT_* prefixed variables

Defaults are resolved in priority order: per-call values → runtime defaults → config file → environment variables → hardcoded defaults.

For complete configuration details, see docs/REFERENCE.md.

Detailed Reference

Complete parameter lists, return schemas, configuration options, and advanced workflow metadata are documented in:

  • API Reference - Complete tool reference, parameters, return values, and configuration
  • Architecture - Design decisions and system overview

Project Structure

comfyui-mcp-server/
├── server.py              # Main entry point
├── comfyui_client.py      # ComfyUI API client
├── asset_processor.py     # Image processing utilities
├── test_client.py         # Test client
├── managers/              # Core managers
│   ├── workflow_manager.py
│   ├── defaults_manager.py
│   └── asset_registry.py
├── tools/                 # MCP tool implementations
│   ├── generation.py
│   ├── asset.py
│   ├── job.py             # Job management tools
│   ├── configuration.py
│   └── workflow.py
├── models/                # Data models
│   ├── workflow.py
│   └── asset.py
└── workflows/             # Workflow JSON files
    ├── generate_image.json
    └── generate_song.json

Notes

  • The server binds to localhost by default. Do not expose it publicly without authentication or a reverse proxy.
  • Ensure your models exist in <ComfyUI_dir>/models/checkpoints/
  • Server uses streamable-http transport (HTTP-based, not WebSocket)
  • Workflows are auto-discovered - no code changes needed
  • Assets expire after 24 hours (configurable)
  • view_image only supports images (PNG, JPEG, WebP, GIF)
  • Asset identity uses (filename, subfolder, type) instead of URL for robustness
  • Full workflow history is stored for provenance and reproducibility
  • regenerate uses stored workflow data to recreate assets with parameter overrides
  • Session isolation: list_assets can filter by session for clean AI agent context

Troubleshooting

Server won't start:

  • Check ComfyUI is running on port 8188 (default)
  • Verify Python 3.8+ is installed (python --version)
  • Check all dependencies are installed: pip install -r requirements.txt
  • Check server logs for specific error messages

Client can't connect:

  • Verify server shows "Server running at http://127.0.0.1:9000/mcp" in the console
  • Test server directly: curl http://127.0.0.1:9000/mcp (should return MCP response)
  • Check .mcp.json is in project root (or correct location for your client)
  • Try both "type": "streamable-http" and "type": "http" - both are supported
  • For Cursor-specific issues, see docs/MCP_CONFIG_README.md

Tools not appearing:

  • Check workflows/ directory has JSON files with PARAM_* placeholders
  • Check server logs for workflow parsing errors
  • Verify ComfyUI has required custom nodes installed (if using custom workflows)
  • Restart the MCP server after adding new workflows

Asset not found errors:

  • Assets expire after 24 hours by default (configurable via COMFY_MCP_ASSET_TTL_HOURS)
  • Assets are lost on server restart (ephemeral by design)
  • Use get_asset_metadata to verify asset exists before using regenerate
  • Check server logs to see if asset was registered successfully

Known Limitations (v1.0)

  • Ephemeral asset registry: asset_id references are only valid while the MCP server is running (and until TTL expiry). After restart, previously-issued asset_ids can’t be resolved, and regenerate will fail for those assets.

Contributing

Issues and pull requests are welcome! See CONTRIBUTING.md for development guidelines.

Acknowledgements

  • @venetanji - streamable-http foundation & PARAM_* system

Maintainer

@joenorton

License

Apache License 2.0

Questions about Comfyui (joenorton)

What is the Comfyui (joenorton) MCP server?

Lightweight Python-based MCP (Model Context Protocol) server for local ComfyUI. Comfyui (joenorton) is maintained by joenorton on GitHub at joenorton/comfyui-mcp-server, and works with AI apps that support the Model Context Protocol, such as Claude, Cursor and VS Code.

How do I install the Comfyui (joenorton) MCP server?

Comfyui (joenorton) doesn't publish a one-line install in the MCP registry, so follow the setup steps in its README on GitHub (joenorton/comfyui-mcp-server). Like most servers, Comfyui (joenorton) ends with a command or URL you paste into your AI app's MCP config.

Does Comfyui (joenorton) need an API key?

The registry lists no required keys for Comfyui (joenorton). Check the Comfyui (joenorton) README for optional settings, and expect a remote server to ask you to sign in the first time you connect.

Is Comfyui (joenorton) an official MCP server?

No. Comfyui (joenorton) is a community server maintained by joenorton. Community servers can be excellent; read the code and the open issues before you give Comfyui (joenorton) access to company data.

What license is Comfyui (joenorton) under?

Comfyui (joenorton) is released under the Apache-2.0 license, according to its GitHub repository. The license covers the code of Comfyui (joenorton); the service it connects to has its own terms.