| title | Agent Client Protocol (ACP) |
|---|---|
| description | Expose Deep Agents over the Agent Client Protocol (ACP) to integrate with code editors and IDEs. |
import AcpQuickstartPy from '/snippets/code-samples/acp-quickstart-py.mdx'; import AcpDeepAgentsServerJs from '/snippets/code-samples/acp-deep-agents-server-js.mdx'; import AcpMultipleAgentsJs from '/snippets/code-samples/acp-multiple-agents-js.mdx'; import AcpSlashCommandsJs from '/snippets/code-samples/acp-slash-commands-js.mdx'; import AcpHitlJs from '/snippets/code-samples/acp-hitl-js.mdx'; import AcpCustomToolsJs from '/snippets/code-samples/acp-custom-tools-js.mdx'; import AcpCustomBackendJs from '/snippets/code-samples/acp-custom-backend-js.mdx';
Agent Client Protocol (ACP) standardizes communication between coding agents and code editors or IDEs. With the ACP protocol, you can make use of your custom deep agents with any ACP-compatible client, allowing your code editor to provide project context and receive rich updates.
ACP is designed for agent-editor integrations. If you want your agent to call tools hosted by external servers, see [Model Context Protocol (MCP)](/oss/langchain/mcp/).Install the ACP integration package:
:::python
pip install deepagents-acpuv add deepagents-acp:::js
npm install deepagents-acpyarn add deepagents-acppnpm add deepagents-acpThen expose a deep agent over ACP.
This starts an ACP server in stdio mode (it reads requests from stdin and writes responses to stdout). In practice, you usually run this as a command launched by an ACP client (for example, your editor), which then communicates with the server over stdio.
:::python
:::
:::js
import { startServer } from "deepagents-acp";
await startServer({
agents: {
name: "coding-assistant",
description: "AI coding assistant with filesystem access",
},
workspaceRoot: process.cwd(),
});You can also use the CLI without writing any code:
npx deepagents-acp:::
:::python
The deepagents-acp package includes an example coding agent with filesystem and shell that you can run out of the box.
:::
:::js
The deepagents-acp package provides both a CLI and a programmatic API for exposing deep agents over ACP.
:::
Deep agents work anywhere you can run an ACP agent server. Some notable ACP clients include:
- Zed
- JetBrains IDEs
- Visual Studio Code (via vscode-acp)
- Neovim (via ACP-compatible plugins)
:::python
The deepagents repo includes a demo ACP entrypoint you can register with Zed:
- Clone the
deepagentsrepo and install dependencies:
git clone https://github.com/langchain-ai/deepagents.git
cd deepagents/libs/acp
uv sync --all-groups
chmod +x run_demo_agent.sh- Configure credentials for the demo agent:
cp .env.example .envThen set ANTHROPIC_API_KEY in .env.
- Configure your ACP agent server command in Zed's
settings.json:
{
"agent_servers": {
"DeepAgents": {
"type": "custom",
"command": "/your/absolute/path/to/deepagents/libs/acp/run_demo_agent.sh"
}
}
}- Open Zed's Agents panel and start a Deep Agents thread.
:::
:::js
Register your deep agent with Zed by adding it to your Zed settings (~/.config/zed/settings.json on Linux, ~/Library/Application Support/Zed/settings.json on macOS):
Simple setup (no code required):
{
"agent": {
"profiles": {
"deepagents": {
"name": "DeepAgents",
"command": "npx",
"args": ["deepagents-acp"],
"env": {
"ANTHROPIC_API_KEY": "sk-ant-..."
}
}
}
}
}With CLI options:
{
"agent": {
"profiles": {
"deepagents": {
"name": "DeepAgents",
"command": "npx",
"args": [
"deepagents-acp",
"--name", "my-assistant",
"--skills", "./skills",
"--debug"
],
"env": {
"ANTHROPIC_API_KEY": "sk-ant-..."
}
}
}
}
}Custom server script:
For more control, create a TypeScript server script:
// server.ts
import { startServer } from "deepagents-acp";
await startServer({
agents: {
name: "my-agent",
description: "My custom coding agent",
skills: ["./skills/"],
},
});Then point Zed at it:
{
"agent": {
"profiles": {
"my-agent": {
"name": "My Agent",
"command": "npx",
"args": ["tsx", "./server.ts"]
}
}
}
}Open Zed's Agents panel and start a Deep Agents thread.
:::
:::python
If you want to run an ACP agent server as a local dev tool, you can use Toad to manage the process.
uv tool install -U batrachian-toad
toad acp "python path/to/your_server.py" .
# or
toad acp "uv run python path/to/your_server.py" .:::
:::js
Deep Agents is available in the ACP Agent Registry for one-click installation in Zed and JetBrains IDEs. When an ACP client supports the registry, users can discover and install Deep Agents without any manual configuration.
:::
:::js
The CLI is the fastest way to start an ACP server. It requires no code—just run npx deepagents-acp and connect your editor.
npx deepagents-acp [options]| Option | Short | Description |
|---|---|---|
--name <name> |
-n |
Agent name (default: "deepagents") |
--description <desc> |
-d |
Agent description |
--model <model> |
-m |
LLM model (default: "claude-sonnet-4-5-20250929") |
--workspace <path> |
-w |
Workspace root directory (default: cwd) |
--skills <paths> |
-s |
Comma-separated skill paths |
--memory <paths> |
Comma-separated AGENTS.md paths | |
--debug |
Enable debug logging to stderr | |
--help |
-h |
Show help message |
--version |
-v |
Show version |
| Variable | Description |
|---|---|
ANTHROPIC_API_KEY |
API key for Anthropic/Claude models (required) |
OPENAI_API_KEY |
API key for OpenAI models |
DEBUG |
Set to "true" to enable debug logging |
WORKSPACE_ROOT |
Alternative to --workspace flag |
:::
:::js
Convenience function to create and start a server in one call:
import { startServer } from "deepagents-acp";
await startServer({
agents: {
name: "coding-assistant",
description: "AI coding assistant with filesystem access",
},
workspaceRoot: process.cwd(),
});For full control, use the DeepAgentsServer class directly:
| Option | Type | Default | Description |
|---|---|---|---|
agents |
DeepAgentConfig | DeepAgentConfig[] |
required | Agent configuration(s) |
serverName |
string |
"deepagents-acp" |
Server name for ACP |
serverVersion |
string |
"0.0.1" |
Server version |
workspaceRoot |
string |
process.cwd() |
Workspace root directory |
debug |
boolean |
false |
Enable debug logging |
| Option | Type | Description |
|---|---|---|
name |
string |
Unique agent name (required) |
description |
string |
Agent description |
model |
string |
LLM model (default: "claude-sonnet-4-5-20250929") |
tools |
StructuredTool[] |
Custom LangChain tools |
systemPrompt |
string |
Custom system prompt |
middleware |
AgentMiddleware[] |
Custom middleware appended to the Deep Agents stack |
backend |
AnyBackendProtocol |
Filesystem backend |
skills |
string[] |
Skill source paths |
memory |
string[] |
Memory source paths (AGENTS.md) |
interruptOn |
Record<string, boolean | InterruptOnConfig> |
Tools requiring user approval (HITL) |
commands |
Array<{ name, description, input? }> |
Custom slash commands |
:::
:::js
You can expose multiple agents from a single server. The ACP client selects which agent to use when creating a session:
Some ACP clients (like Zed) don't currently expose a UI for selecting between agents. In that case, consider running separate server instances with a single agent each.The server registers built-in slash commands with the IDE: /plan, /agent, /ask, /clear, and /status. You can also define custom commands per agent:
Use interruptOn to require user approval in the IDE before the agent runs sensitive tools:
When the agent calls a protected tool, the IDE prompts the user to allow or reject the operation, with options to remember the decision for the session.
import { startServer } from "deepagents-acp";
await startServer({
agents: {
name: "project-agent",
description: "Agent with project-specific knowledge",
skills: ["./skills/", "~/.deepagents/skills/"],
memory: ["./.deepagents/AGENTS.md"],
},
workspaceRoot: process.cwd(),
});:::
See the upstream ACP docs for protocol details and editor support: - Introduction: https://agentclientprotocol.com/get-started/introduction - Clients/editors: https://agentclientprotocol.com/get-started/clients