feat: Codex plugin + marketplace manifests
Package the repo as a folder-installable Codex plugin (verified on codex-cli 0.142.3): - .agents/plugins/marketplace.json: marketplace 'comfyui-agents' listing the repo root itself as the plugin (source.path '.'), policy authentication ON_USE so the local no-auth HTTP server installs without an OAuth prompt. - .codex-plugin/plugin.json: plugin 'comfyui-agents', skills ./skills/, mcpServers ./.codex-plugin/mcp.json (string-file form, matching the real OpenAI connector plugins). - .codex-plugin/mcp.json: declares the 'comfy' HTTP MCP server at http://127.0.0.1:9188/mcp via {type: http}; Codex registers it as a streamable_http transport. - skills/comfyui-bridge/SKILL.md: concise skill teaching the named-channel model, the five tools, and the core push/run/pull loop. Verified: codex plugin marketplace add . -> codex plugin add comfyui-agents@comfyui-agents -> codex mcp get comfy reports the URL. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
28dfd22c16
commit
554a1365a8
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"name": "comfyui-agents",
|
||||
"interface": {
|
||||
"displayName": "ComfyUI Agents"
|
||||
},
|
||||
"plugins": [
|
||||
{
|
||||
"name": "comfyui-agents",
|
||||
"source": {
|
||||
"source": "local",
|
||||
"path": "."
|
||||
},
|
||||
"policy": {
|
||||
"installation": "AVAILABLE",
|
||||
"authentication": "ON_USE"
|
||||
},
|
||||
"category": "Developer Tools"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"mcpServers": {
|
||||
"comfy": {
|
||||
"type": "http",
|
||||
"url": "http://127.0.0.1:9188/mcp"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
{
|
||||
"name": "comfyui-agents",
|
||||
"version": "0.1.0",
|
||||
"description": "Bridge an external coding agent (Codex) to a running ComfyUI graph: exchange text and images on named channels and trigger workflow runs over MCP.",
|
||||
"author": {
|
||||
"name": "Ethan Fel",
|
||||
"email": "ethan.fel@ts-pc.fr"
|
||||
},
|
||||
"homepage": "https://github.com/ethanfel/ComfyUI-Nodes-Agents",
|
||||
"repository": "https://github.com/ethanfel/ComfyUI-Nodes-Agents",
|
||||
"license": "MIT",
|
||||
"keywords": [
|
||||
"comfyui",
|
||||
"mcp",
|
||||
"agent",
|
||||
"image-generation",
|
||||
"bridge"
|
||||
],
|
||||
"skills": "./skills/",
|
||||
"mcpServers": "./.codex-plugin/mcp.json",
|
||||
"interface": {
|
||||
"displayName": "ComfyUI Agent Bridge",
|
||||
"shortDescription": "Exchange text/images with a running ComfyUI graph and trigger runs over MCP",
|
||||
"longDescription": "Connects Codex to the ComfyUI-Nodes-Agents in-process MCP server (HTTP, 127.0.0.1:9188/mcp). Pull images/text the graph emitted, push text/images back into the graph, list channels, and run saved workflows from the agent.",
|
||||
"developerName": "Ethan Fel",
|
||||
"category": "Developer Tools",
|
||||
"capabilities": [
|
||||
"Read",
|
||||
"Write"
|
||||
],
|
||||
"defaultPrompt": [
|
||||
"Pull the latest image from the ComfyUI graph and describe it.",
|
||||
"Push a prompt to ComfyUI and run the txt2img workflow."
|
||||
],
|
||||
"brandColor": "#1F6FEB"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
---
|
||||
name: comfyui-bridge
|
||||
description: Use when exchanging text or images with a running ComfyUI graph or triggering a ComfyUI workflow run from the agent. Trigger terms - ComfyUI, comfy_pull, comfy_push, comfy_run_workflow, named channel, inbox, outbox, render a prompt, edit the graph's image.
|
||||
license: MIT
|
||||
---
|
||||
|
||||
# ComfyUI Agent Bridge
|
||||
|
||||
Connects you to a running ComfyUI graph through the `comfy` MCP server
|
||||
(HTTP at `http://127.0.0.1:9188/mcp`). You exchange text and images with the
|
||||
graph on **named channels** and can trigger saved workflow runs.
|
||||
|
||||
ComfyUI must be running with the `ComfyUI-Nodes-Agents` custom node installed,
|
||||
or the tools below will fail to connect.
|
||||
|
||||
## Named-channel model
|
||||
|
||||
Each channel name (default `main`) has two directions:
|
||||
|
||||
- **inbox** = graph -> agent: an `Agent Emit` node writes the latest text/image;
|
||||
you read it with `comfy_pull`.
|
||||
- **outbox** = agent -> graph: you write with `comfy_push`; an `Agent Receive`
|
||||
node reads it. Each pushed value is **consumed once** (turn-based).
|
||||
|
||||
Use distinct channel names for distinct streams (e.g. `in`, `out`, `prompt`,
|
||||
`render`); two `Agent Receive` nodes on one channel compete for the same push.
|
||||
|
||||
## The five tools
|
||||
|
||||
- `comfy_pull(channel="main")` -> `{turn, text, image_path}`: read what the graph
|
||||
emitted on a channel.
|
||||
- `comfy_push(channel="main", text=None, image_path=None)`: send text/image to
|
||||
the graph's `Agent Receive` node on a channel.
|
||||
- `comfy_list_channels()`: list active channels and their turn counters.
|
||||
- `comfy_run_workflow(name, inputs=None, wait=True)`: load `workflows/<name>.json`
|
||||
(API-format export), optionally inject `inputs` keyed `"<node_id>.<field>"`
|
||||
(e.g. `{"6.text": "a red fox"}`), queue it, and (with `wait=True`) poll until
|
||||
outputs appear.
|
||||
- `comfy_get_result(prompt_id)`: fetch produced images/outputs for a queued
|
||||
prompt id.
|
||||
|
||||
Images cross by file path: `comfy_pull` returns an `image_path` you can read;
|
||||
pass a local PNG path to `comfy_push(image_path=...)`.
|
||||
|
||||
## The core loop
|
||||
|
||||
1. `comfy_push(channel, text=..., image_path=...)` — stage inputs for the graph.
|
||||
2. `comfy_run_workflow(name, wait=True)` — trigger the run and wait for outputs.
|
||||
3. `comfy_pull(channel)` — read the text/image the graph emitted back.
|
||||
|
||||
Full render round-trip: with a workflow whose `Agent Receive(channel=prompt)`
|
||||
feeds the prompt and whose output goes to `Agent Emit(channel=render)`:
|
||||
`comfy_push("prompt", "a red fox")` -> `comfy_run_workflow("txt2img", wait=True)`
|
||||
-> `comfy_pull("render")`.
|
||||
Reference in New Issue
Block a user