MCP ScannerCustom audit
All servers

Comfy-Org/comfy-mcp

Local MCP server for ComfyUI — run your local ComfyUI from AI agents

Packagecomfy-mcp
Version0.11.0 in pyproject.toml
PublisherComfy-Org community
MCP Registrynot listed
Scanned2026-11-25
Scannerv1.3.0
Methodologyv1.2
Stars 345Forks 51Last push 2026-11-14
Python 100.0%by source files the scanner reads
Code safetypartly tracedExposure6.1Prompts10.0Supply chainnot checkedSecrets10.0Transparency10.0
Analysis confidence82%
How much of the server the scanner could read: tools analyzed, files parsed, limits hit.
Code Safetypartly traced—

Paths from tool input into commands, SQL, files and URLs

Capability Exposure6.1/10Fair

How much power the tools give an agent over the machine

Prompt Integritynothing published yet10.0/10

Hidden instructions and poisoning in text for the model

Supply Chainnot checked—

Known vulnerabilities in the packages the server uses

Secrets & Credentialsnothing published yet10.0/10

How the server reads credentials and where they can go

Behavior Transparencynothing published yet10.0/10

Whether the tools do only what their descriptions say

How far the analysis went

The scanner traces each tool from its input to the operations its code performs, and here it could not follow every path. Code Safety is shown as partly traced instead of a score: no finding there is not a clean result. The score of Capability Exposure counts only what it could follow.

  • In 13 places a tool's input is handed to a function whose name matches several definitions in the code; the scanner could not tell which one runs, so it stopped there
  • 1 file reached by the taint walk exceeded the 524288 byte size limit and were read and parsed only up to it
  • 1 file exceeded the 524288 byte size limit and were parsed only up to it
  • 1 source file could be read only in part
  • Supply Chain: the dependency files state no exact versions the scanner could check, so it has no number

Top risks in plain words

  • INFONo published risk: no tool declared to run commands, files, addresses or queries of the caller's choice, no known vulnerability in a production package, no advisory. Not every path through the code could be followed. Code findings appear here only after a person has verified them.

How to use it safely

Practical steps from what we found in this server. They lower the risk; they do not replace a review of the code.

  • Give it a narrowly scoped token

    Its code reads credentials or environment variables. Use a key limited to what this server needs, not your main one.

  • Keep confirmations on

    Leave your MCP client's confirmation prompt on for tools that change files, run commands or send data.

What its tools can do on your machine

The server offers 21 tools. When an AI agent calls them, this is what their code can do on the machine where the server runs, as traced in the source. Tools that call code the scanner could not follow may do more.

Start other programs on the machinecan run commands or launch programs
auth_status, fetch_outputs, free_memory, generate_image, list_partner_models, partner_model_schema and 4 more
10 of 21
Read or write filesopen, create, change or delete files
auth_status, fetch_outputs, free_memory, generate_image, list_partner_models, partner_model_schema and 4 more
10 of 21
Read passwords, tokens or keysload secrets such as API keys
auth_status
1 of 21
Read environment variablesoften where API keys are kept
auth_login, auth_status, billing_status, fetch_outputs, free_memory, generate_image and 11 more
17 of 21
Touch sensitive locationssuch as ~/.ssh, cloud credentials or browser data
auth_status
1 of 21

No tool was seen to: connect to the internet or other hosts.

Where its requests and secrets go

Read from the names along each tool's calls, not from a run: what the code says, not every address it may reach at run time.

Hosts written in the code

The literal addresses the tools' requests name.

  • None: no request names a fixed host.
Addresses from settings

Constants or settings that start an address; the value comes from configuration.

  • None seen.
Secrets it reads

Credential-like environment variables. Give the server a key with the least access it needs.

  • None: no credential-like variable is read by the tools.

Text it brings in from outside

Text that reaches the model from outside: an instruction hidden in it can steer the agent (prompt injection). Treat what these tools return as data, not as orders.

  • files10 tools · auth_status, fetch_outputs, free_memory +7

Tool annotations

21 of 21 tools declare annotations. readOnlyHint 6, destructiveHint 9, idempotentHint 10, openWorldHint 9.

Tools, prompts and resources (21: 21 tools)

Open a row for its full description. Chips show what its code can reach, and which risky capability its own description declares.

auth_logintool Start Comfy Cloud sign-in; returns an OAuth URL for the USER to open.Env vars
Start Comfy Cloud sign-in; returns an OAuth URL for the USER to open.

    Wraps ``comfy cloud login --no-browser``; sign-in continues in the
    background, so this call returns fast, not a ten-minute block. Give the
    user ``login_url``, let them finish in their browser, then confirm with
    ``auth_status`` — the authority on credentials; this tool only reports how
    the login process ended.

    Returns while pending: ``{"status": "awaiting_browser", "login_url": ...,
    "expires_in_s": ..., "next": ...}``. Calling again while pending returns
    the SAME URL (only one flow at a time). After it finishes, reports
    ``{"status": "completed"}`` or ``{"status": "failed", "error_code",
    "message"}`` once, then clears state. A child stuck past its deadline is
    reaped automatically rather than stranding the tool on a dead URL.

    Never returns secrets. Raises :class:`ComfyCliError` on failure before a
    URL, or if a comfy-cli too old emits none — fallback: manual
    ``comfy cloud login`` in a terminal.
auth_statustool Comfy Cloud credential status for partner-API nodes (read-only; never returns secrets).ProcessesFilesCredentialsEnv varsSensitive pathsoutside textread-only (declared)
Comfy Cloud credential status for partner-API nodes (read-only; never returns secrets).

    Wraps ``comfy cloud whoami``. Call before running a workflow whose nodes hit
    partner APIs (Seedream / Veo / Kling / Gemini / …) to self-diagnose.

    Returns comfy-cli's whoami payload as-is (``signed_in``, ``auth_method``,
    ``api_key_source``, ``base_url``, plus ``expired``/``session``/
    ``stale_base_url`` when a session exists — ``session`` already redacted
    upstream) plus ``registration_env_key_present``.

    BLIND SPOT: a ``COMFY_API_KEY`` in the MCP client's registration env is NOT
    reflected in ``api_key_source`` — whoami inspects only the cloud-purpose key
    slot. ``registration_env_key_present`` (bool presence only, never the value)
    covers that path and is ALWAYS a TOP-LEVEL key in the returned mapping; on
    the rare non-dict whoami payload it is the raw payload, not the flag, that
    nests — under ``whoami``.
billing_statustool Comfy Cloud credit balance, plan tier and job concurrency — READ-ONLY, spends nothing.Env varsread-only (declared)
Comfy Cloud credit balance, plan tier and job concurrency — READ-ONLY, spends nothing.

    Wraps ``comfy cloud status``. The tool for "how many credits do I have",
    "what plan am I on", "when does it renew" and "how many jobs can I run at
    once". It only READS billing state, so it raises no spend confirmation.

    Returns comfy-cli's payload as-is: ``cloud_workspace``
    {id,name,type,role}, ``credit_balance_usd``/``credit_balance_credits``/
    ``effective_balance_micros``, ``currency``, ``balance_confirmed``,
    ``subscription`` {tier,status,is_active,plan_slug,renewal_date,cancel_at},
    ``max_concurrent_jobs``, ``upgrade_suggestion``, ``manage_url`` and
    ``message``.

    ``balance_confirmed: false`` means the balance fields are ``null`` because
    none could be ESTABLISHED — never render that as $0. Relay ``message``
    verbatim when present; it is comfy-cli's own neutral copy for that case,
    not something to re-derive from the numbers.

    Signed out raises comfy-cli's own error — get the user signed in with
    ``auth_login`` / ``auth_status``. Below comfy-cli 1.17.0,
    degrades to ``{"error", "unsupported": True}`` carrying
    ``balance_confirmed: False`` and the balance fields ``null``, so the rule
    above holds there too.
