ACP Support
Use OpenCorvus in any ACP-compatible editor (e.g. Zed) over stdin/stdout JSON-RPC.
ACP is a standardized communication protocol that decouples AI coding agents from editors, letting both sides evolve independently.
Source: packages/opencorvus/src/acp/. SDK: @agentclientprotocol/sdk@1.4.0.
opencorvus acp
opencorvus acp # current directoryopencorvus acp --cwd /path/to/projectOPENCORVUS_ENABLE_QUESTION_TOOL=1 opencorvus acpSource: packages/opencorvus/src/cli/cmd/acp.ts
On startup:
- Internal
opencorvus serveon a random port - Creates an
@opencorvus-ai/sdkclient against that internal server - Opens a JSON-RPC channel over stdin/stdout via
ndJsonStreamfrom@agentclientprotocol/sdk - Instantiates
ACP.Agent, waits for client messages
Transport: newline-delimited JSON over stdio — no external TCP port (src/cli/cmd/acp.ts).
Connecting Zed
~/.config/zed/settings.json:
{ "agent_servers": { "OpenCorvus": { "command": "opencorvus", "args": ["acp"] } }}Zed spawns opencorvus acp on demand and communicates via stdin/stdout (src/acp/README.md).
Supported ACP methods
Initialization
| Method | Description |
|---|---|
initialize | Negotiates protocol version (1), advertises capabilities |
Advertised (src/acp/agent.ts): loadSession: true; MCP http, sse; prompt embeddedContext, image; session fork, list, resume.
Session management
| Method | Description |
|---|---|
session/new | Creates new session |
session/load | Loads session, replays history, restores model and mode |
listSessions | Lists root sessions newest first, with 100 per page. Omit the working directory to list across projects. |
unstable_forkSession | Forks a session, replays history |
resumeSession | Resumes without replay |
setSessionConfigOption | Switches model, supports variants |
setSessionMode | Switches primary agent |
Loading a session restores its exact saved primary agent, including an agent hidden from the general mode picker. New standalone sessions keep the project’s visible default, and previously used primary agents stay selectable when switching modes or saving new turns. A web Chat or Work session declares its own fixed mode even before its first message; the editor cannot switch that session to a different primary. A normal fork uses the actual fork’s identity and retained history, so an independent fork can switch to an offered coding mode. Mode requests must use an entry returned for that session; invalid choices report the session, requested mode, and available mode IDs. Task, Mission, and Control operations retain their existing dedicated entry points.
Prompting
| Method | Description |
|---|---|
session/prompt | Sends message; text / image / resource_link / resource; /command prefix → slash command |
Real-time notifications
Via connection.sessionUpdate():
| Update | When |
|---|---|
agent_message_chunk | Streaming AI text (driven by message.part.delta) |
agent_thought_chunk | Reasoning model thoughts |
tool_call | Tool invocation start |
tool_call_update | In progress / done / failed |
plan | Todo list sync on todo write completion |
usage_update | Tokens + cost after each prompt |
available_commands_update | Current slash commands after the session’s project connections are attached |
Commands with declared inputs include an editor hint. A remote prompt can show <date> [scope] for a required date
and an optional scope. Project templates with argument placeholders show [arguments] for free text. Editors that
use this field can keep the command in the input box while the user fills in its arguments.
When a user attaches an image or embeds a resource with a registered slash command, the command text supplies the arguments and the attached content becomes part of the conversation input. For example, mentioning a project file after a report date passes the file contents to the conversation and sends the date to the remote report prompt.
Authentication
Permission handling
ACP forwards durable permission.asked events through connection.requestPermission(). Eligible choices map to allow_once, allow_task, allow_project, or deny on the canonical permission request.
For edit permissions, after client approval, ACP calls connection.writeTextFile() to push the patched content to the editor (src/acp/agent.ts).
MCP server support
session/new and session/load accept an mcpServers list:
- Local processes (
command,args,env) - Remote Streamable HTTP (
type: "http",url,headers) - Remote server-sent events (
type: "sse",url,headers)
ACP calls sdk.mcp.add() to register each server into the internal opencorvus instance.
vs opencorvus serve (REST)
| Dimension | ACP | serve |
|---|---|---|
| Transport | stdin/stdout (ndjson) | HTTP (REST + SSE) |
| Clients | ACP-compatible editors | Browser / SDK / GH Action |
| Protocol | ACP v1 (JSON-RPC) | Custom REST |
| Streaming | session/update | SSE /event |
| External port | None | 7878 |
| Concurrency | Single client | Multi-client |
vs MCP
| Dimension | ACP | MCP |
|---|---|---|
| Role | Editor ↔ AI agent | LLM ↔ tool/data |
| Direction | Editor calls agent | LLM calls tools |
| Sessions | Yes (session/new/load) | No |
| Permission UI | Agent asks editor | N/A |
| OpenCorvus | ACP Server (editor connects) | MCP Client (connects to external MCP) |
Current limitations
(src/acp/README.md)
- Authentication:
authenticatethrows immediately - Session persistence:
session/loadreplays messages but does not restore working-directory snapshot - Terminal support: terminal capability in
client.tsis a stub - Session mode switching:
setSessionModeworks but lacks UI feedback