ACP Integration
Run Crabcode as an Agent Client Protocol server for compatible editors.
Run Crabcode from an ACP-compatible editor or IDE with a stdio subprocess. ACP keeps the workspace, credentials, tools, permissions, and session history on the machine running Crabcode.
Start the server
crabcode acpUse --cwd when the editor should start Crabcode for a specific workspace:
crabcode acp --cwd /absolute/path/to/projectACP uses stdin and stdout for JSON-RPC traffic. Do not wrap the command with a program that writes banners or logs to stdout.
Editor configuration
For Zed, add an agent server to ~/.config/zed/settings.json:
{
"agent_servers": {
"Crabcode": {
"type": "custom",
"command": "crabcode",
"args": ["acp"],
"env": {}
}
}
}Provider login
Connect a provider in an interactive terminal without starting chat:
crabcode acp --loginChoose a provider ID, then use the existing OpenAI/xAI OAuth flow or enter an API key (hidden). Local providers do not need credentials. Existing credentials can be kept or replaced. The command exits after setup; restart or reconnect your ACP client afterward. The normal TUI /connect flow remains available.
Clients advertising clientCapabilities.auth.terminal discover terminal login automatically. Modern terminal-auth arguments append --login to the configured crabcode acp invocation. Older registry clients opting in through _meta["terminal-auth"] receive replacement arguments acp --login. Terminal-tool hosting alone does not imply login support. Clients without terminal-auth support should use manual setup.
Credentials remain in Crabcode's normal state directory; the editor does not receive API keys or OAuth tokens. Login is interactive and rejects piped input; normal ACP stdout remains JSON-RPC-only.
Registry distribution
Registry submission is separate from ACP support and is not automatic. Native releases use .tar.gz on macOS/Linux and .zip on Windows, with checksums. The npm installer also supports older .tar.xz releases and writes installation diagnostics to stderr.
Before submitting an entry to the ACP Registry, publish a release, verify its actual archives and executable paths, run the registry's clean-home authentication check, and smoke-test a client such as Codync. A provider-free local handshake check is available with python3 scripts/verify-acp-registry.py /path/to/crabcode. This checks discovery only, not real OAuth or API-key validity.
The entry requires crabcode/agent.json and a monochrome 16×16 crabcode/icon.svg. No registry entry is submitted by the release workflow.
Capability Matrix
All Crabcode-side capabilities in this matrix are implemented. Conditions in the last column are editor, model, provider, or protocol requirements rather than incomplete server behavior.
Runtime requirements
- Image and audio prompts require a selected model route with the corresponding input modality.
- ACP terminal embedding and question forms require the editor to advertise those client capabilities during initialization.
- Client-supplied remote MCP OAuth parameters are not part of the current ACP server descriptor. Use static headers from the editor, or configure the MCP server in Crabcode to use Crabcode's OAuth flow.
- Fields under
_meta.crabcodeare backwards-compatible Crabcode extensions for session hierarchy and detailed usage accounting.
Session behavior
session/close detaches the editor and cancels any active turn. It does not delete Crabcode session history. session/delete removes persisted history and managed attachments. List cursors page through the complete non-archived result set. Load replays the stored transcript; resume restores the session configuration without replaying prior content. Fork creates a new persisted session with a copied transcript and independently managed attachments. Child sessions are listed as normal entries with hierarchy metadata under _meta.crabcode. Invalid or failed session operations return a normal JSON-RPC error response and leave the ACP stdio connection available for later requests.
Safety notes
Crabcode applies the same configured permission rules in ACP as it does in the TUI. When a tool needs approval, the editor receives an ACP permission request with Allow once, Always allow for this session, and Reject choices. Choosing the session-wide option remembers the normalized permission scope for that attached ACP session, including later tool calls and later prompt turns. For external-folder access, approving a folder also covers files and nested directories beneath it. The grant is intentionally not written to project configuration or global preferences: closing/detaching the ACP session or restarting the server clears it, and loading/resuming the persisted transcript starts with a fresh permission state. Forked sessions also start with fresh grants. If the editor cannot respond or disconnects, Crabcode denies the request rather than continuing unattended.
Question forms are only sent to editors that advertise ACP form elicitation support. Declining, cancelling, disconnecting, or using an editor without that capability returns empty answers to the agent so the session can continue without waiting indefinitely.
Client-supplied MCP servers run with the same trust as project-configured MCP: stdio servers can execute local processes, and remote servers can send the headers and credentials the editor provides. Only attach MCP servers you trust for that workspace.
Image and audio attachments are decoded under a 20 MiB-per-file limit and written to private session-managed storage under Crabcode's state directory (…/crabcode/attachments/<session-id>/). Audio input accepts WAV and MP3 only. Closing an editor session keeps those files because history remains loadable; deleting the persisted session removes its managed attachment directory. Forks receive independent copies so deleting either session does not break the other. Readable external or temporary attachment paths from older sessions are copied into managed storage the next time Crabcode loads the session.
The capability matrix matches what the ACP server implements today. Crabcode only advertises protocol capability flags it handles (loadSession, image, audio, and embedded-context prompts, HTTP/SSE MCP, and list/resume/fork/close/delete session ops). Client-side form elicitation and terminal hosting are capability-gated during initialization before Crabcode sends those requests. Stdio MCP is accepted even though the current ACP capability object has no separate stdio flag.