emit_partner_workflowtool Write a runnable workflow that drives a partner model's NODE on LOCAL ComfyUI.destructive (declared)
Write a runnable workflow that drives a partner model's NODE on LOCAL ComfyUI.

    Wraps ``comfy generate <model> --emit-workflow <out_path>``. Writes an
    API-format graph containing the partner's API node and returns — calls no
    partner API, spends nothing. Chain::

        emit_partner_workflow("flux-pro", "/tmp/flux.json", {"prompt": "a red fox"})
        run_workflow("/tmp/flux.json", confirm_spend=True)   # the node bills HERE
        fetch_outputs(prompt_id)

    Args:
        model: only FIVE aliases map to a node — ``flux-2``, ``flux-pro``,
            ``kling-i2v``, ``nano-banana``, ``seedance``. Everything else
            raises; route to ``partner_generate`` instead (narrow coverage,
            not "unsupported").
        params: the model's own inputs, same validation as ``partner_generate``;
            optional even where the proxy requires them (defaults fillable
            later via ``set_workflow_slot``).
        out_path: the workflow JSON to write. comfy-cli OVERWRITES it in place
            with no existence check — name a fresh file.

    Returns:
        comfy-cli's own ``{"out": ..., "model": ..., "nodes": ...}``.

    Gotchas:
        - No ``confirm_spend`` here: this call never spends. RUNNING the
          emitted graph is what bills — pass ``confirm_spend=True`` to that
          ``run_workflow`` call, and do not read its absence as protection: a
          comfy-cli lacking the spend gate runs and bills silently regardless.
fetch_outputstool Download a completed job's output files into ``out_dir``.ProcessesFilesEnv varsoutside text
Download a completed job's output files into ``out_dir``.

    Wraps ``comfy download <prompt_id> --where local [-o <out_dir>]``.
    ``url_only=True`` emits URLs without downloading.

    Omit ``out_dir`` and comfy-cli picks it: the project's ``outputs/``, its
    configured default, or ``./outputs``; the returned ``out_dir`` names where
    it wrote.

    Remote jobs work although ``download`` is not in
    ``_TARGET_AWARE_SUBCOMMANDS``: the submitting run's local state file maps
    ``prompt_id`` to output URLs. An unknown local id has no record.

    ``inline_images=True`` adds bounded MCP media (images, small audio) plus a
    ``structuredContent`` manifest of every output's path/type/size; video and
    over-cap files are path-only records (``preview_media`` renders a video).
free_memorytool Ask the local ComfyUI to unload models / reset its executor cache.ProcessesFilesEnv varsoutside textdestructive (declared)
Ask the local ComfyUI to unload models / reset its executor cache.

    Wraps ``comfy free`` (ComfyUI's own ``POST /free``). Pair with
    ``system_stats`` for the before/after.

    Args:
        unload_models: True (default) unloads all models from VRAM.
            ``unload_models=False`` with ``free_memory`` left default
            requests NOTHING — a deliberate no-op, not "reset cache, keep
            models".
        free_memory: also resets the executor cache; ``None`` (default)
            follows ``unload_models``, so a bare call asks for both.
            ``True`` with ``unload_models=False`` is rejected: ComfyUI
            cannot reset the cache without unloading everything.

    NOT IMMEDIATE, never destructive: applied when the queue worker next
    iterates — does **not** interrupt a running job, so this cannot stop one
    (``job(action="cancel")`` does). Returns what was REQUESTED, not a measurement —
    re-check ``system_stats``. NOT diverted by ``COMFYUI_URL``/``COMFYUI_HOST``
    — same ``comfy_target_note`` behavior as ``system_stats``.
generate_imagetool Generate an image from a text prompt — the fast on-ramp.ProcessesFilesEnv varsoutside text
Generate an image from a text prompt — the fast on-ramp.

    Runs the built-in text-to-image template via ``comfy run-template``
    (override with ``COMFY_T2I_TEMPLATE`` + matching slot envs) — same path/target
    as ``run_workflow``: this machine unless ``COMFYUI_URL``/``COMFYUI_HOST``
    says otherwise; never Cloud.

    Args:
        checkpoint: swaps the checkpoint model; must already be installed on
            the machine that RUNS the job. Omit for the template's default.
        wait: True (default) blocks up to ``timeout_seconds``, streaming
            progress; False submits and returns a ``prompt_id`` at once —
            prefer False on slow hardware.
        timeout_seconds: bounds this wait when ``wait=True``. Default 60s:
            your client's own transport cap (seen in the wild at 120-300s) is
            invisible here and the shorter wins, so it is the real ceiling.

    Returns: ``run_workflow``'s shape (``prompt_id`` + outputs) when the run
    finishes in time. An expired wait is NOT a failure: it returns
    ``{"timed_out": True, "prompt_id", "status", "note"}`` for a job still
    RUNNING — poll ``job(action="status")``, collect ``fetch_outputs``, cancel
    ``job(action="cancel")``. That holds for the engine's own per-event deadline
    as much as this wait's, so no expiry drops the handle.

    Gotchas:
    - Always FREE, a local OSS graph — use ``partner_generate`` for paid
      PARTNER models.
    - For a chosen template or hand-authored workflow, use
      ``search_templates`` -> ``fetch_template`` -> ``run_workflow``.
jobtool Inspect, wait on, watch, or cancel a submitted job — one action per call.Env varsdestructive (declared)
Inspect, wait on, watch, or cancel a submitted job — one action per call.

    Wraps the `comfy jobs` family. `action`:
    - "status" (default) -> `comfy jobs status <prompt_id>`: status + outputs.
    - "error" -> same call, normalized: `error_code` (comfy-cli's own code, e.g.
      "server_died" for a crash mid-run, such as an OOM kill — check `get_logs`
      before relaunching; `None` on an ordinary node failure),
      `exception_type`/`exception_message`, `node_id`/`node_type`, a capped
      `traceback_tail`. `error: None` when healthy — safe to call speculatively.
    - "wait" -> poll until terminal (default 25.0s, ceiling 3600s); returns the
      final payload, or `{"timed_out": True, "status": <last>}` on expiry — a
      TIMEOUT, not a failure.
    - "watch" -> relay progress while waiting (default 600.0s, same ceiling);
      needs comfy-cli >= 1.16.0. Expiry: `{timed_out, events_seen, status:
      {progress, total, nodes_done, events_seen}}`; `events_seen: 0` adds
      `job` + `hint`.
    - "cancel" -> stop a queued/running job.
    - "queue" -> list known jobs (Comfy Cloud-tracked rows filtered out).

    `prompt_id` is required for every action but "queue"; `timeout_seconds` only
    for "wait"/"watch" — either where unused is rejected.
launch_comfyuitool Start the LOCAL ComfyUI server, detached, and return once it is up.Env vars
Start the LOCAL ComfyUI server, detached, and return once it is up.

    Wraps ``comfy launch --background``, recording its pid so ``stop_comfyui``
    can shut it down. ``extra_args`` forward to ComfyUI after a ``--``
    separator. Call ``server_info`` first — a second launch fails on the port.

    **Network-exposing flags need the USER's confirmation.** ComfyUI has no
    auth, so a non-loopback ``--listen`` (bare included) or
    ``--enable-cors-header`` publishes its full API to anything that can
    reach this machine. Those flags raise an MCP elicitation; a decline
    starts nothing, even with ``confirm_network_exposure=True``. On a client
    that cannot prompt, that flag is the fallback — set it ONLY when the
    user has actually agreed. ``--listen 127.0.0.1``/``::1``/``localhost``
    needs no confirmation.

    Prints text with no JSON envelope; success returns a synthesized
    ``{"ok": True, ...}``. When the installed comfy-cli DOES report a pid, it
    is the one verified to be listening on the port, not the launch wrapper
    comfy-cli records (kept as ``recorded_pid``); ``pid_source``/``pid_note``
    say which you got. Stop the server with ``stop_comfyui``, never by killing
    a reported pid.

    **LOCAL-ONLY.** With ``COMFYUI_URL``/``COMFYUI_HOST`` set this cannot touch
    that remote, so it launches nothing and returns a refusal with ``ok`` and
    ``launched`` both ``False`` (and ``reason: remote_target_configured``, plus
    ``remote_target``); test ``launched is False`` — a success omits it, a
    failure raises. A malformed value raises. Unset those to launch locally.
list_partner_modelstool List the hosted PARTNER models ``partner_generate`` can run.ProcessesFilesEnv varsoutside textread-only (declared)
List the hosted PARTNER models ``partner_generate`` can run.

    Wraps ``comfy generate list`` — the ONLY source of the partner alias
    catalog (``nodes``/``search_templates`` read the local install).

    Args:
        style/partner/query: filters forwarded to comfy-cli, exact/substring;
            an unfiltered call shows the real ``category`` strings.
        limit/offset: default 100, capped at 200; page while ``shown`` <
            ``total``.

    Returns:
        ``{"total", "shown", "offset", "filters", "models"}``; each model
        ``{alias, id, partner, category, mode, summary}``. Follow with
        ``partner_model_schema`` for parameters.

    Freshness: PINNED — a curated allowlist in the INSTALLED comfy-cli's code.
    Absence here is NOT evidence it does not exist — do not tell the user the
    model does not exist; the fix is a comfy-cli UPGRADE, not ``comfy generate
    refresh`` (the allowlist is code). One row can stand for a whole model
    FAMILY — read ``partner_model_schema`` before committing to a variant.
partner_generatetool Run a hosted PARTNER model (Flux / Ideogram / DALL·E / Recraft / …) — SPENDS CREDITS.destructive (declared)
Run a hosted PARTNER model (Flux / Ideogram / DALL·E / Recraft / …) — SPENDS CREDITS.

    Wraps ``comfy generate <model> [--param=value]…``. Runs entirely on the
    PARTNER's infrastructure — the user's local ComfyUI never executes anything.
    For local execution, use ``emit_partner_workflow`` -> ``run_workflow`` ->
    ``fetch_outputs`` instead (covers only the models comfy-cli can render as a
    node).

    Args:
        params: the model's own inputs (``prompt``, ``aspect_ratio``, ``seed``,
            …), forwarded verbatim. Discover them with ``list_partner_models()``
            and ``partner_model_schema(model)`` — not ``nodes`` /
            ``search_templates``, which answer a local-install question.
        confirm_spend: this call ALWAYS spends credits. Set True ONLY when the
            user has actually agreed to spend on this call — never merely to
            clear an error. A client that supports MCP elicitation prompts the
            user anyway, so this is the fallback for one that cannot. A durable
            ``comfy generate consent always`` in comfy-cli's own config skips
            the prompt — the engine consenting to itself, not this server.
        out_path: forwards ``--download <path>``; a save-path TEMPLATE, not a
            filename — ``{request_id}``/``{index}``/``{ext}`` are substituted,
            and a trailing slash means "default filename in this directory".

    Gotchas:
        - With no consent source available, comfy-cli fails CLOSED — nothing
          is spent.
        - Saved paths come back as ``saved_paths``, verbatim from what
          comfy-cli printed.
