Skip to content

kimi acp Subcommand ​

kimi acp switches Kimi Code CLI to ACP (Agent Client Protocol) mode: it communicates with an ACP client (such as Zed, JetBrains AI Chat, etc.) via JSON-RPC over stdin/stdout, letting the IDE directly drive kimi's sessions, prompts, and tool calls.

sh
kimi acp

Once started, the command prints no banner and immediately waits for the ACP client to send an initialize request on stdin. Logs are written to stderr (as well as the diagnostic log under ~/.kimi-code/logs/), so the ACP channel itself stays clean.

The command exits when the client closes stdin. On SIGINT, SIGTERM or SIGHUP it closes its sessions and the MCP servers and commands it started, then exits with code 128 plus the signal number, for example 143 for SIGTERM, within 8 seconds. A second signal exits at once, still stopping those processes.

When Kimi starts a turn on its own — to report a completed background task, to continue after a Stop hook blocks, or to run a scheduled task — kimi acp sends the reply and tool calls to the IDE through session/update, even after the previous session/prompt has ended. A new prompt sent while that turn is running receives turn.agent_busy and can be retried when the turn is complete.

Who calls this?

You typically do not need to run kimi acp manually — this command is the subprocess entry point for IDEs. For IDE-side configuration, see Using in IDEs.

Capability matrix ​

The table below lists the capabilities declared by the ACP server. The agentCapabilities field is returned in full in the initialize response, so the IDE can adjust its UI accordingly.

CapabilityValueDescription
loadSessiontrueSupports session/load to resume an existing session, replaying history on load
promptCapabilities.imagetrueSupports ACP image content blocks (base64 + mimeType)
promptCapabilities.audiofalseAudio prompts not yet supported
promptCapabilities.embeddedContexttrueClient may send resource/resource_link embedded resource blocks; text content is injected into the prompt as <resource uri="...">...</resource>; blob resources are dropped with a warn
sessionCapabilities.list{}Supports session/list to enumerate the current user's sessions
sessionCapabilities.resume{}Supports session/resume to reattach to a session without history replay
sessionCapabilities.close{}Supports session/close to tear down a live session
sessionCapabilities.delete{}Supports session/delete to permanently remove a session
sessionCapabilities.fork{}Supports session/fork to branch an existing session
sessionCapabilities.additionalDirectories{}Extra working directories; honored on session/new only
mcpCapabilities.httptrueForwards HTTP MCP services configured by the IDE
mcpCapabilities.ssetrueForwards legacy SSE MCP services configured by the IDE
auth.logout{}Supports ACP logout to drop the managed provider's token

ACP method coverage ​

With @agentclientprotocol/sdk@1.x, the ACP method set is organized by namespace: core and session cover the main agent flow, while providers, nes (inline-edit prediction), and document (buffer sync) are optional extension surfaces. On the client side, reverse-RPC methods are grouped under session, fs, terminal, and elicitation.

Summary: the ACP server implements the full core (3/3) and session (11/11) agent-side surface, 10/11 client reverse-RPC methods, and the session/set_model extension. Not implemented: providers/*, nes/*, document/*, and elicitation/complete — requests for them return methodNotFound.

Core agent-side — IDE → agent (3 / 3) ​

MethodImplementedDescription
initializeYesVersion negotiation; returns agentInfo: { name: 'Kimi Code CLI', version }, capability matrix, and authMethods (first-class type:'terminal' plus the legacy _meta['terminal-auth'] fallback)
authenticateYesValidates method_id='login'; returns authRequired (-32000) if the token is missing, invalidParams (-32602) for an unknown ID
logoutYesDrops the managed provider's token; subsequent gated calls return auth_required again

Session agent-side — IDE → agent (11 / 11) ​

MethodImplementedDescription
session/newYesAccepts cwd / mcpServers / additionalDirectories; returns sessionId + configOptions[] + modes
session/loadYesRestores a session from disk and replays history via session/update before the response settles
session/resumeYesLightweight sibling of session/load; skips history replay
session/listYesEnumerates sessions on disk, filterable by cwd
session/forkYesBranches a source session; cwd / additionalDirectories / mcpServers on the request are ignored with a warning
session/closeYesBest-effort teardown: cancels any in-flight turn, disposes per-session resources, and closes the live session; an unknown id is not an error
session/deleteYesPermanently removes a session and its persisted data. Subsequent session/list calls omit the deleted session. An unknown ID returns invalidParams (-32602).
session/promptYesAccepts text / image / resource / resource_link content blocks; streams agent_message_chunk. A turn that fails after it has started returns a JSON-RPC error: authRequired (-32000) for an authentication failure, otherwise -32603 with the error message as message and its error code in data.code. A response blocked by the provider's content filter ends with the refusal stop reason, and a turn that fails after session/cancel still ends with cancelled
session/cancelYesInterrupts the current turn (a JSON-RPC $/cancel_request for a prompt lands in the same cancel path)
session/set_modeYesValidates modeId; the same underlying mode switch as set_config_option({configId:'mode'})
session/set_config_optionYesUnified model / thinking / mode picker dispatcher

In the mode picker, Auto (auto) can approve sensitive operations automatically and honors explicit deny rules. YOLO (yolo) automatically approves routine operations and can still prompt for sensitive actions.

Sessions created or restored with Plan mode active report Plan in both mode pickers. Approving a plan or choosing Reject and Exit updates the pickers to the effective permission mode.

Client-side reverse-RPC — agent → IDE (10 / 11) ​

MethodImplementedDescription
session/updateYesStreams agent_message_chunk / tool_call* / plan / config_option_update / available_commands_update. Retry progress is sent as a warning notice when the client advertises clientCapabilities.session.notices; other clients receive the same status in an agent_message_chunk. Synthetic retry updates are not added to model history
session/request_permissionYesShared channel for tool approvals and questions. Bash approvals include the complete command and working directory. Resolved absolute file targets appear in toolCall.locations
fs/read_text_fileYesEngine file reads are routed to the client when it advertises fsCapabilities
fs/write_text_fileYesEngine file writes are routed to the client
terminal/create · output · release · kill · wait_for_exitYesShell executions reverse-RPC to the client when it advertises clientCapabilities.terminal. Otherwise the command runs locally, and what it has printed so far is sent as tool_call_update text content while it runs
elicitation/createYesAsk-user questions go through the native form when the client advertises elicitation.form; RPC failures fall back to session/request_permission
elicitation/completeNo

Extension methods ​

MethodImplementedDescription
session/set_modelYesCarried over from the ACP 0.23 unstable surface as an extension method; equivalent to set_config_option({configId:'model'})

All methods not listed above return methodNotFound.

MCP forwarding ​

When an ACP client provides mcpServers in session/new or session/load, the ACP server performs the following conversions:

  • http → kimi's transport: 'http' configuration
  • stdio → kimi's transport: 'stdio' configuration
  • sse → kimi's transport: 'sse' configuration
  • acp → discarded with a warn log entry

Next steps ​