11---
2- title : ACP integration
2+ title : ACP
33description : Configure your editor or IDE to use cagent agents as coding assistants
4- keywords : [cagent, acp, editor, ide, vscode, neovim , integration]
4+ keywords : [cagent, acp, editor, ide, neovim, zed , integration]
55weight : 40
66---
77
@@ -10,15 +10,15 @@ Your agent gets access to your editor's filesystem context and can read and
1010modify files as you work. The editor handles file operations while cagent
1111provides the AI capabilities.
1212
13- This guide shows you how to configure VS Code, Neovim, or Zed to run cagent
14- agents. If you're looking to expose cagent agents as tools to MCP clients like
15- Claude Desktop or Claude Code, see [ MCP integration] ( ./mcp.md ) instead.
13+ This guide shows you how to configure Neovim, or Zed to run cagent agents. If
14+ you're looking to expose cagent agents as tools to MCP clients like Claude
15+ Desktop or Claude Code, see [ MCP integration] ( ./mcp.md ) instead.
1616
1717## How it works
1818
1919When you run cagent with ACP, it becomes part of your editor's environment. You
20- select code, highlight a function, or reference a file - the agent sees what
21- you see. No copying file paths or switching to a terminal.
20+ select code, highlight a function, or reference a file - the agent sees what you
21+ see. No copying file paths or switching to a terminal.
2222
2323Ask "explain this function" and the agent reads the file you're viewing. Ask it
2424to "add error handling" and it edits the code right in your editor. The agent
@@ -27,9 +27,9 @@ has to navigate.
2727
2828The difference from running cagent in a terminal: file operations go through
2929your editor instead of the agent directly accessing your filesystem. When the
30- agent needs to read or write a file, it requests it from your editor. This
31- keeps the agent's view of your code synchronized with yours - same working
32- directory, same files, same state.
30+ agent needs to read or write a file, it requests it from your editor. This keeps
31+ the agent's view of your code synchronized with yours - same working directory,
32+ same files, same state.
3333
3434## Prerequisites
3535
@@ -39,20 +39,14 @@ Before configuring your editor, you need:
3939- ** Agent configuration** - A YAML file defining your agent. See the
4040 [ tutorial] ( ../tutorial.md ) or [ example
4141 configurations] ( https://github.com/docker/cagent/tree/main/examples )
42- - ** Editor with ACP support** - VS Code, Neovim, Zed, or any editor you can
43- configure for stdio-based tools
42+ - ** Editor with ACP support** - Neovim, Intellij, Zed, etc.
4443
4544Your agents will use model provider API keys from your shell environment
4645(` ANTHROPIC_API_KEY ` , ` OPENAI_API_KEY ` , etc.). Make sure these are set before
4746launching your editor.
4847
4948## Editor configuration
5049
51- Your editor needs to know how to start cagent and communicate with it over
52- stdio. Most editors support this through extension systems, configuration files,
53- or plugin managers. You're telling your editor: "When I want to use an AI
54- agent, run this command and talk to it."
55-
5650### Zed
5751
5852Zed has built-in ACP support.
@@ -123,27 +117,11 @@ which has native support for cagent through a built-in adapter:
1231174 . Switch to the cagent adapter (keymap ` ga ` in the CodeCompanion buffer, by
124118 default).
125119
126- See the [ CodeCompanion ACP documentation] ( https://codecompanion.olimorris.dev/usage/acp-protocol )
127- for more information about ACP support in CodeCompanion. Note that terminal
128- operations are not supported, so [ toolsets] ( ../reference/toolsets.md ) like
129- ` shell ` or ` script_shell ` are not usable through CodeCompanion.
130-
131- ### VS Code
132-
133- VS Code [ doesn't support ACP] ( https://github.com/microsoft/vscode/issues/265496 )
134- natively yet.
135-
136- ### Other editors
137-
138- For other editors with ACP support, you need a way to:
139-
140- 1 . Start cagent with ` cagent acp your-agent.yml --working-dir /project/path `
141- 2 . Send prompts to its stdin
142- 3 . Read responses from its stdout
143-
144- This typically requires writing a small plugin or extension for your editor, or
145- using your editor's external tool integration if it supports stdio
146- communication.
120+ See the [ CodeCompanion ACP
121+ documentation] ( https://codecompanion.olimorris.dev/usage/acp-protocol ) for more
122+ information about ACP support in CodeCompanion. Note that terminal operations
123+ are not supported, so [ toolsets] ( ../reference/toolsets.md ) like ` shell ` or
124+ ` script_shell ` are not usable through CodeCompanion.
147125
148126## Agent references
149127
@@ -173,8 +151,8 @@ Use the same syntax in your editor configuration:
173151```
174152
175153Registry references enable team sharing, version management, and clean
176- configuration without local file paths. See [ Sharing agents ] ( ../sharing-agents.md )
177- for details on using OCI registries.
154+ configuration without local file paths. See [ Sharing
155+ agents ] ( ../sharing-agents.md ) for details on using OCI registries.
178156
179157## Testing your setup
180158
@@ -191,61 +169,14 @@ If the agent starts but can't access files or perform other actions, check:
191169- Agent configuration file path is absolute or relative to working directory
192170- Your editor or plugin properly implements ACP protocol features
193171
194- ## Common workflows
195-
196- ### Explain code at cursor
197-
198- Select a function or code block, then ask: "Explain what this code does."
199-
200- The agent reads the file, analyzes the selection, and explains the
201- functionality.
202-
203- ### Add functionality
204-
205- Ask: "Add error handling to this function" while having a function selected.
206-
207- The agent reads the current code, writes improved code with error handling, and
208- explains the changes.
209-
210- ### Search the codebase
211-
212- For agents configured with RAG (see examples directory), ask: "Where is
213- authentication implemented?"
214-
215- The agent searches your indexed codebase and points to relevant files and
216- functions.
217-
218- ### Multi-step refactoring
219-
220- Ask: "Rename this function and update all callers."
221-
222- The agent finds all references, makes changes across files, and reports what
223- it updated.
224-
225- ## ACP vs MCP integration
226-
227- Both protocols let you integrate cagent agents with other tools, but they're
228- designed for different use cases:
229-
230- | Feature | ACP Integration | MCP Integration |
231- | ----------- | ---------------------------- | ------------------------------ |
232- | Use case | Embedded agents in editors | Agents as tools in MCP clients |
233- | Filesystem | Delegated to client (editor) | Direct cagent access |
234- | Working dir | Client workspace | Configurable per agent |
235- | Best for | Code editing workflows | Using agents as callable tools |
236-
237- Use ACP when you want agents embedded in your editor. Use MCP when you want to
238- expose agents as tools to MCP clients like Claude Desktop or Claude Code.
239-
240- For MCP integration setup, see [ MCP integration] ( ./mcp.md ) .
241-
242172## What's next
243173
244- - Review the [ configuration reference] ( ../reference/config.md ) for advanced agent
245- setup
174+ - Review the [ configuration reference] ( ../reference/config.md ) for advanced
175+ agent setup
246176- Explore the [ toolsets reference] ( ../reference/toolsets.md ) to learn what tools
247177 are available
248178- Add [ RAG for codebase search] ( ../rag.md ) to your agent
249179- Check the [ CLI reference] ( ../reference/cli.md ) for all ` cagent acp ` options
250- - Browse [ example configurations] ( https://github.com/docker/cagent/tree/main/examples )
251- for inspiration
180+ - Browse [ example
181+ configurations] ( https://github.com/docker/cagent/tree/main/examples ) for
182+ inspiration
0 commit comments