partner_model_schematool Show one partner model's callable parameters — the input to ``partner_generate``.ProcessesFilesEnv varsoutside textread-only (declared)
Show one partner model's callable parameters — the input to ``partner_generate``.

    Wraps ``comfy generate schema <model>``. ``model`` is an alias from
    ``list_partner_models``. Reads the spec only — no partner API call, no spend.

    Returns: ``{model, id, partner, category, summary, mode, polling,
    content_type, params, example}``. ``params`` rows carry ``name``, ``type``
    (``binary`` = local file path), ``required``, ``default``, ``enum``,
    ``description``. ``example`` is a CLI invocation to translate into
    ``params={...}``.

    Freshness: PINNED — params/enums come from the spec vendored into the
    INSTALLED comfy-cli wheel; refresh via ``comfy generate refresh``. Still the
    finest-grained view of a partner's variants (an enum here typically
    enumerates what ``list_partner_models`` collapses into one row): on a miss,
    say the installed comfy-cli doesn't list it, don't claim it doesn't exist —
    and do NOT quietly substitute a neighbor (``lite`` for ``pro`` is a
    downgrade the user never agreed to).
preview_mediatool Render local media as a PNG through ``comfy preview``.ProcessesFilesEnv varsoutside textdestructive (declared)
Render local media as a PNG through ``comfy preview``.

    comfy-cli owns classification and creates a thumbnail, video contact sheet,
    or audio waveform. ``inline_image=True`` appends the bounded PNG to its
    metadata; false returns metadata only. Relative paths follow
    ``COMFY_PROJECT``.
restart_comfyuitool Restart the LOCAL ComfyUI server: stop the running one, then launch a fresh one.Env varsdestructive (declared)
Restart the LOCAL ComfyUI server: stop the running one, then launch a fresh one.

    Composes ``stop_comfyui`` + ``launch_comfyui`` (no ``comfy restart`` verb);
    ``extra_args`` forward to the new server. Returns the new server's status.

    **LOCAL-ONLY: RAISES if ``COMFYUI_URL``/``COMFYUI_HOST`` names a remote**
    (``comfy stop``/``launch`` take no ``--host``/``--port``); restart a remote
    on its own host.

    Carries ``launch_comfyui``'s **network-exposure confirmation** unchanged
    (non-loopback ``--listen``/``--enable-cors-header`` asks the USER, BEFORE
    the stop so a decline leaves the server alone); ``confirm_network_exposure``
    is the no-prompt fallback.

    The stop is swallowed only for "nothing to stop"; other stop failures
    raise. If the freed port is then held by a server comfy-cli didn't start,
    this identifies it and asks the USER to recycle it — gated the same way,
    via ``confirm_kill_untracked`` (default False kills nothing); a decline
    reproduces the port error.

    **One lifecycle call at a time** — a concurrent launch/stop/restart is
    refused immediately rather than racing comfy-cli's one recorded server.
run_templatetool Run a gallery template — fetch, fill params, execute.Env vars
Run a gallery template — fetch, fill params, execute.

    Wraps ``comfy run-template <name> [--param=KEY=VALUE]…`` (fetches the
    graph, fills its slots, runs via the same path as ``run_workflow``) — the
    one-command alternative to ``search_templates`` -> ``fetch_template`` ->
    ``run_workflow``.

    Args:
        params: ``{slot: value}``, slot an address (``"6.text"``) or unique
            name (``"prompt"``); list slots by fetching the template first.
            Subgraph interior slots use ``A/B.name`` addressing.
        confirm_spend: SOME templates embed partner-API (paid) nodes and spend
            the signed-in account's Comfy credits when run. Set True ONLY when
            the user has actually agreed — never merely to clear an error.
            Free templates are never gated by this.
        wait: if True (default), block and stream progress, returning the full
            result. If False, submit ``--async`` and return a ``prompt_id`` to
            poll — preferred for long (video) runs.
        timeout_seconds: bounds this call's wall clock (default 600s).

    Gotchas:
        - Without consent, a paid template fails CLOSED
          (``spend_consent_required``, nothing spent); free templates run.
        - A missing referenced model surfaces as a per-node error.
