Skip to main content

Agent Client Protocol (ACP) Explained: Plug-and-Play AI Agents for Code Editors

·1014 words·5 mins·

New AI agent protocols are continuously emerging. In this article, we’ll explore the latest development in AI agent communication: the Agent Client Protocol (ACP). ACP is an open, pragmatic, JSON RPC-based protocol that standardizes communication between code editors/IDEs(clients) and AI coding agents(servers). This will enable seamless interoperability similar to the Language Server Protocol (LSP) for language tools.

If you use any coding agent like GitHub Copilot, Claude Code, or GPT Codex, you have to install specific plugins/extensions or CLI tools to connect to these agents. This fragmentation creates friction for users and developers alike. ACP aims to solve this by providing a unified protocol that any client can use to communicate with any ACP-compliant client and agent.

ACP logo

Agents that support ACP can work with any compatible editor. Editors that support ACP can connect to the entire ecosystem of ACP-compatible agents. This independence allows both sides to innovate while giving developers the freedom to select the best tools for their workflow.

Key Design Principles
#

ACP is built on several key design principles:

  1. Bidirectional: ACP supports two-way communication, allowing both clients and agents to send requests and notifications.
  2. Streaming: ACP supports streaming responses, enabling agents to provide real-time feedback as they generate code.
  3. Stateful: Sessions maintain conversation history.
  4. Standard I/O: Uses stdin/stdout for simple subprocess communication
  5. JSON-RPC 2.0: Uses the widely adopted JSON-RPC 2.0 protocol for message formatting and transport.

This Agent Client Protocol should not be confused with the Agent Communication Protocol (also ACP) used in multi-agent systems to communicate between agents. That protocol focuses on agent-to-agent communication, while this ACP focuses on client-agent interactions. Another related protocol is the Model Context Protocol (MCP), which deals with managing context information in AI agents.

Zed code editor’s creator, Zed Industries initially experimented with ACP while trying to integrate Google’s Gemini CLI. Their experience highlighted the need for a standardized protocol to avoid building custom integrations for each agent. To address this, they formalized ACP in August 2025, launching it alongside their “Bring Your Own Agent” feature. This allowed users to plug-in external agents directly into Zed, with Gemini CLI serving as the initial reference implementation.

This protocol quickly gained attention from other active members of the AI coding community. JetBrains has also expressed interest in collaborating on ACP to ensure cross-editor compatibility. Them and Zed Industries are working together to refine the protocol and bring it to JetBrains popular IDEs like IntelliJ IDEA, PyCharm, and PhpStorm.

ACP Architecture
#

ACP uses a layered structure that ensures reliability and ease of implementation. The transport layer uses newline-delimited JSON over standard input/output (stdio). This allows agents to run as simple subprocesses created by the editor/IDE. This local execution method improves security by keeping operations within the user’s controlled environment and the editor acting as a gatekeeper for permissions—such as file reads/writes or terminal commands. The protocol layer handles JSON-RPC messaging, supporting requests (expect responses), notifications (one-way updates), and errors. The connection layer manages initialization and optional authentication between the client and agent. The stateful conversations are maintained by the session layer helping to preserve history across interactions. The application layer integrates custom logic for specific agent or editor behaviors. A key design choice of this protocol is “bidirectionality”; editors can send instructions to agents, but agents can also request resources from the editor, like reading a file or creating a terminal session.

Components
#

graph LR
    subgraph Code["Code Editor (Client)"]
        A[ACP Client]
    end
    
    subgraph Agent["AI Agent"]
        B[ACP Agent]
    end
    
    A <-->|stdin/stdout| B
    A <-->|JSON-RPC| B
    
    style Code fill:#e3f2fd,color:#000
    style Agent fill:#fce4ec,color:#000
    style A fill:#64b5f6,color:#fff
    style B fill:#f06292,color:#fff

Layer Stack
#

graph TD
    A["Application Layer
Your agent or client logic"] B["Session Layer
Individual conversation contexts"] C["Connection Layer
Initialization, authentication, session management"] D["Protocol Layer
JSON-RPC message format"] E["Transport Layer
Handles data sent over stdio"] A --> B --> C --> D --> E style A fill:#d4edda,stroke:#333,stroke-width:2px,color:#000 style B fill:#fff3cd,stroke:#333,stroke-width:2px,color:#000 style C fill:#f8d7da,stroke:#333,stroke-width:2px,color:#000 style D fill:#e7d4f5,stroke:#333,stroke-width:2px,color:#000 style E fill:#d1ecf1,stroke:#333,stroke-width:2px,color:#000

MCP Integration
#

ACP is designed to work hand-in-hand with the Model Context Protocol for tool use. When an ACP session starts, the client (Editor/IDE) passes available MCP server endpoints and their credentials to the agent, giving it a toolkit of capabilities. then the agent can then call these tools as a regular MCP calls. These communications all happen using JSON-RPC messages. The client maintains control over actions the agent can perform by asking the user for permission before executing any tool calls.

One special capability of ACP is the ability to use client specific features. This means agents can use features like advanced search or refactoring tools provided by the editor, using the same familiar interface.

Zed Industries has already several SDKs for developers to build ACP-compliant agents and clients.

import * as acp from "@zed-industries/agent-client-protocol";
import { Writable, Readable } from "node:stream";
import { WritableStream, ReadableStream } from "node:stream/web";

// Connect a client to an ACP agent subprocess (see typescript/examples/client.ts)
const input = Writable.toWeb(agentProcess.stdin) as WritableStream;
const output = Readable.toWeb(agentProcess.stdout) as ReadableStream;
const conn = new acp.ClientSideConnection((_agent) => new MyClient(), input, output);

await conn.initialize({
  protocolVersion: acp.PROTOCOL_VERSION,
  clientCapabilities: { fs: { readTextFile: true, writeTextFile: true } },
});

const { sessionId } = await conn.newSession({ cwd: process.cwd(), mcpServers: [] });
const result = await conn.prompt({
  sessionId,
  prompt: [{ type: "text", text: "Hello agent" }],
});
console.log(result.stopReason); 

Future of ACP
#

ACP is still in its early stages, but it has the potential to become the standard way AI coding agents interact with editors and IDEs. It’s a vision how AI agents and developers can collaborate seamlessly. Just as LSP standardized language tooling, ACP could standardize AI agent integration, making it easier for developers to adopt different agents without worrying about compatibility issues.

Follow the ACP project closely. The combination of Zed’s implementation, Google’s Gemini CLI, and JetBrains’ involvement could drive rapid adoption. We can hope for a future where AI coding agents become as plug-and-play as language servers. Get started by reading the introduction, then check the Protocol Overview. Whether you are shipping an agent or an editor, ACP is worth considering.