Agent Client Protocol (ACP) - Standardized communication between code editors and AI coding agents...
The Agent Client Protocol (ACP) is a standardized communication framework between code editors (IDEs) and AI coding agents, similar to how the Language Server Protocol (LSP) unified language server integration. ACP enables any compatible agent to work with any compatible editor without custom integrations.
Core Value Proposition: Build once, run everywhere - agents implementing ACP work with any compatible editor, and editors supporting ACP gain access to all ACP-compatible agents.
This skill should be triggered when:
Before ACP:
After ACP:
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β LOCAL DEPLOYMENT β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β ββββββββββββ JSON-RPC/stdio ββββββββββββββββββββββββ β
β β Editor βββββββββββββββββββΊβ Agent (subprocess) β β
β β (Zed) β β (Claude Code) β β
β ββββββββββββ ββββββββββββββββββββββββ β
β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β REMOTE DEPLOYMENT β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β ββββββββββββ HTTP/WebSocket ββββββββββββββββββββββββ β
β β Editor βββββββββββββββββββΊβ Cloud Agent β β
β β β β (remote server) β β
β ββββββββββββ ββββββββββββββββββββββββ β
β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
| Agent | Description |
|---|---|
| Claude Code | Anthropic's coding agent (via Zed adapter) |
| Gemini CLI | Google's AI coding assistant |
| Goose | Block's open-source coding agent |
| OpenHands | Open-source AI software engineer |
| Codex CLI | OpenAI's coding agent (via adapter) |
| Augment Code | AI pair programming |
| Blackbox AI | Code generation agent |
| Docker cagent | Containerized agent |
| Mistral Vibe | Mistral AI coding assistant |
| Qwen Code | Alibaba's coding agent |
| JetBrains Junie | JetBrains AI agent (coming soon) |
| fast-agent | Lightweight ACP agent |
| OpenCode | Open-source coding agent |
| Stakpak | Infrastructure agent |
| VT Code | Visual coding agent |
| AgentPool | Multi-agent pool |
| Code Assistant | General coding assistant |
| Kimi CLI | Moonshot AI agent |
| Client | Platform |
|---|---|
| Zed | Native desktop editor |
| JetBrains | IntelliJ IDEA, PyCharm, WebStorm, etc. |
| Neovim | Via CodeCompanion or avante.nvim |
| Emacs | Via agent-shell.el |
| Obsidian | Via Agent Client plugin |
| marimo notebook | Python notebook |
| DeepChat | Chat interface |
| DuckDB | Via sidequery extension |
| Agmente | iOS client |
| AionUi | Web UI |
| aizen | CLI client |
| Tidewave | Phoenix LiveView |
| Toad | Database client |
| Web Browser | Via AI SDK provider |
| Sidequery | Coming soon |
ACP uses JSON-RPC 2.0 with two message types:
// Methods: Request-Response pairs
interface Request {
jsonrpc: "2.0";
id: string | number;
method: string;
params?: object;
}
interface Response {
jsonrpc: "2.0";
id: string | number;
result?: any;
error?: { code: number; message: string; data?: any };
}
// Notifications: One-way messages (no response)
interface Notification {
jsonrpc: "2.0";
method: string;
params?: object;
}
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β SESSION LIFECYCLE β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
1. INITIALIZATION
Client ββinitializeβββΊ Agent
Client βββcapabilitiesββ Agent
Client ββauthenticateβββΊ Agent (if required)
2. SESSION SETUP
Client ββsession/newβββΊ Agent (new conversation)
OR
Client ββsession/loadβββΊ Agent (resume existing)
3. PROMPT TURN CYCLE (repeats)
Client ββsession/promptβββΊ Agent
Agent ββsession/updateβββΊ Client (streaming)
Agent ββrequest_permissionβββΊ Client (if needed)
Client βββresponseββ Agent
4. TERMINATION
Client ββsession/cancelβββΊ Agent (interrupt)
OR
Connection closes
| Method | Purpose |
|---|---|
initialize |
Negotiate protocol version and capabilities |
authenticate |
Validate client credentials |
session/new |
Create new conversation session |
session/prompt |
Process user input |
| Method | Purpose |
|---|---|
session/request_permission |
Get user authorization for tool execution |
fs/read_text_file |
Read file contents |
fs/write_text_file |
Write/create files |
ACP defines structured content blocks for data exchange:
{
"type": "text",
"text": "Hello, I can help you with your code."
}
{
"type": "image",
"mimeType": "image/png",
"data": "base64encodeddata..."
}
{
"type": "audio",
"mimeType": "audio/wav",
"data": "base64encodedaudio..."
}
{
"type": "resource",
"resource": {
"uri": "file:///path/to/file.ts",
"mimeType": "text/typescript",
"text": "const x = 1;"
}
}
{
"type": "resource_link",
"uri": "file:///path/to/document.pdf",
"name": "document.pdf",
"mimeType": "application/pdf",
"size": 1024000
}
Agents report tool invocations via session/update:
{
"jsonrpc": "2.0",
"method": "session/update",
"params": {
"sessionId": "session-123",
"update": {
"type": "tool_call",
"toolCallId": "tc-456",
"title": "Reading configuration file",
"kind": "read",
"status": "pending"
}
}
}
| Kind | Description |
|---|---|
read |
Reading files or data |
edit |
Modifying existing content |
delete |
Removing files/resources |
move |
Moving/renaming files |
search |
Searching codebase |
execute |
Running commands |
think |
Agent reasoning |
fetch |
HTTP requests |
other |
Custom operations |
pending βββΊ in_progress βββΊ completed
β
ββββΊ failed
{
"jsonrpc": "2.0",
"id": 1,
"method": "session/request_permission",
"params": {
"sessionId": "session-123",
"toolCallId": "tc-456",
"options": [
{ "label": "Allow", "action": "allow" },
{ "label": "Always Allow", "action": "allow_always" },
{ "label": "Deny", "action": "deny" }
]
}
}
// Request
{
"jsonrpc": "2.0",
"id": 1,
"method": "fs/read_text_file",
"params": {
"sessionId": "session-123",
"path": "/absolute/path/to/file.ts",
"line": 1,
"limit": 100
}
}
// Response
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"content": "const x = 1;\nconst y = 2;\n..."
}
}
// Request
{
"jsonrpc": "2.0",
"id": 2,
"method": "fs/write_text_file",
"params": {
"sessionId": "session-123",
"path": "/absolute/path/to/newfile.ts",
"content": "export const config = {};"
}
}
// Response (success)
{
"jsonrpc": "2.0",
"id": 2,
"result": null
}
clientCapabilities.fs before usingAgents can operate in different modes affecting behavior:
| Mode | Description |
|---|---|
| Ask | Request permission before any changes |
| Architect | Design and plan without implementation |
| Code | Full tool access for code modifications |
Client-initiated:
{
"jsonrpc": "2.0",
"id": 1,
"method": "session/set_mode",
"params": {
"sessionId": "session-123",
"modeId": "code"
}
}
Agent-initiated (notification):
{
"jsonrpc": "2.0",
"method": "session/update",
"params": {
"sessionId": "session-123",
"update": {
"type": "current_mode_update",
"modeId": "architect"
}
}
}
npm install @agentclientprotocol/sdk
import { AgentSideConnection, ClientSideConnection } from '@agentclientprotocol/sdk';
// For building an agent
const agentConnection = new AgentSideConnection();
// For building a client
const clientConnection = new ClientSideConnection();
API Reference: https://agentclientprotocol.github.io/typescript-sdk
pip install agent-client-protocol
# or with uv
uv add agent-client-protocol
from agent_client_protocol import AgentConnection, ClientConnection
# For building an agent
agent = AgentConnection()
# For building a client
client = ClientConnection()
API Reference: https://agentclientprotocol.github.io/python-sdk
cargo add agent-client-protocol
Crates.io: https://crates.io/crates/agent-client-protocol
Available via Maven for JVM environments with samples included.
import { AgentSideConnection } from '@agentclientprotocol/sdk';
const agent = new AgentSideConnection();
// Handle initialization
agent.on('initialize', async (params) => {
return {
protocolVersion: '1.0.0',
capabilities: {
modes: {
currentModeId: 'code',
availableModes: [
{ id: 'code', name: 'Code', description: 'Full coding mode' }
]
}
}
};
});
// Handle new sessions
agent.on('session/new', async (params) => {
return {
sessionId: crypto.randomUUID(),
modes: {
currentModeId: 'code',
availableModes: [{ id: 'code', name: 'Code' }]
}
};
});
// Handle prompts
agent.on('session/prompt', async (params) => {
const { sessionId, prompt } = params;
// Stream updates to client
agent.notify('session/update', {
sessionId,
update: {
type: 'text_delta',
delta: 'Processing your request...'
}
});
// Process prompt with your LLM
const response = await processWithLLM(prompt);
return {
stopReason: 'endTurn',
content: [{ type: 'text', text: response }]
};
});
// Start listening on stdio
agent.listen();
See the Gemini CLI implementation for a complete, production-ready ACP agent.
ACP integrates with Model Context Protocol (MCP) in three ways:
Editors pass user-configured MCP server configs to agents:
{
"mcpServers": [
{
"name": "filesystem",
"transport": "stdio",
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/path"]
}
]
}
Editors expose their own MCP server to agents:
{
"editorMcpServer": {
"transport": "stdio",
"capabilities": ["search", "diagnostics", "refactor"]
}
}
For stdio-only MCP support, editors provide proxies routing requests:
Agent ββMCP requestβββΊ Editor Proxy ββMCPβββΊ External Server
initialize, authenticate, session/new, session/promptsession/update for progress visibilityrequest_permission for destructive operationssession/cancel notificationssession/update notifications in real-time| Code | Meaning |
|---|---|
| -32700 | Parse error |
| -32600 | Invalid request |
| -32601 | Method not found |
| -32602 | Invalid params |
| -32603 | Internal error |
{
"jsonrpc": "2.0",
"id": 1,
"error": {
"code": -32601,
"message": "Method not found",
"data": { "method": "unknown/method" }
}
}