run_workflowtool Run a ComfyUI workflow JSON on the ComfyUI this server targets.Env vars
Run a ComfyUI workflow JSON on the ComfyUI this server targets.

    That is this machine unless ``COMFYUI_URL``/``COMFYUI_HOST`` points the
    run/job tools at another one. Wraps ``comfy run --workflow <path>``;
    accepts an API-format or UI-export file. Give a hand-written API-format
    graph a ``_meta.title`` per node — a canvas label only, never execution.

    Args:
        wait: if True (default), block until the run finishes and return the
            full result. If False, submit and return with a ``prompt_id`` to
            poll via ``job(action="status")``.

            Progress notifications are EMITTED WHEN THE ENGINE REPORTS ANY —
            do not rely on them. comfy-cli 1.15.0's stream carries no
            per-step events for this verb, so in practice a run is silent
            until it finishes. Poll ``job(action="status")`` from a second
            call if you need progress.
        timeout_seconds: used only when ``wait=True``; default 110s sits under
            a typical client's ~120s budget. For a longer run, prefer
            ``wait=False`` + ``job(action="wait")``/``job(action="watch")``.
        confirm_spend: SOME workflows (partner-API nodes from
            ``emit_partner_workflow``, or an ``API``-tagged template) spend
            credits when run. Set True ONLY when the user has actually agreed
            to spend — never merely to clear an error. Free workflows are
            never gated by this.

    Gotchas:
        - Without consent, a paid workflow fails CLOSED
          (``spend_consent_required``, nothing spent) on a comfy-cli carrying
          the gate — the enforced floor; a source build past the fail-open
          floor check may lack it and still spend.
        - A workflow requesting a huge allocation can pass validation and then
          crash the whole ComfyUI process on OOM — surfaced as
          connection-loss/timeout, not a node error; ``get_logs`` still reads
          the log across the crash.
        - Partner-API nodes need a Comfy credential (``COMFY_API_KEY``);
          transient failures retry automatically.
server_infotool Report the local ComfyUI/comfy-cli environment and verify compatibility.ProcessesFilesEnv varsoutside textread-only (declared)
Report the local ComfyUI/comfy-cli environment and verify compatibility.

    Wraps ``comfy env``. Call this first to confirm a local ComfyUI is up before
    running a workflow.

    Returns:
        ``running``/``url``/``workspace``/``python`` — the LOCAL comfy-cli
        install, always, even with a remote ComfyUI configured (see below).
        Plus:
        - ``hardware`` (GPU/VRAM/RAM), present only when the installed
          comfy-cli reports one — check for the key, then consult the routing
          guidance in the server instructions before starting local generation.
        - ``compatibility``: this server's own version/envelope compatibility
          check; raises before returning on a hard incompatibility.
        - ``freshness`` (from ``comfy outdated``): ``core``/``packs``
          staleness. If either is outdated, tell the user to update FIRST
          (``comfy update comfy`` for core, ``comfy node update <pack>`` for a
          pack) before concluding the catalog lacks something.
          ``{"unsupported": true}`` means this comfy-cli cannot answer —
          nothing is broken.
        - ``comfy_target`` (host/port), only when a remote ComfyUI is
          configured (``COMFYUI_URL``/``COMFYUI_HOST``) — the submit/poll
          tools follow it; this call never probes it.

        ``config.background``, when a background server is recorded, reports
        the pid comfy-cli verified is LISTENING on that port, with the pid it
        recorded (the launch wrapper, which does not hold the port) kept as
        ``recorded_pid``; ``pid_source``/``pid_note`` say which you got. Stop a
        server with ``stop_comfyui``, never by killing a reported pid.
stop_comfyuitool Stop the LOCAL ComfyUI server that comfy-cli launched.ProcessesFilesEnv varsoutside textdestructive (declared)
Stop the LOCAL ComfyUI server that comfy-cli launched.

    Wraps ``comfy stop``. comfy-cli only kills the pid it recorded when IT
    launched the server (via ``launch_comfyui``) — it cannot stop a ComfyUI
    started by the desktop app or by hand, and raises :class:`ComfyCliError`
    naming "no recorded server" (no verdict on a configured remote) instead.

    Prints text with no JSON envelope; success returns a synthesized
    ``{"ok": True, ...}``.

    **One lifecycle call at a time** — shares ``_LIFECYCLE_LOCK`` with
    ``launch_comfyui``/``restart_comfyui``; refused immediately if one of those
    is in flight, rather than racing comfy-cli's single recorded pid.
switch_comfyui_versiontool Move the LOCAL ComfyUI install to a specific version — DESTRUCTIVE, asks first.destructive (declared)
Move the LOCAL ComfyUI install to a specific version — DESTRUCTIVE, asks first.

    Wraps ``comfy update comfy --version <version>``: stashes uncommitted
    changes, moves the checkout, reinstalls dependencies. Use to roll BACK —
    ``update_comfyui`` only moves forward.

    Args:
        version: ``"nightly"``, ``"latest"``, or a release tag with or
            without the leading ``v`` (``"0.24.0"``/``"v0.24.0"``); anything
            else is refused before any subprocess runs.

    **Canonical flow — this tool does not restart anything**::

        stop_comfyui -> switch_comfyui_version -> launch_comfyui -> server_info

    Gotchas:
    - REFUSES while a local ComfyUI is running — stop it first.
    - Consent is per call, from the USER: an MCP client prompts even with
      ``confirm_switch=True``; that flag is the no-prompt fallback — set it
      ONLY when the user has actually agreed.
    - Shares ``update_comfyui``'s lock — refused if either is already running.

    Returns ``{"switched_to", "result", "restart_required": True}`` — always
    True.
