ComfyUI MCP Server
ComfyUI MCP サーバー
1. 概要
ComfyUI を MCP と統合するためのサーバー実装。
⚠️ 重要: このサーバーでは、実行中の ComfyUI サーバーが必要です。
独自のComfyUIサーバーをホストするか、
または、既存の ComfyUI サーバー アドレスにアクセスできる必要があります。
Related MCP server: ComfyUI MCP
2. デバッグ
2.1 ComfyUI デバッグ
python src/test_comfyui.py2.2 MCPデバッグ
mcp dev src/server.py3. インストールと設定
3.1 ComfyUI の設定
src/.envを編集して、ComfyUI のホストとポートを設定します。COMFYUI_HOST=localhost COMFYUI_PORT=8188
3.2 カスタムワークフローの追加
新しいツールを追加するには、ワークフロー JSON ファイルを
workflowsディレクトリに配置し、システム内で新しいツールとして宣言します。
4. 組み込みツール
テキストを画像に変換する
生成された画像の URL のみを返します。
実際の画像を取得するには:
download_imageツールを使用するか、ブラウザで直接 URL にアクセスします。
ダウンロード画像
画像 URL を使用して、他のツール (
text_to_imageなど) によって生成された画像をダウンロードします。
ファイルを使ったワークフローの実行
ワークフロー JSON ファイルへのパスを指定してワークフローを実行します。
# You should ask to agent like this. Run comfyui workflow with text_to_image.jsonCursorAIの例画像

json を使用したワークフローの実行
ワークフロー JSON データを直接提供してワークフローを実行します。
# You should ask to agent like this. Run comfyui workflow with this { "3": { "inputs": { "seed": 156680208700286, "steps": 20, ... (workflow JSON example) }
5. 実行方法
5.1 UVの使用(推奨)
mcp.json例:{ "mcpServers": { "comfyui": { "command": "uv", "args": [ "--directory", "PATH/MCP/comfyui", "run", "--with", "mcp", "--with", "websocket-client", "--with", "python-dotenv", "mcp", "run", "src/server.py:mcp" ] } } }
5.2 Dockerの使用
Docker コンテナはホスト ファイル システムを共有しないため、
download_imageを使用してイメージをローカル フォルダーにダウンロードするのは難しい場合があります。Docker を使用する場合は、次の点を考慮してください。
画像データをバイトとして受信するには、
.envでRETURN_URL=false設定します。.envのCOMFYUI_HOST適切なアドレス (例:host.docker.internalまたはサーバーの IP) に設定します。注意: バイナリ データを使用する場合、大きな画像ペイロードは応答制限を超える可能性があります。
5.2.1 Dockerイメージのビルド
# First build image
docker image build -t mcp/comfyui .{
"mcpServers": {
"comfyui": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-p",
"3001:3000",
"mcp/comfyui"
]
}
}
}5.2.2 既存の画像の使用
事前に構築されたイメージを使用することもできます。
{
"mcpServers": {
"comfyui": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-p",
"3001:3000",
"overseer66/mcp-comfyui"
]
}
}
}5.2.3 SSEトランスポートの使用
Docker で SSE サーバーを実行します。
docker run -i --rm -p 8001:8000 overseer66/mcp-comfyui-ssemcp.jsonを設定します (必要に応じて localhost を自分の IP またはドメインに変更します)。{ "mcpServers": { "comfyui": { "url": "http://localhost:8001/sse" } } }
注意: 新しいワークフローをツールとして追加する場合は、Docker イメージを再構築して再デプロイし、使用できるようにする必要があります。
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
- AlicenseNot gradedqualityCmaintenanceA lightweight MCP server that bridges AI agents with a local ComfyUI instance to generate and iteratively refine images, audio, and video through conversational tool calls.41MIT
- FlicenseNot gradedqualityBmaintenanceMCP server that connects local ComfyUI to AI agents, enabling natural language control of ComfyUI for creating workflows, generating images, and managing the queue.
- AlicenseAqualityDmaintenanceMCP server that provides image generation, captioning, and tagging via ComfyUI API, configurable for agent tools.43MIT
- AlicenseAqualityCmaintenanceMCP server that lets OpenCode (or any MCP-compatible AI coding tool) directly control ComfyUI for AI image generation.142MIT
Related MCP Connectors
MCP server for Flux AI image generation
Generate AI images, video, music, and sound effects, and upscale them, from any MCP client.
MCP server for NanoBanana AI image generation and editing
Appeared in Searches
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/Overseer66/comfyui-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server