2026-03-20 13:09:24 +07:00
# Agent Client Protocol (ACP) — Reference Documentation
2026-03-19 15:55:33 +07:00
2026-03-20 13:09:24 +07:00
> Protocol version: v0.11.3 (March 2026)
> Source: agentclientprotocol.com | GitHub: agentclientprotocol/agent-client-protocol
2026-03-19 15:55:33 +07:00
---
2026-03-20 13:09:24 +07:00
## 1. What is ACP?
2026-03-19 15:55:33 +07:00
2026-03-20 13:09:24 +07:00
Agent Client Protocol (ACP) is a protocol that standardizes communication between **code editors/IDEs** (Client) and **AI coding agents** (Agent). Inspired by Language Server Protocol (LSP) — which standardized autocomplete, go-to-definition, etc. for all editors — ACP does the same for AI coding agents.
2026-03-19 15:55:33 +07:00
2026-03-20 13:09:24 +07:00
**Before ACP:** Each agent-editor pair needed its own custom integration → N agents × M editors = N× M integrations.
2026-03-19 15:55:33 +07:00
2026-03-20 13:09:24 +07:00
**After ACP:** An agent implements ACP once → works on every editor that supports ACP. An editor implements ACP once → works with every agent that supports ACP.
2026-03-19 15:55:33 +07:00
2026-03-20 13:09:24 +07:00
## 2. Why is ACP needed?
2026-03-19 15:55:33 +07:00
2026-03-20 13:09:24 +07:00
ACP solves 3 main problems:
2026-03-19 15:55:33 +07:00
2026-03-20 13:09:24 +07:00
- **Integration overhead**: Each new agent-editor combo requires custom work. With ACP, implement once and you're done.
- **Limited compatibility**: Agents only work on certain editors. ACP breaks this limitation.
- **Developer lock-in**: Choosing agent A means being forced to use editor X. ACP allows free combination.
2026-03-19 15:55:33 +07:00
2026-03-20 13:09:24 +07:00
**Relationship with MCP:** MCP (Model Context Protocol) handles **what** — what data and tools the agent accesses. ACP handles **where** — where the agent lives in the developer's workflow. The two protocols complement each other.
2026-03-19 15:55:33 +07:00
2026-03-20 13:09:24 +07:00
## 3. Architecture Overview
2026-03-19 15:55:33 +07:00
```
┌─────────────────────────────────────────────────┐
│ USER (Developer) │
└──────────────────────┬──────────────────────────┘
│
┌──────────────────────▼──────────────────────────┐
│ CLIENT (Code Editor/IDE) │
│ │
2026-03-20 13:09:24 +07:00
│ - Sends user prompts to the Agent │
│ - Renders responses (text, diff, tool calls) │
│ - Manages permissions for tool execution │
│ - Provides filesystem access │
│ - Exposes MCP servers to the Agent │
2026-03-19 15:55:33 +07:00
└──────────────────────┬──────────────────────────┘
│ JSON-RPC
│ (stdio / HTTP / WebSocket)
┌──────────────────────▼──────────────────────────┐
│ AGENT (AI Coding Agent) │
│ │
2026-03-20 13:09:24 +07:00
│ - Receives prompts, calls LLM │
│ - Executes tool calls (edit file, run cmd...) │
│ - Sends realtime updates to Client │
│ - Connects to MCP servers for context │
2026-03-19 15:55:33 +07:00
└─────────────────────────────────────────────────┘
```
### 3.1 Transport Layer
| Mode | Transport | Use case |
|------|-----------|----------|
2026-03-20 13:09:24 +07:00
| **Local** | JSON-RPC over stdio | Agent runs as a subprocess of the editor |
| **Remote** | HTTP or WebSocket | Agent runs on a separate cloud/server |
2026-03-19 15:55:33 +07:00
2026-03-20 13:09:24 +07:00
**Local mode** is the most common currently. The editor launches the agent process and communicates via stdin/stdout. A single connection can manage multiple sessions simultaneously.
2026-03-19 15:55:33 +07:00
2026-03-20 13:09:24 +07:00
**Remote mode** is being further developed, suitable for enterprise deployment or shared agent infrastructure.
2026-03-19 15:55:33 +07:00
### 3.2 Trust Model
2026-03-20 13:09:24 +07:00
ACP works best when the editor communicates with a **trusted agent** . The user still retains control:
2026-03-19 15:55:33 +07:00
- Approve/reject tool execution
2026-03-20 13:09:24 +07:00
- Control filesystem access
- Manage MCP server configurations
2026-03-19 15:55:33 +07:00
2026-03-20 13:09:24 +07:00
## 4. Detailed Protocol Flow
2026-03-19 15:55:33 +07:00
### 4.1 Initialization (Handshake)
2026-03-20 13:09:24 +07:00
When the editor connects to the agent, the initialization process occurs:
2026-03-19 15:55:33 +07:00
```
Client Agent
│ │
│──── initialize ──────────────────►│
│ { │
│ protocolVersion: 1, │
│ clientCapabilities: {...}, │
│ name: "my-editor", │
│ version: "1.0" │
│ } │
│ │
│◄──── initialize response ────────│
│ { │
│ protocolVersion: 1, │
│ agentCapabilities: {...}, │
│ name: "my-agent", │
│ version: "2.0" │
│ } │
│ │
```
2026-03-20 13:09:24 +07:00
**Client Capabilities (declared by the editor):**
- `fileSystem.readTextFile` — allows the agent to read files
- `fileSystem.writeTextFile` — allows the agent to write files
- `terminal` — allows the agent to run shell commands
2026-03-19 15:55:33 +07:00
2026-03-20 13:09:24 +07:00
**Agent Capabilities (declared by the agent):**
- `loadSession` — supports reloading previous sessions
- `promptCapabilities` — supported content types: Image, Audio, embedded context
- `mcp` — supports HTTP/SSE transport for MCP
- Session methods — supported operations (list, fork, configure...)
2026-03-19 15:55:33 +07:00
2026-03-20 13:09:24 +07:00
**Version Negotiation:** Protocol version is an integer (MAJOR version). If there's a mismatch, the agent returns the highest version it supports. The client should close the connection if incompatible.
2026-03-19 15:55:33 +07:00
2026-03-20 13:09:24 +07:00
### 4.2 Prompt Turn (Main Loop)
2026-03-19 15:55:33 +07:00
2026-03-20 13:09:24 +07:00
This is the core interaction cycle. Each prompt turn consists of 6 steps:
2026-03-19 15:55:33 +07:00
```
Client Agent LLM
│ │ │
│─── session/prompt ──────────────►│ │
│ { user message + resources } │ │
│ │─── forward prompt ──►│
│ │ │
│ │◄── response ─────────│
│ │ (text + tool calls)│
│◄── session/update (notification)─│ │
│ { plan, text, tool calls } │ │
│ │ │
2026-03-20 13:09:24 +07:00
│ [If there's a tool call] │ │
2026-03-19 15:55:33 +07:00
│◄── permission request ───────────│ │
│──── permission response ────────►│ │
│ │── execute tool ──────►│
│◄── session/update (tool status)──│ │
│ { in_progress / completed } │ │
│ │ │
│ [Tool result → LLM → loop] │ │
│ │ │
│◄── session/prompt response ──────│ │
│ { StopReason } │ │
```
**Stop Reasons:**
2026-03-20 13:09:24 +07:00
- `end_turn` — Completed normally
- `max_tokens` — Token limit reached
- `max_turn_requests` — Exceeded maximum model call count
- `refusal` — Agent refused to continue
- `cancelled` — Client cancelled the turn
2026-03-19 15:55:33 +07:00
### 4.3 Session Management
```
2026-03-20 13:09:24 +07:00
session/new → Create a new session
session/prompt → Send a prompt
session/update → Agent sends update (notification)
session/cancel → Cancel processing
session/list → List sessions
session/load → Reload a previous session
session/fork → Fork a session (branching)
session/configure → Configure a session
2026-03-19 15:55:33 +07:00
```
## 5. MCP Integration
2026-03-20 13:09:24 +07:00
ACP integrates tightly with MCP:
2026-03-19 15:55:33 +07:00
2026-03-20 13:09:24 +07:00
- The editor passes MCP server configs to the Agent during initialization
- The agent connects directly to MCP servers
- When the editor exposes tools via MCP, it deploys a **proxy tunnel** — routing requests back to the editor
- Supports both stdio-based and HTTP/SSE MCP transport
2026-03-19 15:55:33 +07:00
```
Editor ──(ACP)──► Agent ──(MCP)──► MCP Server (DB, API, tools...)
│ ▲
2026-03-20 13:09:24 +07:00
└──── proxy tunnel (for editor tools)──┘
2026-03-19 15:55:33 +07:00
```
2026-03-20 13:09:24 +07:00
## 6. Current Ecosystem
2026-03-19 15:55:33 +07:00
2026-03-20 13:09:24 +07:00
### 6.1 Editors supporting ACP (Clients)
2026-03-19 15:55:33 +07:00
- **Zed** — Native ACP support
2026-03-20 13:09:24 +07:00
- **JetBrains IDEs** — Via AI Assistant plugin
2026-03-19 15:55:33 +07:00
- **Neovim** — Community plugin
- **Marimo** — Notebook editor
2026-03-20 13:09:24 +07:00
- **Cursor** — ACP documentation available
2026-03-19 15:55:33 +07:00
2026-03-20 13:09:24 +07:00
### 6.2 Agents supporting ACP (40+)
2026-03-19 15:55:33 +07:00
- **Claude Code** (Anthropic)
- **Codex CLI** (OpenAI)
- **Gemini** (Google)
- **Goose** (Block)
2026-03-20 13:09:24 +07:00
- **GitHub Copilot** (public preview since Jan 2026)
2026-03-19 15:55:33 +07:00
- **Cline**, **OpenHands** , **Factory Droid** , **Docker cagent**
2026-03-20 13:09:24 +07:00
- And many more...
2026-03-19 15:55:33 +07:00
### 6.3 Official SDKs
| Language | Package | Registry |
|----------|---------|----------|
| Rust | `agent-client-protocol` | crates.io |
| TypeScript | `@agentclientprotocol/sdk` | npm |
| Python | `python-sdk` | PyPI |
| Java | `java-sdk` | Maven |
| Kotlin | `acp-kotlin` | Maven (JVM) |
2026-03-20 13:09:24 +07:00
## 7. Approaches for Building Products
2026-03-19 15:55:33 +07:00
2026-03-20 13:09:24 +07:00
### 7.1 Build a New Agent
2026-03-19 15:55:33 +07:00
2026-03-20 13:09:24 +07:00
If you want to create your own AI coding agent:
2026-03-19 15:55:33 +07:00
2026-03-20 13:09:24 +07:00
**Approach:**
1. Choose an appropriate SDK (TypeScript or Python are most common)
2. Implement the ACP protocol: initialize handshake, prompt turn loop, session management
3. Connect an LLM backend (OpenAI, Anthropic, local model...)
2026-03-19 15:55:33 +07:00
4. Implement tool execution (file edit, terminal, search...)
2026-03-20 13:09:24 +07:00
5. The agent automatically becomes compatible with all ACP-supporting editors
2026-03-19 15:55:33 +07:00
2026-03-20 13:09:24 +07:00
**Example use cases:**
- An agent specialized for a specific language/framework
- An agent integrated with company-specific tools (CI/CD, internal APIs)
- An agent with specialized reasoning (security audit, performance optimization)
2026-03-19 15:55:33 +07:00
2026-03-20 13:09:24 +07:00
### 7.2 Build a New Editor/Client
2026-03-19 15:55:33 +07:00
2026-03-20 13:09:24 +07:00
If you want to create an IDE or coding tool:
2026-03-19 15:55:33 +07:00
2026-03-20 13:09:24 +07:00
**Approach:**
1. Implement the ACP client protocol
2. Support local agent launch (subprocess + stdio)
2026-03-19 15:55:33 +07:00
3. Render agent output (markdown text, diffs, tool status)
2026-03-20 13:09:24 +07:00
4. Implement permission UI for tool execution
5. Automatically compatible with all ACP agents
2026-03-19 15:55:33 +07:00
2026-03-20 13:09:24 +07:00
### 7.3 Build an Agent Platform / Registry
2026-03-19 15:55:33 +07:00
2026-03-20 13:09:24 +07:00
**Idea:** A marketplace or registry where developers discover, install, and manage ACP agents.
2026-03-19 15:55:33 +07:00
2026-03-20 13:09:24 +07:00
**Reference:** ACP already has a Registry concept — you can build on that or create your own curated experience.
2026-03-19 15:55:33 +07:00
### 7.4 Build Enterprise Agent Infrastructure
2026-03-20 13:09:24 +07:00
**Idea:** Remote ACP agent hosting for teams/enterprises:
- Shared agent instances on a server
2026-03-19 15:55:33 +07:00
- Centralized MCP server management
- Usage tracking, audit logs
- Custom tool permissions per team/role
2026-03-20 13:09:24 +07:00
### 7.5 Build an Agent Development Framework
2026-03-19 15:55:33 +07:00
2026-03-20 13:09:24 +07:00
**Idea:** A framework that makes it easy for developers to build ACP agents:
2026-03-19 15:55:33 +07:00
- Boilerplate handling (protocol, session management)
2026-03-20 13:09:24 +07:00
- Plugin system for tools
2026-03-19 15:55:33 +07:00
- Testing utilities
- Deployment tools (local + remote)
2026-03-20 13:09:24 +07:00
### 7.6 Bridge ACP with Non-Coding Domains
2026-03-19 15:55:33 +07:00
2026-03-20 13:09:24 +07:00
ACP currently focuses on coding, but this pattern can be applied to:
2026-03-19 15:55:33 +07:00
- Document editing agents
- Design tool agents
- Data analysis agents
- DevOps/infrastructure agents
2026-03-20 13:09:24 +07:00
## 8. Technical Notes for Implementation
2026-03-19 15:55:33 +07:00
### 8.1 JSON-RPC Basics
2026-03-20 13:09:24 +07:00
ACP uses JSON-RPC 2.0. Each message has the following format:
2026-03-19 15:55:33 +07:00
```json
// Request
{
"jsonrpc": "2.0",
"id": 1,
"method": "session/prompt",
"params": { ... }
}
// Response
{
"jsonrpc": "2.0",
"id": 1,
"result": { ... }
}
// Notification (no id, no response expected)
{
"jsonrpc": "2.0",
"method": "session/update",
"params": { ... }
}
```
### 8.2 Content Types
2026-03-20 13:09:24 +07:00
Text defaults to **Markdown** . Additionally supports:
2026-03-19 15:55:33 +07:00
- Image content
- Audio content
- Embedded context (file references)
### 8.3 MCP Type Reuse
2026-03-20 13:09:24 +07:00
ACP reuses JSON structures from MCP when possible, but adds custom types for coding-specific features like diff display.
2026-03-19 15:55:33 +07:00
### 8.4 Feature Flags
2026-03-20 13:09:24 +07:00
The protocol uses feature flags to indicate features under development. Check agent capabilities in the initialize response.
2026-03-19 15:55:33 +07:00
## 9. Resources
- **Specification:** https://agentclientprotocol.com
- **GitHub:** https://github.com/agentclientprotocol/agent-client-protocol
- **LLM-friendly docs:** https://agentclientprotocol.com/llms.txt
2026-03-20 13:09:24 +07:00
- **OpenAPI spec:** Available in the repo
- **SDKs:** See section 6.3
2026-03-19 15:55:33 +07:00
- **License:** Apache 2.0
2026-03-20 13:09:24 +07:00
- **RFDs (Requests for Dialog):** Official process for proposing protocol changes
2026-03-19 15:55:33 +07:00
2026-03-20 13:09:24 +07:00
## 10. Quick Summary
2026-03-19 15:55:33 +07:00
2026-03-20 13:09:24 +07:00
| Concept | Explanation |
|---------|-------------|
| ACP | Protocol standardizing editor ↔ agent communication |
2026-03-19 15:55:33 +07:00
| Client | Code editor/IDE (Zed, JetBrains, Neovim...) |
| Agent | AI coding tool (Claude Code, Codex, Gemini...) |
2026-03-20 13:09:24 +07:00
| Transport | stdio (local) or HTTP/WebSocket (remote) |
2026-03-19 15:55:33 +07:00
| Protocol | JSON-RPC 2.0 |
2026-03-20 13:09:24 +07:00
| Session | A working session between client and agent |
| Prompt Turn | A complete request-response cycle |
| MCP | Complementary protocol — provides data/tools to the agent |
2026-03-19 15:55:33 +07:00
| SDK | Rust, TypeScript, Python, Java, Kotlin |
| License | Apache 2.0 |