system_statstool Read the live local ComfyUI's VRAM per device and system RAM.ProcessesFilesEnv varsoutside textread-only (declared)
Read the live local ComfyUI's VRAM per device and system RAM.

    Wraps ``comfy system-stats`` (ComfyUI's own ``GET /system_stats``).
    Forwarded near-verbatim: a ``devices`` list (per-device
    ``vram_free``/``vram_total`` bytes) plus a ``system`` dict
    (``ram_free``/``ram_total``, but also ``argv`` — ComfyUI's full launch
    command line, secrets and all, if any were passed on it).

    Call BEFORE a heavy run: if ``vram_free`` is short, call ``free_memory``
    and re-check. Read-only, safe to poll. Requires a running ComfyUI —
    raises ``server_not_running`` otherwise.

    NOT diverted by ``COMFYUI_URL``/``COMFYUI_HOST`` like the run/job tools —
    describes whichever ComfyUI comfy-cli itself targets. When one is set, a
    ``comfy_target_note`` names it; settle whether that host is THIS machine
    (routing rule at the top of this module) before gating a run on these
    numbers.
update_comfyuitool Update the LOCAL install — ComfyUI core, the custom node packs (asksdestructive (declared)
Update the LOCAL install — ComfyUI core, the custom node packs (asks
    first), or comfy-cli.

    Wraps ``comfy update <target>``.

    Args:
        target: ``"comfy"`` (default) updates ComfyUI core (``git pull`` +
            reinstall). ``"all"`` updates every installed custom node pack via
            the node manager — NOT core, and the only target that prompts.
            ``"cli"`` updates comfy-cli itself.
        confirm_update_all: only read for ``target="all"``. The user is always
            prompted by name on a client that supports MCP elicitation
            regardless of this flag. Set it True ONLY when the user has
            actually agreed — the fallback for a client that cannot be
            prompted, never a way to clear an error.

    Returns:
        A synthesized ``{"ok": True, "message": ...}`` (comfy-cli prints human
        text here, no JSON envelope).

    Gotchas:
        - For ``target="all"``, ``ok: True`` is NOT proof every pack updated —
          the node manager swallows a per-pack failure and still exits 0. Read
          ``message`` and re-check ``server_info``'s ``freshness.packs``.
        - Restart afterward: a running ComfyUI keeps the code it loaded at
          boot (``target="cli"`` needs no restart).
        - One update at a time: refused immediately while another update (or
          ``switch_comfyui_version``) is in flight.

Text the model reads (21)

Every tool, prompt and resource description as written in the code: the model sees all of it, the user usually does not.

server_info tool
Report the local ComfyUI/comfy-cli environment and verify compatibility.

    Wraps ``comfy env``. Call this first to confirm a local ComfyUI is up before
    running a workflow.

    Returns:
        ``running``/``url``/``workspace``/``python`` — the LOCAL comfy-cli
        install, always, even with a remote ComfyUI configured (see below).
        Plus:
        - ``hardware`` (GPU/VRAM/RAM), present only when the installed
          comfy-cli reports one — check for the key, then consult the routing
          guidance in the server instructions before starting local generation.
        - ``compatibility``: this server's own version/envelope compatibility
          check; raises before returning on a hard incompatibility.
        - ``freshness`` (from ``comfy outdated``): ``core``/``packs``
          staleness. If either is outdated, tell the user to update FIRST
          (``comfy update comfy`` for core, ``comfy node update <pack>`` for a
          pack) before concluding the catalog lacks something.
          ``{"unsupported": true}`` means this comfy-cli cannot answer —
          nothing is broken.
        - ``comfy_target`` (host/port), only when a remote ComfyUI is
          configured (``COMFYUI_URL``/``COMFYUI_HOST``) — the submit/poll
          tools follow it; this call never probes it.

        ``config.background``, when a background server is recorded, reports
        the pid comfy-cli verified is LISTENING on that port, with the pid it
        recorded (the launch wrapper, which does not hold the port) kept as
        ``recorded_pid``; ``pid_source``/``pid_note`` say which you got. Stop a
        server with ``stop_comfyui``, never by killing a reported pid.
auth_status tool
Comfy Cloud credential status for partner-API nodes (read-only; never returns secrets).

    Wraps ``comfy cloud whoami``. Call before running a workflow whose nodes hit
    partner APIs (Seedream / Veo / Kling / Gemini / …) to self-diagnose.

    Returns comfy-cli's whoami payload as-is (``signed_in``, ``auth_method``,
    ``api_key_source``, ``base_url``, plus ``expired``/``session``/
    ``stale_base_url`` when a session exists — ``session`` already redacted
    upstream) plus ``registration_env_key_present``.

    BLIND SPOT: a ``COMFY_API_KEY`` in the MCP client's registration env is NOT
    reflected in ``api_key_source`` — whoami inspects only the cloud-purpose key
    slot. ``registration_env_key_present`` (bool presence only, never the value)
    covers that path and is ALWAYS a TOP-LEVEL key in the returned mapping; on
    the rare non-dict whoami payload it is the raw payload, not the flag, that
    nests — under ``whoami``.
billing_status tool
Comfy Cloud credit balance, plan tier and job concurrency — READ-ONLY, spends nothing.

    Wraps ``comfy cloud status``. The tool for "how many credits do I have",
    "what plan am I on", "when does it renew" and "how many jobs can I run at
    once". It only READS billing state, so it raises no spend confirmation.

    Returns comfy-cli's payload as-is: ``cloud_workspace``
    {id,name,type,role}, ``credit_balance_usd``/``credit_balance_credits``/
    ``effective_balance_micros``, ``currency``, ``balance_confirmed``,
    ``subscription`` {tier,status,is_active,plan_slug,renewal_date,cancel_at},
    ``max_concurrent_jobs``, ``upgrade_suggestion``, ``manage_url`` and
    ``message``.

    ``balance_confirmed: false`` means the balance fields are ``null`` because
    none could be ESTABLISHED — never render that as $0. Relay ``message``
    verbatim when present; it is comfy-cli's own neutral copy for that case,
    not something to re-derive from the numbers.

    Signed out raises comfy-cli's own error — get the user signed in with
    ``auth_login`` / ``auth_status``. Below comfy-cli 1.17.0,
    degrades to ``{"error", "unsupported": True}`` carrying
    ``balance_confirmed: False`` and the balance fields ``null``, so the rule
    above holds there too.
auth_login tool
Start Comfy Cloud sign-in; returns an OAuth URL for the USER to open.

    Wraps ``comfy cloud login --no-browser``; sign-in continues in the
    background, so this call returns fast, not a ten-minute block. Give the
    user ``login_url``, let them finish in their browser, then confirm with
    ``auth_status`` — the authority on credentials; this tool only reports how
    the login process ended.

    Returns while pending: ``{"status": "awaiting_browser", "login_url": ...,
    "expires_in_s": ..., "next": ...}``. Calling again while pending returns
    the SAME URL (only one flow at a time). After it finishes, reports
    ``{"status": "completed"}`` or ``{"status": "failed", "error_code",
    "message"}`` once, then clears state. A child stuck past its deadline is
    reaped automatically rather than stranding the tool on a dead URL.

    Never returns secrets. Raises :class:`ComfyCliError` on failure before a
    URL, or if a comfy-cli too old emits none — fallback: manual
    ``comfy cloud login`` in a terminal.
run_workflow tool
Run a ComfyUI workflow JSON on the ComfyUI this server targets.

    That is this machine unless ``COMFYUI_URL``/``COMFYUI_HOST`` points the
    run/job tools at another one. Wraps ``comfy run --workflow <path>``;
    accepts an API-format or UI-export file. Give a hand-written API-format
    graph a ``_meta.title`` per node — a canvas label only, never execution.

    Args:
        wait: if True (default), block until the run finishes and return the
            full result. If False, submit and return with a ``prompt_id`` to
            poll via ``job(action="status")``.

            Progress notifications are EMITTED WHEN THE ENGINE REPORTS ANY —
            do not rely on them. comfy-cli 1.15.0's stream carries no
            per-step events for this verb, so in practice a run is silent
            until it finishes. Poll ``job(action="status")`` from a second
            call if you need progress.
        timeout_seconds: used only when ``wait=True``; default 110s sits under
            a typical client's ~120s budget. For a longer run, prefer
            ``wait=False`` + ``job(action="wait")``/``job(action="watch")``.
        confirm_spend: SOME workflows (partner-API nodes from
            ``emit_partner_workflow``, or an ``API``-tagged template) spend
            credits when run. Set True ONLY when the user has actually agreed
            to spend — never merely to clear an error. Free workflows are
            never gated by this.

    Gotchas:
        - Without consent, a paid workflow fails CLOSED
          (``spend_consent_required``, nothing spent) on a comfy-cli carrying
          the gate — the enforced floor; a source build past the fail-open
          floor check may lack it and still spend.
        - A workflow requesting a huge allocation can pass validation and then
          crash the whole ComfyUI process on OOM — surfaced as
          connection-loss/timeout, not a node error; ``get_logs`` still reads
          the log across the crash.
        - Partner-API nodes need a Comfy credential (``COMFY_API_KEY``);
          transient failures retry automatically.
generate_image tool
Generate an image from a text prompt — the fast on-ramp.

    Runs the built-in text-to-image template via ``comfy run-template``
    (override with ``COMFY_T2I_TEMPLATE`` + matching slot envs) — same path/target
    as ``run_workflow``: this machine unless ``COMFYUI_URL``/``COMFYUI_HOST``
    says otherwise; never Cloud.

    Args:
        checkpoint: swaps the checkpoint model; must already be installed on
            the machine that RUNS the job. Omit for the template's default.
        wait: True (default) blocks up to ``timeout_seconds``, streaming
            progress; False submits and returns a ``prompt_id`` at once —
            prefer False on slow hardware.
        timeout_seconds: bounds this wait when ``wait=True``. Default 60s:
            your client's own transport cap (seen in the wild at 120-300s) is
            invisible here and the shorter wins, so it is the real ceiling.

    Returns: ``run_workflow``'s shape (``prompt_id`` + outputs) when the run
    finishes in time. An expired wait is NOT a failure: it returns
    ``{"timed_out": True, "prompt_id", "status", "note"}`` for a job still
    RUNNING — poll ``job(action="status")``, collect ``fetch_outputs``, cancel
    ``job(action="cancel")``. That holds for the engine's own per-event deadline
    as much as this wait's, so no expiry drops the handle.

    Gotchas:
    - Always FREE, a local OSS graph — use ``partner_generate`` for paid
      PARTNER models.
    - For a chosen template or hand-authored workflow, use
      ``search_templates`` -> ``fetch_template`` -> ``run_workflow``.
list_partner_models tool
List the hosted PARTNER models ``partner_generate`` can run.

    Wraps ``comfy generate list`` — the ONLY source of the partner alias
    catalog (``nodes``/``search_templates`` read the local install).

    Args:
        style/partner/query: filters forwarded to comfy-cli, exact/substring;
            an unfiltered call shows the real ``category`` strings.
        limit/offset: default 100, capped at 200; page while ``shown`` <
            ``total``.

    Returns:
        ``{"total", "shown", "offset", "filters", "models"}``; each model
        ``{alias, id, partner, category, mode, summary}``. Follow with
        ``partner_model_schema`` for parameters.

    Freshness: PINNED — a curated allowlist in the INSTALLED comfy-cli's code.
    Absence here is NOT evidence it does not exist — do not tell the user the
    model does not exist; the fix is a comfy-cli UPGRADE, not ``comfy generate
    refresh`` (the allowlist is code). One row can stand for a whole model
    FAMILY — read ``partner_model_schema`` before committing to a variant.
partner_model_schema tool
Show one partner model's callable parameters — the input to ``partner_generate``.

    Wraps ``comfy generate schema <model>``. ``model`` is an alias from
    ``list_partner_models``. Reads the spec only — no partner API call, no spend.

    Returns: ``{model, id, partner, category, summary, mode, polling,
    content_type, params, example}``. ``params`` rows carry ``name``, ``type``
    (``binary`` = local file path), ``required``, ``default``, ``enum``,
    ``description``. ``example`` is a CLI invocation to translate into
    ``params={...}``.

    Freshness: PINNED — params/enums come from the spec vendored into the
    INSTALLED comfy-cli wheel; refresh via ``comfy generate refresh``. Still the
    finest-grained view of a partner's variants (an enum here typically
    enumerates what ``list_partner_models`` collapses into one row): on a miss,
    say the installed comfy-cli doesn't list it, don't claim it doesn't exist —
    and do NOT quietly substitute a neighbor (``lite`` for ``pro`` is a
    downgrade the user never agreed to).
