Skip to content

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@0.14.1.

opencorvus acp

Terminal window
opencorvus acp # current directory
opencorvus acp --cwd /path/to/project
OPENCORVUS_ENABLE_QUESTION_TOOL=1 opencorvus acp

Source: packages/opencorvus/src/cli/cmd/acp.ts

On startup:

  1. Internal opencorvus serve on a random port
  2. Creates an @opencorvus-ai/sdk client against that internal server
  3. Opens a JSON-RPC channel over stdin/stdout via ndJsonStream from @agentclientprotocol/sdk
  4. 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

MethodDescription
initializeNegotiates protocol version (1), advertises capabilities

Advertised (src/acp/agent.ts): loadSession: true; MCP http, sse; prompt embeddedContext, image; session fork, list, resume.

Session management

MethodDescription
session/newCreates new session
session/loadLoads session, replays history, restores model and mode
unstable_listSessionsLists sessions newest first, 100/page cursor
unstable_forkSessionForks a session, replays history
unstable_resumeSessionResumes without replay
unstable_setSessionModelSwitches model, supports variants
setSessionModeSwitches primary agent

Prompting

MethodDescription
session/promptSends message; text / image / resource_link / resource; /command prefix → slash command

Real-time notifications

Via connection.sessionUpdate():

UpdateWhen
agent_message_chunkStreaming AI text (driven by message.part.delta)
agent_thought_chunkReasoning model thoughts
tool_callTool invocation start
tool_call_updateIn progress / done / failed
planTodo list sync on todowrite completion
usage_updateTokens + cost after each prompt
available_commands_updateSlash commands on session load

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 HTTP/SSE (url, headers)

ACP calls sdk.mcp.add() to register each server into the internal opencorvus instance.

vs opencorvus serve (REST)

DimensionACPserve
Transportstdin/stdout (ndjson)HTTP (REST + SSE)
ClientsACP-compatible editorsBrowser / SDK / GH Action
ProtocolACP v1 (JSON-RPC)Custom REST
Streamingsession/updateSSE /event
External portNone7878
ConcurrencySingle clientMulti-client

vs MCP

DimensionACPMCP
RoleEditor ↔ AI agentLLM ↔ tool/data
DirectionEditor calls agentLLM calls tools
SessionsYes (session/new/load)No
Permission UIAgent asks editorN/A
OpenCorvusACP Server (editor connects)MCP Client (connects to external MCP)

Current limitations

(src/acp/README.md)

  • Authentication: authenticate throws immediately
  • Session persistence: session/load replays messages but does not restore working-directory snapshot
  • Terminal support: terminal capability in client.ts is a stub
  • Session mode switching: setSessionMode works but lacks UI feedback