Skip to content

Connect an IDE over ACP

The Agent Client Protocol (ACP) is an open standard that lets code editors (such as Zed) run an Agent subprocess and stream sessions, prompts, tool calls, and file edits over JSON-RPC.

Install bub-acp-server to connect Bub to ACP, so you can summon Bub directly in your everyday IDE for coding, refactoring, and troubleshooting.

JSON-RPCTurn events and tool callsCode editor(ACP-compatible)bub-acp-serverBub Agent

Install the adapter plugin in the Python environment that contains Bub:

Terminal window
bub install bub-acp-server@main
bub acp --help

Seeing Usage: bub acp [OPTIONS] confirms installation. By default, bub acp communicates over stdio.

In Zed, press Cmd+Shift+P (macOS) or Ctrl+Shift+P (Linux/Windows), run zed: open settings, and add agent_servers to settings.json.

If you do not need to load a project .env file, point directly to bub (replace "bub" with the absolute path from command -v bub if Zed cannot find it):

~/.config/zed/settings.json
{
"agent_servers": {
"Bub": {
"type": "custom",
"command": "bub",
"args": ["acp"],
"env": {}
}
}
}

If your API keys live in a workspace .env file or you use a project virtual environment, create a wrapper script at ~/.bub/bub-acp-wrapper:

~/.bub/bub-acp-wrapper
#!/usr/bin/env bash
set -euo pipefail
# 1. Optional: activate virtual environment
# source /path/to/venv/bin/activate
# 2. Load workspace .env if present
if [ -f "$PWD/.env" ]; then
set -a
source "$PWD/.env"
set +a
fi
# 3. Launch Bub ACP via absolute path
exec /path/to/your/bub acp

Make it executable and reference it in Zed’s settings.json:

Terminal window
chmod +x ~/.bub/bub-acp-wrapper
~/.config/zed/settings.json
{
"agent_servers": {
"Bub": {
"type": "custom",
"command": "/Users/yourname/.bub/bub-acp-wrapper",
"args": [],
"env": {}
}
}
}

After saving the settings, restart Zed or reload the configuration:

  1. Press Cmd+? (macOS) or Ctrl+? (Linux/Windows) to open Zed’s Agent panel.
  2. Select Bub from the agent menu.
  3. Send a test prompt:
    Hello! Please introduce yourself.
  4. Bub streams the response, thinking process, and tool call steps into the panel.
  • New and restored threads: starting a new thread in Zed creates a new Tape; switching back to an earlier thread replays history from the Tape store. The session index is saved in $BUB_HOME/acp-sessions.json—as long as BUB_HOME and your workspace path stay the same, your session list remains intact across editor restarts.
  • Model and reasoning effort: changing the model or reasoning effort in the Zed UI updates subsequent requests in the active ACP session.

For most local setups, stdio is the lightest, lowest-overhead choice. When Bub runs on a remote dev server or inside a Docker container, expose ACP over HTTP or WebSocket instead.

Terminal window
bub acp --transport http
# or
bub acp --transport websocket

Listens on 127.0.0.1:28200 by default (http://127.0.0.1:28200/acp or ws://127.0.0.1:28200/acp).

Gateway mode maintains the session pool and background connection together:

Terminal window
bub gateway --enable-channel acp-server
Environment variable Default Description
BUB_ACP_SERVER_HOST 127.0.0.1 Listen host IP (use 0.0.0.0 for external access)
BUB_ACP_SERVER_PORT 28200 Listen port
BUB_ACP_SERVER_CERTFILE empty TLS certificate path (required for HTTPS/WSS)
BUB_ACP_SERVER_KEYFILE empty TLS private key path
Symptom Fix
Zed cannot find the Agent server Set command in settings.json to the absolute path from command -v bub
Startup fails or API key is missing Use Option B to source your .env file
Inspect JSON-RPC traffic Run dev: open acp logs from Zed’s command palette
Session history does not persist Verify the user running Zed has read/write permissions on $BUB_HOME (~/.bub)