partner_generate tool
Run a hosted PARTNER model (Flux / Ideogram / DALL·E / Recraft / …) — SPENDS CREDITS.

    Wraps ``comfy generate <model> [--param=value]…``. Runs entirely on the
    PARTNER's infrastructure — the user's local ComfyUI never executes anything.
    For local execution, use ``emit_partner_workflow`` -> ``run_workflow`` ->
    ``fetch_outputs`` instead (covers only the models comfy-cli can render as a
    node).

    Args:
        params: the model's own inputs (``prompt``, ``aspect_ratio``, ``seed``,
            …), forwarded verbatim. Discover them with ``list_partner_models()``
            and ``partner_model_schema(model)`` — not ``nodes`` /
            ``search_templates``, which answer a local-install question.
        confirm_spend: this call ALWAYS spends credits. Set True ONLY when the
            user has actually agreed to spend on this call — never merely to
            clear an error. A client that supports MCP elicitation prompts the
            user anyway, so this is the fallback for one that cannot. A durable
            ``comfy generate consent always`` in comfy-cli's own config skips
            the prompt — the engine consenting to itself, not this server.
        out_path: forwards ``--download <path>``; a save-path TEMPLATE, not a
            filename — ``{request_id}``/``{index}``/``{ext}`` are substituted,
            and a trailing slash means "default filename in this directory".

    Gotchas:
        - With no consent source available, comfy-cli fails CLOSED — nothing
          is spent.
        - Saved paths come back as ``saved_paths``, verbatim from what
          comfy-cli printed.
emit_partner_workflow tool
Write a runnable workflow that drives a partner model's NODE on LOCAL ComfyUI.

    Wraps ``comfy generate <model> --emit-workflow <out_path>``. Writes an
    API-format graph containing the partner's API node and returns — calls no
    partner API, spends nothing. Chain::

        emit_partner_workflow("flux-pro", "/tmp/flux.json", {"prompt": "a red fox"})
        run_workflow("/tmp/flux.json", confirm_spend=True)   # the node bills HERE
        fetch_outputs(prompt_id)

    Args:
        model: only FIVE aliases map to a node — ``flux-2``, ``flux-pro``,
            ``kling-i2v``, ``nano-banana``, ``seedance``. Everything else
            raises; route to ``partner_generate`` instead (narrow coverage,
            not "unsupported").
        params: the model's own inputs, same validation as ``partner_generate``;
            optional even where the proxy requires them (defaults fillable
            later via ``set_workflow_slot``).
        out_path: the workflow JSON to write. comfy-cli OVERWRITES it in place
            with no existence check — name a fresh file.

    Returns:
        comfy-cli's own ``{"out": ..., "model": ..., "nodes": ...}``.

    Gotchas:
        - No ``confirm_spend`` here: this call never spends. RUNNING the
          emitted graph is what bills — pass ``confirm_spend=True`` to that
          ``run_workflow`` call, and do not read its absence as protection: a
          comfy-cli lacking the spend gate runs and bills silently regardless.
run_template tool
Run a gallery template — fetch, fill params, execute.

    Wraps ``comfy run-template <name> [--param=KEY=VALUE]…`` (fetches the
    graph, fills its slots, runs via the same path as ``run_workflow``) — the
    one-command alternative to ``search_templates`` -> ``fetch_template`` ->
    ``run_workflow``.

    Args:
        params: ``{slot: value}``, slot an address (``"6.text"``) or unique
            name (``"prompt"``); list slots by fetching the template first.
            Subgraph interior slots use ``A/B.name`` addressing.
        confirm_spend: SOME templates embed partner-API (paid) nodes and spend
            the signed-in account's Comfy credits when run. Set True ONLY when
            the user has actually agreed — never merely to clear an error.
            Free templates are never gated by this.
        wait: if True (default), block and stream progress, returning the full
            result. If False, submit ``--async`` and return a ``prompt_id`` to
            poll — preferred for long (video) runs.
        timeout_seconds: bounds this call's wall clock (default 600s).

    Gotchas:
        - Without consent, a paid template fails CLOSED
          (``spend_consent_required``, nothing spent); free templates run.
        - A missing referenced model surfaces as a per-node error.
