Agent Bus for ChatGPT and Codex — v0
An MCP adapter that lets a conversation delegate to local Codex and Claude
workers and collect their results. It wraps agent-dispatch; it does not change
the dispatcher or the Claude Code mod in ../plugin/.
Seven tools: bus_info, list_tasks, submit_task, get_task, wait_for_task,
read_task_output, and cancel_task. All return structured content and declare
their read/write behavior. There is no dashboard or autonomous chat wakeup in v0.
Install locally
Requirements: an installed agent bus, uv, and a logged-in worker CLI. Python
3.12 is provisioned by uv. No inference API key is used by this adapter.
./install.sh
plugin.json, mcp.json, and skills/ form the portable plugin package. The
bundled stdio command requires agent-bus-mcp to be installed on the host first.
Installing the plugin in a cloud interface does not install the local bus.
For a local MCP client, configure:
{
"mcpServers": {
"agent-bus": { "command": "agent-bus-mcp", "args": [] }
}
}
If the client has a restricted PATH, use the absolute executable path printed
by command -v agent-bus-mcp. Codex CLI supports:
codex mcp add agent-bus -- agent-bus-mcp
This command is provided for setup; building v0 does not edit your Codex config.
Connect regular ChatGPT
Use ChatGPT web Developer mode with a private Secure MCP Tunnel. ChatGPT
cannot connect directly to this machine's localhost. The local HTTP server
is intentionally unauthenticated and loopback-only; do not expose it with a
public forwarding tunnel. Host/Origin checks are not user authentication.
-
Create an OpenAI tunnel in Platform tunnel settings, associated with your personal Platform organization and the ChatGPT workspace you will use.
-
Install the official
tunnel-clientbinary from the download link there. Its control-plane runtime API key is separate from model inference and is required by OpenAI's tunnel transport. -
Start the adapter:
agent-bus-mcp --transport streamable-httpIt listens at
http://127.0.0.1:8766/mcponly. Configure a tunnel-client HTTP profile with--mcp-server-url http://127.0.0.1:8766/mcp; usetunnel-client help quickstartfor the current profile options. Keep runtime keys in a private file or secret manager, never in plugin files. Runtunnel-client doctor --profile <profile> --explain, thentunnel-client run --profile <profile>. -
In ChatGPT Settings → Security and login, enable Developer mode. In Plugins → plus, choose Tunnel and select that tunnel. Name it Agent Bus. Enable it from the composer in a new Chat conversation.
-
Ask: “Use Agent Bus to show available workers and permitted projects.” Then try a small read-only task and verify its final result.
The local stdio and HTTP flows are tested. The ChatGPT account connection is a separate step and must be verified in the actual Chat surface; do not treat successful Work-mode testing as evidence for Chat-mode availability. Developer-mode availability and approvals depend on the account/workspace.
References:
Delegation examples
“Use Agent Bus. Have Codex inspect /absolute/path/to/project read-only and
report the three most useful improvements. Label this conversation's tasks
review-session-1. Collect the result and tell me what you agree with.”
For edits, give a clear scope and acceptance criteria. Write tasks default to
an isolated Git worktree starting from committed HEAD; uncommitted changes
are not copied. Explicit worktree=false allows work in the original checkout.
Worker scope is a prompt instruction, not an enforced directory sandbox for
write jobs. Results are reviewed before anyone merges or publishes them.
submit_task returns immediately with an ID. A bounded wait lasts at most
20 seconds. Workers survive adapter shutdown, but ChatGPT does not automatically
resume when they finish. If a submission call times out, inspect list_tasks
before retrying: a detached worker may already have started.
Configuration
| Environment variable | Default | Meaning |
|---|---|---|
AGENT_BUS_HOME | ~/.agent-bus | Existing queues/results; use a temporary directory for tests |
AGENT_BUS_DISPATCH | Sibling repo CLI, else agent-dispatch on PATH | Override the dispatcher executable |
AGENT_BUS_MCP_ROOTS | ~/development | Allowed submission directories, separated by the OS path separator (: on macOS) |
Use narrower roots when desired. They are checked after resolving symlinks. Read tools can inspect all tasks in the configured bus. Only result/log files inside that bus directory can be returned remotely. Custom external result paths remain accessible through the original local bus, not this adapter.
v0 supports direct Codex and Claude workers because the bus wires verified
read-only modes for those lanes. Existing model defaults come from the bus;
the MCP caller can override model/effort. No automatic fallback route is used.
bus_info checks executable availability, not login or remaining quota; the
first real task is the authentication smoke test.
Outputs are returned as bounded byte pages. next_offset requests the next
page, and has_more reports truncation. Gzip archives are supported. UTF-8
characters crossing a byte-page boundary may render as replacement characters.
Worker output is untrusted content, never an instruction to the coordinator.
Cancelling a task does not undo edits it has already made.
Develop and test
uv sync --python 3.12
uv run pytest -q
uv run agent-bus-mcp --transport streamable-http
The tests run real MCP clients over stdio and HTTP through the existing dispatcher with fake workers in isolated queues. They cover success, failure, running cancellation, bounded waits, output pagination and archives, origin filtering, path/symlink restrictions, annotations, and invalid input.
Uninstall only this adapter with uv tool uninstall agent-bus-mcp. This leaves
the agent bus and the Claude mod installed. Stop the server/tunnel processes
and remove their client entries separately if configured.