Skip to content

ACP Editor Adapter

EditorGuide
CursorCursor Setup
VS CodeVS Code Setup
ZedZed Setup
NeovimNeovim Setup
VimVim Setup

CLI AI Tools: Claude Code | Codex | Gemini

The ACP (Agent Control Protocol) adapter exposes AgentZero as a full coding agent over JSON-RPC stdio. Unlike MCP which provides individual tools to an external host, ACP runs the complete agentic loop — LLM inference, tool calling, approval flow, and context management — inside AgentZero. The editor sends chat messages; AgentZero drives the model, executes tools, and streams results back.

Terminal window
az serve

The server reads newline-delimited JSON from stdin and writes responses to stdout.

ACP uses a simple request/response format:

{"id": "1", "method": "initialize", "params": {}}
{"id": "1", "success": true, "result": {"name": "agentzero", "version": "0.16.0", "capabilities": ["chat", "tool_call", "session_info", "list_tools", "list_models", "switch_model", "steer", "branch", "tree", "label", "reload", "get_usage"]}}
MethodDescription
initializeReturns server info and capabilities
session_infoReturns session ID, status, and available tools
list_toolsReturns tool definitions
tool_callExecute a tool with arguments
chatSend a chat message (runs full agentic loop)
list_modelsReturns available models from all configured providers
switch_modelChange the active model mid-session
steerInject a steering message between tool rounds
branchBranch the conversation from a tree node
treeGet the session tree (branching history)
labelLabel a tree node
reloadReload dynamic tools from the registry
get_usageGet cumulative token usage for the session
approve_actionApprove or deny a pending tool call
cancelCancel/abort the current operation
shutdownGraceful shutdown

A chat request runs the full agentic loop. AgentZero sends the message to the model, executes any tool calls the model requests (subject to policy and approval), and returns the final response.

{"id": "3", "method": "chat", "params": {"message": "fix the typo on line 12 of README.md"}}

During execution, the server emits notifications for streaming events (see Notifications below). The final response:

{"id": "3", "success": true, "result": {"content": "Fixed the typo on line 12.", "model": "llama3.2", "rounds": 2, "tool_calls": [{"name": "read", "success": true, "output_bytes": 1234}, {"name": "edit", "success": true, "output_bytes": 89}]}}

Direct tool calls bypass the model and execute a tool immediately:

{"id": "2", "method": "tool_call", "params": {"name": "read", "arguments": {"path": "Cargo.toml"}}}
{"id": "2", "success": true, "result": {"success": true, "output": "[workspace]\n..."}}

All tool calls go through the same session engine as the CLI — policy evaluation, path validation, and audit logging are all active.

The server sends AcpNotification messages during chat execution. Notifications are server-initiated and have no id field:

{"notification": "token", "params": {"text": "I'll fix"}}
{"notification": "tool_start", "params": {"tool": "read", "arguments": {"path": "README.md"}}}
{"notification": "tool_result", "params": {"tool": "read", "success": true, "output_bytes": 1234}}
{"notification": "requires_approval", "params": {"request_id": "req-1", "tool": "edit", "arguments": {"path": "README.md", "old_text": "recieve", "new_text": "receive"}}}
{"notification": "context_compacted", "params": {"before": 50, "after": 12}}
NotificationWhen
tokenEach streamed token from the model
tool_startA tool call begins
tool_resultA tool call completes
requires_approvalA tool call needs user approval (respond with approve_action)
context_compactedContext window was compacted to fit within model limits
usageToken usage for a round (input/output tokens + session totals)

Editors can steer the agent mid-execution, branch conversations, and navigate the session tree.

Inject a message between tool rounds (the agent processes it on the next LLM call):

{"id": "20", "method": "steer", "params": {"message": "focus on the tests, not the implementation"}}

Branch the conversation from a prior tree node (truncates history to that point):

{"id": "21", "method": "branch", "params": {"node_id": "n-abc123"}}

Get the full session tree:

{"id": "22", "method": "tree", "params": {}}

Returns tree (structured data with nodes) and display (ASCII tree rendering).

Label the current tree node:

{"id": "23", "method": "label", "params": {"label": "before refactor"}}

Switch models mid-session without restarting the server:

{"id": "30", "method": "switch_model", "params": {"model": "codellama"}}

Get cumulative token usage for the session:

{"id": "40", "method": "get_usage", "params": {}}

Returns input_tokens, output_tokens, total_tokens, cache_creation_tokens, cache_read_tokens.

Generate editor-native configuration files with az init --editor:

Terminal window
# VS Code
az init --private --editor vscode
# Cursor
az init --private --editor cursor
# Zed
az init --private --editor zed

This creates the appropriate task or rules files so the editor can launch and communicate with az serve.

ACPMCP
RoleFull coding agentTool provider
ProtocolSimple JSON-RPCJSON-RPC 2.0 (standard)
InferenceAgentZero runs the modelHost runs the model
Tool executionAgentZero decides and executesHost decides, AgentZero executes
EcosystemCustom editorsClaude Code, Cursor, Zed
Tool namingInternal names (read, list)MCP names (read_file, list_directory)
Use whenBuilding a custom integration or want AgentZero to driveUsing an existing MCP client

ACP is now the primary and recommended protocol for editor integration. MCP has been moved to an optional feature flag (--features mcp). See ADR 0014.

ACP also supports the generate_tool capability, allowing the agent to create new WASM tools during a session. Generated tools are immediately available for use in the same session.