job tool
Inspect, wait on, watch, or cancel a submitted job — one action per call.

    Wraps the `comfy jobs` family. `action`:
    - "status" (default) -> `comfy jobs status <prompt_id>`: status + outputs.
    - "error" -> same call, normalized: `error_code` (comfy-cli's own code, e.g.
      "server_died" for a crash mid-run, such as an OOM kill — check `get_logs`
      before relaunching; `None` on an ordinary node failure),
      `exception_type`/`exception_message`, `node_id`/`node_type`, a capped
      `traceback_tail`. `error: None` when healthy — safe to call speculatively.
    - "wait" -> poll until terminal (default 25.0s, ceiling 3600s); returns the
      final payload, or `{"timed_out": True, "status": <last>}` on expiry — a
      TIMEOUT, not a failure.
    - "watch" -> relay progress while waiting (default 600.0s, same ceiling);
      needs comfy-cli >= 1.16.0. Expiry: `{timed_out, events_seen, status:
      {progress, total, nodes_done, events_seen}}`; `events_seen: 0` adds
      `job` + `hint`.
    - "cancel" -> stop a queued/running job.
    - "queue" -> list known jobs (Comfy Cloud-tracked rows filtered out).

    `prompt_id` is required for every action but "queue"; `timeout_seconds` only
    for "wait"/"watch" — either where unused is rejected.
