Agent Client Protocol (ACP) 标准化了 coding agents 与代码编辑器或 IDE 之间的通信。 借助 ACP protocol,你可以在任何兼容 ACP 的 client 中使用自定义 deep agents,让代码编辑器提供项目上下文并接收丰富更新。
ACP 专为 agent-editor 集成而设计。如果你希望 agent 调用外部服务器托管的工具,请参阅 Model Context Protocol (MCP)

快速开始

安装 ACP 集成包:
pip install deepagents-acp
然后通过 ACP 暴露 deep agent。 这会以 stdio 模式启动 ACP server,也就是从 stdin 读取请求,并向 stdout 写入响应。实践中,你通常会把它作为 ACP client(例如编辑器)启动的命令运行,然后 client 通过 stdio 与 server 通信。
import asyncio

from acp import run_agent
from deepagents import create_deep_agent
from langgraph.checkpoint.memory import MemorySaver

from deepagents_acp.server import AgentServerACP


async def main() -> None:
    agent = create_deep_agent(
        model="google_genai:gemini-3.5-flash",
        # You can customize your deep agent here: set a custom prompt,
        # add your own tools, attach middleware, or compose subagents.
        system_prompt="You are a helpful coding assistant",
        checkpointer=MemorySaver(),
    )

    server = AgentServerACP(agent)
    await run_agent(server)


if __name__ == "__main__":
    asyncio.run(main())

Example coding agent

deepagents-acp 包包含一个带 filesystem 和 shell 的示例 coding agent,可以开箱运行。

Clients

只要能运行 ACP agent server,就可以使用 deep agents。一些值得注意的 ACP clients 包括:

Zed

deepagents repo 包含一个演示 ACP entrypoint,你可以将其注册到 Zed
  1. 克隆 deepagents repo 并安装依赖:
git clone https://github.com/langchain-ai/deepagents.git
cd deepagents/libs/acp
uv sync --all-groups
chmod +x run_demo_agent.sh
  1. 为 demo agent 配置凭据:
cp .env.example .env
然后在 .env 中设置 ANTHROPIC_API_KEY
  1. 在 Zed 的 settings.json 中配置 ACP agent server command:
{
  "agent_servers": {
    "DeepAgents": {
      "type": "custom",
      "command": "/your/absolute/path/to/deepagents/libs/acp/run_demo_agent.sh"
    }
  }
}
  1. 打开 Zed 的 Agents panel,并启动一个 Deep Agents thread。

Toad

如果你想把 ACP agent server 作为本地开发工具运行,可以使用 Toad 管理该进程。
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" .
协议详情和编辑器支持请参阅上游 ACP 文档: