content/manuals/ai/docker-agent/integrations/acp.md
Run agents directly in your editor using the Agent Client Protocol (ACP). Your agent gets access to your editor's filesystem context and can read and modify files as you work. The editor handles file operations while Docker Agent provides the AI capabilities.
This guide shows you how to configure Neovim, or Zed to run agents with Docker Agent. If you're looking to expose agents as tools to MCP clients like Claude Desktop or Claude Code, see MCP integration instead.
When you run Docker Agent with ACP, it becomes part of your editor's environment. You select code, highlight a function, or reference a file - the agent sees what you see. No copying file paths or switching to a terminal.
Ask "explain this function" and the agent reads the file you're viewing. Ask it to "add error handling" and it edits the code right in your editor. The agent works with your editor's view of the project, not some external file system it has to navigate.
The difference from running Docker Agent in a terminal: file operations go through your editor instead of the agent directly accessing your filesystem. When the agent needs to read or write a file, it requests it from your editor. This keeps the agent's view of your code synchronized with yours - same working directory, same files, same state.
Before configuring your editor, you need:
Your agents will use model provider API keys from your shell environment
(ANTHROPIC_API_KEY, OPENAI_API_KEY, etc.). Make sure these are set before
launching your editor.
Zed has built-in ACP support.
Add docker agent to your agent servers in settings.json:
{
"agent_servers": {
"my-agent-team": {
"command": "docker",
"args": ["agent", "serve", "acp", "agent.yml"]
}
}
}
Replace:
my-agent-team with the name you want to use for the agentagent.yml with the path to your agent configuration file.If you have multiple agent files that you like to run separately, you can
create multiple entries under agent_servers for each agent.
Start a new external agent thread. Select your agent in the drop-down list.
Use the CodeCompanion plugin, which has native support for Docker Agent through a built-in adapter:
Install CodeCompanion through your plugin manager.
Extend the dockeragent adapter in your CodeCompanion config:
require("codecompanion").setup({
adapters = {
acp = {
dockeragent = function()
return require("codecompanion.adapters").extend("dockeragent", {
commands = {
default = {
"docker",
"agent",
"serve",
"acp",
"agent.yml",
},
},
})
end,
},
},
})
Replace agent.yml with the path to your agent configuration file. If you
have multiple agent files that you like to run separately, you can create
multiple commands for each agent.
Restart Neovim and launch CodeCompanion:
:CodeCompanion
Switch to the Docker Agent adapter (keymap ga in the CodeCompanion buffer, by
default).
See the CodeCompanion ACP
documentation for more
information about ACP support in CodeCompanion. Note that terminal operations
are not supported, so toolsets like shell or
script_shell are not usable through CodeCompanion.
You can specify your agent configuration as a local file path or OCI registry reference:
# Local file path
$ docker agent serve acp ./agent.yml
# OCI registry reference
$ docker agent serve acp agentcatalog/pirate
$ docker agent serve acp dockereng/myagent:v1.0.0
Use the same syntax in your editor configuration:
{
"agent_servers": {
"myagent": {
"command": "docker",
"args": ["agent", "serve", "acp", "agentcatalog/pirate"]
}
}
}
Registry references enable team sharing, version management, and clean configuration without local file paths. See Sharing agents for details on using OCI registries.
Verify your configuration works:
If the agent starts but can't access files or perform other actions, check:
docker agent serve acp options