comfyui-local-mcp
comfyui-local-mcp
从 MCP 客户端(Hermes、Claude Code、Cursor 以及任何 MCP 代理)驱动您的本地 ComfyUI——配备专为 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-bit 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 |
|
使用 HF 缓存下载 mflux MLX 模型,并将其符号链接到 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 installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Alicense-qualityDmaintenanceEnables 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
- AlicenseAqualityCmaintenanceMCP server for ComfyUI — text-to-image, variations, img2img refine, upscale, image proxy, and workflow runner.15731MIT
- Flicense-qualityCmaintenanceProvides multi-model AI image generation via MCP tools, supporting Seedream, SDXL, and FLUX models with GPU acceleration.
- AlicenseAqualityDmaintenanceMCP server for Krea.ai enabling AI image and video generation using models like Flux, Hailuo, Runway, Kling, and others via natural language prompts.9208Apache 2.0
Related MCP Connectors
MCP server for Flux AI image generation
MCP server for Hailuo (MiniMax) AI video generation
MCP server for Producer/Riffusion AI music generation
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/aiden-yanzy/comfyui-local-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server