The DeepAgentsServer class is the core of the ACP integration. It wraps DeepAgents with the Agent Client Protocol, enabling communication with IDEs like Zed, JetBrains, and other ACP-compatible clients.
Learn more: For the ACP specification, see agentclientprotocol.com.
import { DeepAgentsServer } from "deepagents-acp";
const server = new DeepAgentsServer({
agents: {
name: "coding-assistant",
description: "AI coding assistant with filesystem access",
},
workspaceRoot: process.cwd(),
});
await server.start();
startServerimport { startServer } from "deepagents-acp";
await startServer({
agents: {
name: "my-agent",
description: "My coding assistant",
},
});
Define multiple agents and let the client select at session creation time:
const server = new DeepAgentsServer({
agents: [
{
name: "code-agent",
description: "Full-featured coding assistant",
model: "claude-sonnet-4-5-20250929",
skills: ["./skills/"],
memory: ["./.deepagents/AGENTS.md"],
},
{
name: "reviewer",
description: "Code review specialist",
systemPrompt: "You are a code review expert...",
},
],
workspaceRoot: process.cwd(),
debug: true,
});
The server supports three operating modes, switchable via slash commands or the ACP session/set_mode request:
| Mode | Description |
|---|---|
agent |
Full autonomous agent with file access |
plan |
Planning and discussion without file changes |
ask |
Q&A without file modifications |
Built-in slash commands are available from the IDE prompt:
| Command | Description |
|---|---|
/plan |
Switch to plan mode |
/agent |
Switch to agent mode |
/ask |
Switch to ask mode |
/clear |
Clear conversation context and start fresh |
/status |
Show session status and loaded skills |
Define custom slash commands per agent:
const server = new DeepAgentsServer({
agents: {
name: "my-agent",
commands: [
{ name: "test", description: "Run the project's test suite" },
{ name: "lint", description: "Run linter and fix issues" },
],
},
});
Configure tools that require user approval before execution:
const server = new DeepAgentsServer({
agents: {
name: "safe-agent",
interruptOn: {
write_file: true,
edit_file: true,
execute: {
allowedDecisions: ["approve", "edit", "reject"],
},
},
},
});
When a protected tool is invoked, the IDE shows a permission dialog with options: Allow once, Reject, Always allow, Always reject.
When the ACP client advertises fs.readTextFile and fs.writeTextFile capabilities, the server proxies file operations through the client instead of reading/writing directly from disk:
Falls back to local FilesystemBackend for operations without ACP equivalents (ls, glob, grep).
The server provides rich tool call reporting to the IDE:
read, edit, search, execute, think) for appropriate icon display{ path, line } locations, enabling IDEs to follow along in real timeSessions are persisted using LangGraph's checkpointer. When loading a session with session/load, the server replays the full conversation history including user messages, agent responses, tool calls, and plan entries.
Configuration for a DeepAgent exposed via ACP
Extends CreateDeepAgentParams from deepagents with ACP-specific fields.
The name field is required for ACP session routing.
Server configuration options
ACP Session state
Tool call tracking for ACP updates
ACP capability flags
Events emitted by the server