comfyui-local-mcp
comfyui-local-mcp
ローカル ComfyUI を MCP クライアント(Hermes、Claude Code、Cursor、任意の MCP エージェント)から操作できるようにします — Apple Silicon(MLX + MPS) 向けに調整済みの FLUX.2 Klein テキスト→画像ワークフローが同梱されています。
ビルド・テスト環境:Mac mini M4 · 24GB ユニファイドメモリ · macOS 26 · ComfyUI 0.33 · mflux 0.19
機能
🖼️ generate_image — モデルを自動検出してテキストから画像を生成:
mflux:<name>— FLUX.2 Klein 4B / 9B、4 ビット MLX(高速、低メモリ)bf16— ComfyUI ネイティブ bf16(MPS、最高品質)auto— 最適なモデルを自動選択(9B 優先)
📦 list_models — インストール済みモデルを一覧表示(
models/mflux/を自動スキャン、コード変更なしでモデル追加可能)🗂️ list_outputs — 最近生成された画像の一覧
🩺 system_status — ワンコール診断(ComfyUI サービス、モデル、ディスク)
Related MCP server: comfyui-mcp
クイックスタート
# 1. Install the server files into your ComfyUI + register the hermes MCP
./install.sh # optional; also fine to just copy files
# 2. Register the MCP server manually (or via install.sh) — e.g. in ~/.hermes/config.yaml:
# mcp_servers:
# comfyui-local:
# command: /path/to/python-with-mcp
# args: [/path/to/comfyui-local-mcp/mcp_comfyui_server.py]
# enabled: true
# 3. Test the server (stdio MCP handshake)
python mcp_comfyui_server.py
# 4. Ask your agent: "generate an image of ..." or "check my ComfyUI status"必要条件
Apple Silicon(MLX / Metal)搭載の macOS
ローカルで動作している ComfyUI(デフォルト
127.0.0.1:8188)mcpパッケージを含む Python 環境(サーバー自体は stdlib +mcpのみが必要)オプション:MLX パス用の mflux +
ComfyUI-mflux-AnyModelカスタムノードオプション:bf16 パス用の FLUX.2 Klein bf16 重み + Qwen3-4B テキストエンコーダー
モデルセットアップ(Apple Silicon、24GB 対応)
モデル | パス( | 備考 |
FLUX.2 Klein 4B · 4bit MLX |
| ~4.3GB、~12.7秒/ステップ @1024² |
FLUX.2 Klein 9B · 4bit MLX |
| ~9.5GB、より高品質 |
FLUX.2 Klein 4B bf16 |
| MPS パス、最高品質 |
Qwen3-4B テキストエンコーダー |
| bf16 パスに必要 |
FLUX.2 VAE |
|
mflux MLX モデルは HF キャッシュを使用してダウンロードし、models/mflux/ にシンボリックリンクを張ってください
(HF キャッシュ / シンボリックリンク を参照)— サーバーが自動検出します。
Apple Silicon に関する注意事項
fp8 重みは MPS では動作しません — 最初に bf16 に変換してください(CPU サイドでの逆量子化)。
flux-2-klein-4b-bf16.safetensorsは公式 fp8 チェックポイントを bf16 に変換したものです。一部のネットワークでは HF ダウンロードが停止することがあります —
export HF_HUB_DISABLE_XET=1で修正できます。パフォーマンス(M4 10コアGPU、1024×1024):4B-4bit ~12.7秒/ステップ(ピーク ~11GB)、bf16 ~12.1秒/ステップ(ピーク ~15GB)。
HF キャッシュとシンボリックリンク
HuggingFace の snapshot_download は実際のデータを ~/.cache/huggingface/hub/models--<org>--<name>/blobs/ に保存し、
snapshots/<rev>/ 以下にシンボリックリンクを公開します。このプロジェクトでは models/mflux/<Model-Name>/ に
シンボリックリンクを保持し、それらのスナップショットを指すようにします — ディスク使用量の重複はゼロで、
list_models が自動的に認識します。
トラブルシューティング
./check_system.sh # one-shot diagnosis
tail -50 ~/comfyui_run.logComfyUI が応答しない?
127.0.0.1:8188で動作していることを確認し、まず古いインスタンスを強制終了してください。list_modelsにモデルが表示されない?models/mflux/にtransformer/サブディレクトリを含む形でシンボリックリンク(またはコピー)を配置してください。エージェントに MCP が表示されない?
config.yamlを編集した後、エージェントセッションを再起動してください。
ライセンス
MIT
This server cannot be deployed
Maintenance
Related MCP Connectors
MCP server for Flux AI image generation
Remote MCP for RunComfy: ComfyUI deployments, hosted models, LoRA training. 31 tools.
Official FLUX MCP server. Generate, edit, vary, and browse images from Black Forest Labs.
Generate images, video, audio and short films with 140+ AI models from any MCP client.
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 connect to and interact with ComfyUI for workflow execution and image generation.Apache 2.0
- AlicenseNot gradedqualityBmaintenanceEnables MCP clients to generate and edit images using local Stable Diffusion models in ComfyUI, with tools for text-to-image, img2img, ControlNet, UI frames, upscaling, and background removal—no cloud API or API key required.MIT