ACP (Agent Client Protocol) server for DeepAgents - enables integration with IDEs like Zed, JetBrains, and other ACP-compatible clients.
This package wraps DeepAgents with the Agent Client Protocol (ACP), allowing your AI agents to communicate with code editors and development tools through a standardized protocol.
The Agent Client Protocol is an open standard for communication between code editors and AI-powered coding agents — similar to what LSP did for language servers. It enables:
npm install deepagents-acp
# or
pnpm add deepagents-acp
The easiest way to start is with the CLI:
# Run with defaults
npx deepagents-acp
# With custom options
npx deepagents-acp --name my-agent --debug
# Full options
npx deepagents-acp \
--name coding-assistant \
--model claude-sonnet-4-5-20250929 \
--workspace /path/to/project \
--skills ./skills,~/.deepagents/skills \
--debug
| 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 |
import { startServer } from "deepagents-acp";
await startServer({
agents: {
name: "coding-assistant",
description: "AI coding assistant with filesystem access",
},
workspaceRoot: process.cwd(),
});
import { DeepAgentsServer } from "deepagents-acp";
import { FilesystemBackend } from "deepagents";
const server = new DeepAgentsServer({
// Define multiple agents
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",
model: "claude-sonnet-4-5-20250929",
systemPrompt: "You are a code review expert...",
},
],
// Server options
serverName: "my-deepagents-acp",
serverVersion: "1.0.0",
workspaceRoot: process.cwd(),
debug: true,
});
await server.start();
When you define multiple agents, the client selects which agent to use at session creation time by passing configOptions.agent in the session/new ACP request. If not specified, the first agent in the configuration is used by default.
// Client sends session/new with configOptions to select an agent:
// { "configOptions": { "agent": "reviewer" } } → uses the "reviewer" agent
// { "configOptions": { "agent": "code-agent" } } → uses the "code-agent" agent
// { } → uses the first agent ("code-agent")
Note: Some ACP clients (like Zed) don't currently expose a UI for passing
configOptionsat session creation. In that case, consider running separate server instances with a single agent each, or using separate Zed profiles pointing to different server scripts.
To use with Zed, add the agent to your settings (~/.config/zed/settings.json on Linux, ~/Library/Application Support/Zed/settings.json on macOS):
{
"agent": {
"profiles": {
"deepagents": {
"name": "DeepAgents",
"command": "npx",
"args": ["deepagents-acp"]
}
}
}
}
{
"agent": {
"profiles": {
"deepagents": {
"name": "DeepAgents",
"command": "npx",
"args": [
"deepagents-acp",
"--name",
"my-assistant",
"--skills",
"./skills",
"--debug"
],
"env": {
"ANTHROPIC_API_KEY": "sk-ant-..."
}
}
}
}
}
For more control, create a custom script:
// server.ts
import { startServer } from "deepagents-acp";
await startServer({
agents: {
name: "my-agent",
description: "My custom coding agent",
skills: ["./skills/"],
},
});
Then configure Zed:
{
"agent": {
"profiles": {
"my-agent": {
"name": "My Agent",
"command": "npx",
"args": ["tsx", "./server.ts"]
}
}
}
}
The main server class that handles ACP communication.
import { DeepAgentsServer } from "deepagents-acp";
const server = new DeepAgentsServer(options);
| Option | Type | Description |
|---|---|---|
agents |
DeepAgentConfig \| DeepAgentConfig[] |
Agent configuration(s) |
serverName |
string |
Server name for ACP (default: "deepagents-acp") |
serverVersion |
string |
Server version (default: "0.0.1") |
workspaceRoot |
string |
Workspace root directory (default: cwd) |
debug |
boolean |
Enable debug logging (default: false) |
| 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 tools |
systemPrompt |
string |
Custom system prompt |
middleware |
AgentMiddleware[] |
Custom middleware |
backend |
BackendProtocol \| BackendFactory |
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 |
Start the ACP server. Listens on stdio by default.
await server.start();
Stop the server and cleanup.
server.stop();
Convenience function to create and start a server.
import { startServer } from "deepagents-acp";
const server = await startServer(options);
The server provides built-in slash commands accessible from the IDE's prompt input. Type / to see available commands:
| Command | Description |
|---|---|
/plan |
Switch to plan mode (read-only planning) |
/agent |
Switch to agent mode (full autonomous) |
/ask |
Switch to ask mode (Q&A, no file changes) |
/clear |
Clear conversation context and start fresh |
/status |
Show session status and loaded skills |
You can also 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" },
],
},
});
The server supports three operating modes, switchable via slash commands or programmatically:
agent): Full autonomous agent with file accessplan): Planning and discussion without changesask): Q&A without file modificationsWhen using models with extended thinking (e.g., Claude with thinking: { type: "enabled" }), the server streams reasoning tokens to the IDE as thought_message_chunk updates. This gives users visibility into the agent's chain-of-thought process in clients that support it.
The server provides rich tool call reporting to the IDE:
read, edit, search, execute, think, etc.) so the IDE can display appropriate iconsread_file, edit_file, grep) report { path, line } locations, enabling IDEs to open and highlight the files the agent is working with in real time{ type: "diff", path, oldText, newText } content so the IDE can render inline diffsWhen agents are configured with interruptOn, the server bridges LangGraph's interrupt system to the ACP session/request_permission protocol. This surfaces approval prompts in the IDE before sensitive tools execute:
const server = new DeepAgentsServer({
agents: {
name: "careful-agent",
interruptOn: {
execute: { allowedDecisions: ["approve", "edit", "reject"] },
write_file: true,
},
},
});
When the agent calls a protected tool, the IDE shows a permission dialog with options:
When the ACP client supports the terminal capability (e.g., Zed, JetBrains), the server uses the client's terminal for execute tool calls instead of running commands locally. This provides:
If the client doesn't support terminals, commands fall back to local execution (current behavior).
Sessions are persisted using LangGraph's checkpointer. When loading a session with session/load, the server replays the full conversation history back to the client via ACP notifications, including:
This ensures the IDE shows the complete conversation when resuming a session.
When the ACP client advertises fs.readTextFile and fs.writeTextFile capabilities, the server can proxy file operations through the client instead of reading/writing directly from disk. This enables:
Falls back to local filesystem operations for ls, glob, and grep which have no ACP equivalents.
This package implements the following ACP methods:
| Method | Description |
|---|---|
initialize |
Negotiate versions and capabilities |
authenticate |
Handle authentication (passthrough) |
session/new |
Create a new conversation session |
session/load |
Resume an existing session with full history replay |
session/prompt |
Process user prompts and slash commands |
session/cancel |
Cancel ongoing operations |
session/set_mode |
Switch agent modes |
| Method | Description |
|---|---|
session/request_permission |
Prompt user to approve/reject tool calls |
fs/read_text_file |
Read file contents (including unsaved buffers) |
fs/write_text_file |
Write file contents through the IDE |
terminal/create |
Start a command in the client's terminal |
terminal/output |
Get terminal output |
terminal/wait_for_exit |
Wait for command completion |
terminal/kill |
Kill a running command |
terminal/release |
Release terminal resources |
| Update | Description |
|---|---|
agent_message_chunk |
Stream agent text responses |
thought_message_chunk |
Stream agent thinking/reasoning |
tool_call |
Notify about tool invocations with kind, locations, and input |
tool_call_update |
Update tool call status with content (text, diffs, terminals) |
plan |
Send task plan entries |
available_commands_update |
Advertise slash commands to the client |
The server advertises these capabilities:
loadSession: Session persistence with history replaypromptCapabilities.image: Image content supportpromptCapabilities.embeddedContext: Embedded context supportsessionCapabilities.modes: Agent mode switchingsessionCapabilities.commands: Slash command supportTool calls are categorized with ACP-standard kinds for proper icon display:
| Kind | Tools |
|---|---|
read |
read_file, ls |
search |
grep, glob |
edit |
write_file, edit_file |
execute |
execute, shell |
think |
write_todos |
other |
task, custom tools |
┌─────────────────────────────────────────────────────────────┐
│ IDE (Zed, JetBrains) │
│ ACP Client │
└─────────────────────┬───────────────────────────────────────┘
│ stdio (JSON-RPC 2.0)
▼
┌─────────────────────────────────────────────────────────────┐
│ deepagents-acp │
│ ┌─────────────────────────────────────────────────────┐ │
│ │ AgentSideConnection │ │
│ │ (from @agentclientprotocol/sdk) │ │
│ └─────────────────────┬───────────────────────────────┘ │
│ │ │
│ ┌─────────────────────▼───────────────────────────────┐ │
│ │ Message Adapter │ │
│ │ ACP ContentBlock ←→ LangChain Messages │ │
│ └─────────────────────┬───────────────────────────────┘ │
│ │ │
│ ┌─────────────────────▼───────────────────────────────┐ │
│ │ DeepAgent │ │
│ │ (from deepagents package) │ │
│ └─────────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────┘
import { DeepAgentsServer } from "deepagents-acp";
import { CompositeBackend, FilesystemBackend, StateBackend } from "deepagents";
const server = new DeepAgentsServer({
agents: {
name: "custom-agent",
backend: new CompositeBackend({
routes: [
{
prefix: "/workspace",
backend: new FilesystemBackend({ rootDir: "./workspace" }),
},
{ prefix: "/", backend: (config) => new StateBackend(config) },
],
}),
},
});
import { DeepAgentsServer } from "deepagents-acp";
import { tool } from "@langchain/core/tools";
import { z } from "zod";
const searchTool = tool(
async ({ query }) => {
// Search implementation
return `Results for: ${query}`;
},
{
name: "search",
description: "Search the codebase",
schema: z.object({ query: z.string() }),
},
);
const server = new DeepAgentsServer({
agents: {
name: "search-agent",
tools: [searchTool],
},
});
import { DeepAgentsServer } from "deepagents-acp";
const server = new DeepAgentsServer({
agents: {
name: "safe-agent",
description: "Agent that asks before writing or executing",
interruptOn: {
write_file: true,
edit_file: true,
execute: {
allowedDecisions: ["approve", "edit", "reject"],
},
},
},
});
When the agent tries to write a file or run a command, the IDE will prompt the user to approve, reject, or always-allow the operation.
import { DeepAgentsServer } from "deepagents-acp";
const server = new DeepAgentsServer({
agents: {
name: "project-agent",
commands: [
{ name: "test", description: "Run the project test suite" },
{ name: "build", description: "Build the project" },
{
name: "deploy",
description: "Deploy to staging",
input: { hint: "environment (staging or production)" },
},
],
},
});
DeepAgents is available in the ACP Agent Registry for one-click installation in Zed and JetBrains IDEs. The registry manifest is at agent.json:
{
"id": "deepagents",
"name": "DeepAgents",
"description": "Batteries-included AI coding agent powered by LangChain.",
"distribution": {
"npx": {
"package": "deepagents-acp"
}
}
}
See the main deepagentsjs repository for contribution guidelines.
MIT
Backend that proxies read/write through ACP client while using local
Backend that proxies read/write through ACP client while using local
DeepAgents ACP Server
Logger class for DeepAgents ACP Server
Logger class for DeepAgents ACP Server
DeepAgents ACP Server
Convert ACP content blocks to LangChain message content
Convert ACP prompt content blocks to a LangChain HumanMessage
Extract file locations from tool call arguments for ACP follow-along
Extract tool calls from LangChain AIMessage
Parse file URI to absolute path
Format tool call title for ACP display
Generate a unique session ID
Generate a unique tool call ID
Determine the kind of tool call for ACP display
Convert LangChain message content to ACP content blocks
Convert LangChain BaseMessage to ACP content blocks
Convert absolute path to file URI
Convert todo list state to ACP plan entries
Convert ACP prompt content blocks to a LangChain HumanMessage
Create a logger instance
Extract file locations from tool call arguments for ACP follow-along
Extract tool calls from LangChain AIMessage
Parse file URI to absolute path
Format tool call title for ACP display
Generate a unique session ID
Generate a unique tool call ID
Determine the kind of tool call for ACP display
Convert LangChain message content to ACP content blocks
Convert LangChain BaseMessage to ACP content blocks
Convert absolute path to file URI
Create and start a DeepAgents ACP server
Convert todo list state to ACP plan entries
Create a logger instance
Create and start a DeepAgents ACP server