The ACP Zed adapter exposes a single BeeAI agent as a Zed Agent Client Protocol (ACP) program over stdio, so it shows up directly inside Zed’s agent panel. Unlike the HTTP-based ACP integration, Zed’s ACP runs one agent per stdio process: Zed launches your Python script, talks JSON-RPC over stdin/stdout, and renders responses, tool calls, and terminal output in the editor UI. The adapter also routes BeeAI’s generic coding tools (Documentation Index
Fetch the complete documentation index at: https://framework.beeai.dev/llms.txt
Use this file to discover all available pages before exploring further.
ShellTool, FileReadTool, FileEditTool) through Zed’s filesystem and terminal capabilities for the duration of a turn — so file edits show up as diffs in unsaved buffers, and shell commands open in Zed’s terminal widget.
Prerequisites
- Zed editor installed
-
BeeAI Framework installed with the
acp-zedextra: - A configured LLM backend (Ollama, OpenAI, watsonx, …)
Quick start
1. Build and serve an agent
The smallest viable coding agent — three generic tools, no ACP-specific code:Python
2. Register the agent in Zed
Add the entry to~/.config/zed/settings.json:
How it works
ACPZedServer wraps the agent in an ACPZedServerAgent (one process, one agent) and runs it under the acp Python SDK. For every session/prompt call from the editor it:
- Creates a session-scoped clone of the agent (so memory persists across prompts in the same chat but is isolated between chats).
- Installs ACP-routed backends for the duration of the turn —
ShellBackend,FileBackend, andio_confirmare swapped onto implementations that talk to the editor. - Streams assistant text via
agent_message_chunk, tool calls and tool results viaagent_thought_chunk, so users see the agent’s intermediate steps live.
ACPZedServer/ACPZedServerAgent— the server + per-session lifecycle.FsBridge— agent-side handle to the editor’sfs/*andterminal/*methods, with the activesession_idcarried through aContextVar.ACPZedIOContext— the per-turn context manager that swaps backends in and out.
Supported agent types
The adapter ships factories for every BeeAI agent type, soregister(agent) works out of the box:
RequirementAgentToolCallingAgentReActAgentLiteAgent
final_answer for LiteAgent, partial_update for ReActAgent).
stdio framing
Zed’s ACP transport uses stdout exclusively for JSON-RPC frames. A strayprint() or log line on stdout will corrupt the stream. The adapter rebinds any logging handler bound to sys.stdout onto sys.stderr at startup; if you have your own logging configuration, make sure it follows suit.
Auto-routed coding tools
The headline benefit of running underACPZedServer is that the generic coding tools become editor-aware with no code changes. The same ShellTool() / FileReadTool() / FileEditTool() that runs against local disk in a CLI script will, when served through this adapter, transparently route through:
| Tool | Local default | Under ACPZedServer |
|---|---|---|
FileReadTool | pathlib.Path.read_text | fs/read_text_file — respects unsaved buffers |
FileEditTool | pathlib.Path.write_text | fs/write_text_file — editor renders diffs |
ShellTool | local asyncio subprocess | terminal/* — opens Zed’s terminal widget |
io_confirm | console prompt | session/request_permission — modal in editor |
ContextVar-backed dispatch — no ACP-specific subclasses required. Outside an ACP turn, every tool falls back to its local default.
GlobTool and GrepTool are not routed — they hit the local filesystem directly, since the ACP capability set has no equivalent. They still work, but they don’t see Zed’s unsaved buffers.
ACP-specific behavior of routed backends
A few things worth knowing about the ACP backends:ShellToolstdin —input_textraisesToolErrorunder the ACP terminal backend; the protocol has no way to feed stdin to a terminal.ShellToolstreams — Zed’s terminal conflates stdout and stderr. The ACP backend returns the combined output instdoutand leavesstderrempty.ShellTooltimeouts — enforced byasyncio.wait_foraroundwait_for_terminal_exit, with an explicitkill_terminal+release_terminalon timeout.io_readis unsupported — ACP has no free-form text-input method; calls raiseRuntimeError. Use a tool call orio_confirm(which routes throughsession/request_permission) instead.- Capability gating — every routed call checks the client’s advertised
ClientCapabilitiesbefore dispatching. Reads/writes/terminals fail fast with aToolErrorif Zed didn’t advertise the matching capability.
Configuration
ACPZedServerConfig is intentionally minimal — there’s no port or host because Zed manages the process:
agent_name / agent_description are omitted, the adapter uses the agent’s own metadata.
More examples
LiteAgent + full toolset
Streams tokens via
LiteAgent’s emitter callback and bridges through an asyncio.Queue to ACP.Kiwi.com flight-search
Domain-specific agent that pulls its toolset from a public MCP server. No file/shell tools.
Limitations
- One agent per process —
serve()raises if more than one agent is registered. Run multiple agents as separateagent_serversentries insettings.json. - No image/audio prompt blocks — the prompt converter currently extracts text and embedded-resource text only; image and audio blocks are dropped pending stable multi-part
UserMessagesupport across all backends. MCPToolfrom Zed-managed servers —new_sessionacceptsmcp_serversfrom the editor but the adapter does not currently spin them up. Configure MCP servers on the agent itself instead.