system_stats tool
Read the live local ComfyUI's VRAM per device and system RAM.

    Wraps ``comfy system-stats`` (ComfyUI's own ``GET /system_stats``).
    Forwarded near-verbatim: a ``devices`` list (per-device
    ``vram_free``/``vram_total`` bytes) plus a ``system`` dict
    (``ram_free``/``ram_total``, but also ``argv`` — ComfyUI's full launch
    command line, secrets and all, if any were passed on it).

    Call BEFORE a heavy run: if ``vram_free`` is short, call ``free_memory``
    and re-check. Read-only, safe to poll. Requires a running ComfyUI —
    raises ``server_not_running`` otherwise.

    NOT diverted by ``COMFYUI_URL``/``COMFYUI_HOST`` like the run/job tools —
    describes whichever ComfyUI comfy-cli itself targets. When one is set, a
    ``comfy_target_note`` names it; settle whether that host is THIS machine
    (routing rule at the top of this module) before gating a run on these
    numbers.
free_memory tool
Ask the local ComfyUI to unload models / reset its executor cache.

    Wraps ``comfy free`` (ComfyUI's own ``POST /free``). Pair with
    ``system_stats`` for the before/after.

    Args:
        unload_models: True (default) unloads all models from VRAM.
            ``unload_models=False`` with ``free_memory`` left default
            requests NOTHING — a deliberate no-op, not "reset cache, keep
            models".
        free_memory: also resets the executor cache; ``None`` (default)
            follows ``unload_models``, so a bare call asks for both.
            ``True`` with ``unload_models=False`` is rejected: ComfyUI
            cannot reset the cache without unloading everything.

    NOT IMMEDIATE, never destructive: applied when the queue worker next
    iterates — does **not** interrupt a running job, so this cannot stop one
    (``job(action="cancel")`` does). Returns what was REQUESTED, not a measurement —
    re-check ``system_stats``. NOT diverted by ``COMFYUI_URL``/``COMFYUI_HOST``
    — same ``comfy_target_note`` behavior as ``system_stats``.
fetch_outputs tool
Download a completed job's output files into ``out_dir``.

    Wraps ``comfy download <prompt_id> --where local [-o <out_dir>]``.
    ``url_only=True`` emits URLs without downloading.

    Omit ``out_dir`` and comfy-cli picks it: the project's ``outputs/``, its
    configured default, or ``./outputs``; the returned ``out_dir`` names where
    it wrote.

    Remote jobs work although ``download`` is not in
    ``_TARGET_AWARE_SUBCOMMANDS``: the submitting run's local state file maps
    ``prompt_id`` to output URLs. An unknown local id has no record.

    ``inline_images=True`` adds bounded MCP media (images, small audio) plus a
    ``structuredContent`` manifest of every output's path/type/size; video and
    over-cap files are path-only records (``preview_media`` renders a video).
preview_media tool
Render local media as a PNG through ``comfy preview``.

    comfy-cli owns classification and creates a thumbnail, video contact sheet,
    or audio waveform. ``inline_image=True`` appends the bounded PNG to its
    metadata; false returns metadata only. Relative paths follow
    ``COMFY_PROJECT``.
launch_comfyui tool
Start the LOCAL ComfyUI server, detached, and return once it is up.

    Wraps ``comfy launch --background``, recording its pid so ``stop_comfyui``
    can shut it down. ``extra_args`` forward to ComfyUI after a ``--``
    separator. Call ``server_info`` first — a second launch fails on the port.

    **Network-exposing flags need the USER's confirmation.** ComfyUI has no
    auth, so a non-loopback ``--listen`` (bare included) or
    ``--enable-cors-header`` publishes its full API to anything that can
    reach this machine. Those flags raise an MCP elicitation; a decline
    starts nothing, even with ``confirm_network_exposure=True``. On a client
    that cannot prompt, that flag is the fallback — set it ONLY when the
    user has actually agreed. ``--listen 127.0.0.1``/``::1``/``localhost``
    needs no confirmation.

    Prints text with no JSON envelope; success returns a synthesized
    ``{"ok": True, ...}``. When the installed comfy-cli DOES report a pid, it
    is the one verified to be listening on the port, not the launch wrapper
    comfy-cli records (kept as ``recorded_pid``); ``pid_source``/``pid_note``
    say which you got. Stop the server with ``stop_comfyui``, never by killing
    a reported pid.

    **LOCAL-ONLY.** With ``COMFYUI_URL``/``COMFYUI_HOST`` set this cannot touch
    that remote, so it launches nothing and returns a refusal with ``ok`` and
    ``launched`` both ``False`` (and ``reason: remote_target_configured``, plus
    ``remote_target``); test ``launched is False`` — a success omits it, a
    failure raises. A malformed value raises. Unset those to launch locally.
stop_comfyui tool
Stop the LOCAL ComfyUI server that comfy-cli launched.

    Wraps ``comfy stop``. comfy-cli only kills the pid it recorded when IT
    launched the server (via ``launch_comfyui``) — it cannot stop a ComfyUI
    started by the desktop app or by hand, and raises :class:`ComfyCliError`
    naming "no recorded server" (no verdict on a configured remote) instead.

    Prints text with no JSON envelope; success returns a synthesized
    ``{"ok": True, ...}``.

    **One lifecycle call at a time** — shares ``_LIFECYCLE_LOCK`` with
    ``launch_comfyui``/``restart_comfyui``; refused immediately if one of those
    is in flight, rather than racing comfy-cli's single recorded pid.
restart_comfyui tool
Restart the LOCAL ComfyUI server: stop the running one, then launch a fresh one.

    Composes ``stop_comfyui`` + ``launch_comfyui`` (no ``comfy restart`` verb);
    ``extra_args`` forward to the new server. Returns the new server's status.

    **LOCAL-ONLY: RAISES if ``COMFYUI_URL``/``COMFYUI_HOST`` names a remote**
    (``comfy stop``/``launch`` take no ``--host``/``--port``); restart a remote
    on its own host.

    Carries ``launch_comfyui``'s **network-exposure confirmation** unchanged
    (non-loopback ``--listen``/``--enable-cors-header`` asks the USER, BEFORE
    the stop so a decline leaves the server alone); ``confirm_network_exposure``
    is the no-prompt fallback.

    The stop is swallowed only for "nothing to stop"; other stop failures
    raise. If the freed port is then held by a server comfy-cli didn't start,
    this identifies it and asks the USER to recycle it — gated the same way,
    via ``confirm_kill_untracked`` (default False kills nothing); a decline
    reproduces the port error.

    **One lifecycle call at a time** — a concurrent launch/stop/restart is
    refused immediately rather than racing comfy-cli's one recorded server.
update_comfyui tool
Update the LOCAL install — ComfyUI core, the custom node packs (asks
    first), or comfy-cli.

    Wraps ``comfy update <target>``.

    Args:
        target: ``"comfy"`` (default) updates ComfyUI core (``git pull`` +
            reinstall). ``"all"`` updates every installed custom node pack via
            the node manager — NOT core, and the only target that prompts.
            ``"cli"`` updates comfy-cli itself.
        confirm_update_all: only read for ``target="all"``. The user is always
            prompted by name on a client that supports MCP elicitation
            regardless of this flag. Set it True ONLY when the user has
            actually agreed — the fallback for a client that cannot be
            prompted, never a way to clear an error.

    Returns:
        A synthesized ``{"ok": True, "message": ...}`` (comfy-cli prints human
        text here, no JSON envelope).

    Gotchas:
        - For ``target="all"``, ``ok: True`` is NOT proof every pack updated —
          the node manager swallows a per-pack failure and still exits 0. Read
          ``message`` and re-check ``server_info``'s ``freshness.packs``.
        - Restart afterward: a running ComfyUI keeps the code it loaded at
          boot (``target="cli"`` needs no restart).
        - One update at a time: refused immediately while another update (or
          ``switch_comfyui_version``) is in flight.
switch_comfyui_version tool
Move the LOCAL ComfyUI install to a specific version — DESTRUCTIVE, asks first.

    Wraps ``comfy update comfy --version <version>``: stashes uncommitted
    changes, moves the checkout, reinstalls dependencies. Use to roll BACK —
    ``update_comfyui`` only moves forward.

    Args:
        version: ``"nightly"``, ``"latest"``, or a release tag with or
            without the leading ``v`` (``"0.24.0"``/``"v0.24.0"``); anything
            else is refused before any subprocess runs.

    **Canonical flow — this tool does not restart anything**::

        stop_comfyui -> switch_comfyui_version -> launch_comfyui -> server_info

    Gotchas:
    - REFUSES while a local ComfyUI is running — stop it first.
    - Consent is per call, from the USER: an MCP client prompts even with
      ``confirm_switch=True``; that flag is the no-prompt fallback — set it
      ONLY when the user has actually agreed.
    - Shares ``update_comfyui``'s lock — refused if either is already running.

    Returns ``{"switched_to", "result", "restart_required": True}`` — always
    True.

What we checked

The same checks run on every server. Each line below has one of these marks:

FoundA published issue such as a risky tool or a CVE
PassedWe ran the check on this server and found nothing
After reviewChecked; we publish it once a person verifies it
Partly tracedRan, but the scanner could not follow every path to its end
FactWhat the code does, not a judgement either way
Not checkedThe scanner had nothing to read for it, or it needs the live server
Code Safetypartly traced
  • 8 checks: command injection, argument injection, path traversal, server-side request forgery, SQL injection, code execution, unsafe deserialization, template injection
    Checked on every scan. Results in this category are published only after a person has verified them.
Capability Exposure6.1
  • Runs programs the caller chooses
    No tool runs a command or program the caller supplies — 21 tool handlers traced. Not every path could be followed, so this is not a clean pass.
  • Executes caller-supplied code
    No tool evaluates code the caller supplies — 21 tool handlers traced. Not every path could be followed, so this is not a clean pass.
  • Reads or writes any file path
    No tool works on a file path the caller supplies without a root check — 21 tool handlers traced. Not every path could be followed, so this is not a clean pass.
  • Requests any address
    No tool sends a request to an address the caller supplies — 21 tool handlers traced. Not every path could be followed, so this is not a clean pass.
  • Runs caller-supplied SQL
    No tool executes a query the caller supplies — 21 tool handlers traced. Not every path could be followed, so this is not a clean pass.
  • Tools that start processes
    10 of 21 capabilities start processes; 11 more call code the scanner could not follow, where it may happen
  • Tools that touch files
    10 of 21 capabilities touch files; 11 more call code the scanner could not follow, where it may happen
  • Tools that call the network
    Not seen in the traced code of 21 capabilities; 21 more call code the scanner could not follow, where it may happen
Where the code is: 21 handlers in 1 file at commit 105dca212a90
Prompt Integrity10.0
  • 5 checks: tool poisoning, instruction override, hidden content, exfiltration requests, metadata integrity
    Checked on every scan. Results in this category are published only after a person has verified them.
Supply Chainnot checked
  • Dependency manifests
    1 manifest: pyproject.toml
  • Lockfiles checked against OSV
    Nothing could be resolved to exact versions; 1 not resolved: pyproject.toml: dependency ranges declared here were not resolved against a lockfile and were not checked
  • MCP SDK version
    No MCP SDK declared in a manifest
Secrets & Credentials10.0
  • 3 checks: credential harvesting, undeclared credential access, credentials sent over the network
    Checked on every scan. Results in this category are published only after a person has verified them.
  • Tools that read credentials
    1 of 21 capabilities read credentials; 20 more call code the scanner could not follow, where it may happen
  • Environment variables
    17 capabilities read environment variables (often API keys)
  • Authentication declared
    Not checked: needs the live server's tools/list (a remote server declares how clients authenticate)
Behavior Transparency10.0
  • 3 checks: undeclared network access, undeclared file access, undeclared process execution
    Checked on every scan. Results in this category are published only after a person has verified them.
  • Tool descriptions present
    Every tool has a description the model and the user can read
  • Statically known names
    Every tool's name could be read from the code
  • Input schemas
    Not checked: needs the live server's tools/list (every tool declares an input schema)
  • Destructive tools annotated
    Not checked: needs the live server's tools/list (tools that write, delete or run commands carry destructivehint)

Dependencies with known vulnerabilities (0 in production)

Dependency ranges were not resolved against a lockfile, so the score is capped at 7.

No known vulnerabilities in the production dependencies that could be checked.

Past security advisories

Vulnerabilities published for this server itself, from the GitHub Advisory Database.

No security advisories have been published for this server in the GitHub Advisory Database.

How it runs

Where it runsOn your machine, started by your MCP client from this repository or its package
Transportnot stated in the code the scanner read; most local servers talk over stdio
Sign-innot checked needs the live server
Servers in the code1 (comfy-mcp)

The project's own security

Security policyyes SECURITY.md
Private reportingthe policy does not name a private channel
Past advisoriesnone in the GitHub Advisory Database
Last push2026-11-14
Signed releasesnot checked yet

Where it is published

Listed in1 catalog (github_search)
LicenseNOASSERTION
Created2026-07-01
Topicsai-agents comfy-cli comfyui mcp model-context-protocol

Attack map

How the server is built and where its risky tools lead: servers, their tools, what the tools' code can do, and the traced route from a declared risky tool's argument to the operation it reaches. Click a node for details.

Request a scan or an audit

Tell us about your server. We reply within 5 working days.

What do you need? *

We use these details only to answer you.