agent-client-protocol

Agent Client Protocol (ACP) - Standardized communication between code editors and AI coding agents. Use for building ACP-compatible agents, integrating agents with editors (Zed, JetBrains, Neovim), implementing tool calls, file operations, and session management.

16 stars

Best use case

agent-client-protocol is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Agent Client Protocol (ACP) - Standardized communication between code editors and AI coding agents. Use for building ACP-compatible agents, integrating agents with editors (Zed, JetBrains, Neovim), implementing tool calls, file operations, and session management.

Teams using agent-client-protocol should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/agent-client-protocol/SKILL.md --create-dirs "https://raw.githubusercontent.com/diegosouzapw/awesome-omni-skill/main/skills/tools/agent-client-protocol/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/agent-client-protocol/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How agent-client-protocol Compares

Feature / Agentagent-client-protocolStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Agent Client Protocol (ACP) - Standardized communication between code editors and AI coding agents. Use for building ACP-compatible agents, integrating agents with editors (Zed, JetBrains, Neovim), implementing tool calls, file operations, and session management.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# Agent Client Protocol Skill

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.

## When to Use This Skill

This skill should be triggered when:
- Building AI coding agents that need editor integration
- Implementing ACP support in code editors or IDEs
- Creating tool call handlers for agent operations
- Managing file system operations from agents
- Implementing session management for AI assistants
- Building bridges between existing agents and ACP clients
- Understanding JSON-RPC messaging for agent-editor communication

## Protocol Overview

### The Problem ACP Solves

Before ACP:
- Each editor must build custom integrations for every agent
- Agents must implement editor-specific APIs
- N editors × M agents = N×M integrations needed

After ACP:
- One protocol specification
- N + M implementations needed
- Any agent works with any editor

### Deployment Models

```
┌─────────────────────────────────────────────────────────────┐
│                    LOCAL DEPLOYMENT                         │
├─────────────────────────────────────────────────────────────┤
│                                                             │
│   ┌──────────┐  JSON-RPC/stdio  ┌──────────────────────┐   │
│   │  Editor  │◄────────────────►│  Agent (subprocess)  │   │
│   │  (Zed)   │                  │  (Claude Code)       │   │
│   └──────────┘                  └──────────────────────┘   │
│                                                             │
└─────────────────────────────────────────────────────────────┘

┌─────────────────────────────────────────────────────────────┐
│                   REMOTE DEPLOYMENT                         │
├─────────────────────────────────────────────────────────────┤
│                                                             │
│   ┌──────────┐  HTTP/WebSocket  ┌──────────────────────┐   │
│   │  Editor  │◄────────────────►│  Cloud Agent         │   │
│   │          │                  │  (remote server)     │   │
│   └──────────┘                  └──────────────────────┘   │
│                                                             │
└─────────────────────────────────────────────────────────────┘
```

---

## Supported Ecosystem

### Compatible Agents (18+)

| 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 |

### Compatible Clients/Editors (15+)

| 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 |

---

## Protocol Architecture

### Communication Model

ACP uses **JSON-RPC 2.0** with two message types:

```typescript
// 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

```
┌─────────────────────────────────────────────────────────────┐
│                    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
```

### Core Methods

#### Agent-Side Methods (Required)

| Method | Purpose |
|--------|---------|
| `initialize` | Negotiate protocol version and capabilities |
| `authenticate` | Validate client credentials |
| `session/new` | Create new conversation session |
| `session/prompt` | Process user input |

#### Client-Side Methods

| 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 |

---

## Content Types

ACP defines structured content blocks for data exchange:

### Text Content

```json
{
  "type": "text",
  "text": "Hello, I can help you with your code."
}
```

### Image Content

```json
{
  "type": "image",
  "mimeType": "image/png",
  "data": "base64encodeddata..."
}
```

### Audio Content

```json
{
  "type": "audio",
  "mimeType": "audio/wav",
  "data": "base64encodedaudio..."
}
```

### Embedded Resource

```json
{
  "type": "resource",
  "resource": {
    "uri": "file:///path/to/file.ts",
    "mimeType": "text/typescript",
    "text": "const x = 1;"
  }
}
```

### Resource Link

```json
{
  "type": "resource_link",
  "uri": "file:///path/to/document.pdf",
  "name": "document.pdf",
  "mimeType": "application/pdf",
  "size": 1024000
}
```

---

## Tool Calls

### Creating Tool Calls

Agents report tool invocations via `session/update`:

```json
{
  "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"
    }
  }
}
```

### Tool Call Kinds

| 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 |

### Tool Call Status Lifecycle

```
pending ──► in_progress ──► completed
                  │
                  └──► failed
```

### Permission Requests

```json
{
  "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" }
    ]
  }
}
```

---

## File System Operations

### Reading Files

```json
// 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..."
  }
}
```

### Writing Files

```json
// 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
}
```

### Important Constraints

- All file paths MUST be absolute
- Line numbering is 1-based
- No edit-in-place operations (full read/write only)
- Check `clientCapabilities.fs` before using

---

## Session Modes

Agents can operate in different modes affecting behavior:

### Example Modes

| Mode | Description |
|------|-------------|
| **Ask** | Request permission before any changes |
| **Architect** | Design and plan without implementation |
| **Code** | Full tool access for code modifications |

### Switching Modes

**Client-initiated:**
```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "session/set_mode",
  "params": {
    "sessionId": "session-123",
    "modeId": "code"
  }
}
```

**Agent-initiated (notification):**
```json
{
  "jsonrpc": "2.0",
  "method": "session/update",
  "params": {
    "sessionId": "session-123",
    "update": {
      "type": "current_mode_update",
      "modeId": "architect"
    }
  }
}
```

---

## SDK Installation

### TypeScript

```bash
npm install @agentclientprotocol/sdk
```

```typescript
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

### Python

```bash
pip install agent-client-protocol
# or with uv
uv add agent-client-protocol
```

```python
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

### Rust

```bash
cargo add agent-client-protocol
```

**Crates.io**: https://crates.io/crates/agent-client-protocol

### Kotlin

Available via Maven for JVM environments with samples included.

---

## Building an ACP Agent

### Minimal TypeScript Agent

```typescript
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();
```

### Production Example

See the [Gemini CLI implementation](https://github.com/google-gemini/gemini-cli/blob/main/packages/cli/src/zed-integration/zedIntegration.ts) for a complete, production-ready ACP agent.

---

## MCP Integration

ACP integrates with Model Context Protocol (MCP) in three ways:

### 1. External MCP Servers

Editors pass user-configured MCP server configs to agents:

```json
{
  "mcpServers": [
    {
      "name": "filesystem",
      "transport": "stdio",
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-filesystem", "/path"]
    }
  ]
}
```

### 2. Editor-Exported Tools

Editors expose their own MCP server to agents:

```json
{
  "editorMcpServer": {
    "transport": "stdio",
    "capabilities": ["search", "diagnostics", "refactor"]
  }
}
```

### 3. Proxy Tunneling

For stdio-only MCP support, editors provide proxies routing requests:

```
Agent ──MCP request──► Editor Proxy ──MCP──► External Server
```

---

## Design Principles

### MCP-Friendly

- Built on JSON-RPC 2.0
- Reuses MCP content types
- Compatible data representations

### UX-First

- Balances rendering flexibility
- Appropriate abstraction levels
- Supports diffs, terminal output, file locations

### Trusted

- Operates in trusted editor context
- User controls tool execution
- Agents access files and MCP servers

---

## Best Practices

### For Agent Developers

1. **Implement all baseline methods**: `initialize`, `authenticate`, `session/new`, `session/prompt`
2. **Stream updates frequently**: Use `session/update` for progress visibility
3. **Request permissions appropriately**: Use `request_permission` for destructive operations
4. **Handle cancellation**: Respect `session/cancel` notifications
5. **Use absolute paths**: All file operations require absolute paths

### For Client Developers

1. **Declare capabilities accurately**: Only advertise supported features
2. **Handle streaming updates**: Process `session/update` notifications in real-time
3. **Implement permission UI**: Show user-friendly permission dialogs
4. **Support multiple sessions**: Allow concurrent agent sessions

### Security Considerations

- Validate all file paths (prevent directory traversal)
- Implement rate limiting for tool calls
- Sanitize user input before passing to agents
- Log all operations for audit trails

---

## Error Handling

### JSON-RPC Error Codes

| Code | Meaning |
|------|---------|
| -32700 | Parse error |
| -32600 | Invalid request |
| -32601 | Method not found |
| -32602 | Invalid params |
| -32603 | Internal error |

### Error Response Format

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "error": {
    "code": -32601,
    "message": "Method not found",
    "data": { "method": "unknown/method" }
  }
}
```

---

## Resources

### Official Documentation
- [ACP Website](https://agentclientprotocol.com/)
- [Protocol Schema](https://github.com/agentclientprotocol/agent-client-protocol)

### SDKs
- [TypeScript SDK](https://github.com/agentclientprotocol/typescript-sdk)
- [Python SDK](https://github.com/agentclientprotocol/python-sdk)
- [Rust Crate](https://crates.io/crates/agent-client-protocol)

### Examples
- [Gemini CLI Integration](https://github.com/google-gemini/gemini-cli)
- [Goose Agent](https://github.com/block/goose)

### Community
- [Zed ACP Documentation](https://zed.dev/acp)
- [JetBrains AI Assistant ACP](https://www.jetbrains.com/help/ai-assistant/acp.html)

---

## Version History

- **1.0.0** (2026-01-10): Initial skill release
  - Complete protocol overview
  - Session lifecycle documentation
  - Tool call and permission handling
  - File system operations
  - Session modes
  - SDK installation guides (TypeScript, Python, Rust, Kotlin)
  - 18 supported agents, 15 supported clients
  - MCP integration patterns
  - Best practices and error handling

Related Skills

acc-create-psr18-http-client

16
from diegosouzapw/awesome-omni-skill

Generates PSR-18 HTTP Client implementation for PHP 8.5. Creates ClientInterface with request sending and exception handling. Includes unit tests.

a2a-protocol-impl

16
from diegosouzapw/awesome-omni-skill

Implement Agent-to-Agent (A2A) protocol for inter-agent communication. Use for agent discovery, agent cards, task delegation, and multi-agent orchestration. Triggers on "A2A protocol", "agent-to-agent", "agent discovery", "agent card", "multi-agent", "agent delegation", "agent communication", or when implementing spec/api/017-a2a-protocol.md.

protocol-reverse-engineering

16
from diegosouzapw/awesome-omni-skill

Master network protocol reverse engineering including packet analysis, protocol dissection, and custom protocol documentation. Use when analyzing network traffic, understanding proprietary protocol...

windows-protocols

16
from diegosouzapw/awesome-omni-skill

Local Microsoft Open Specifications corpus navigator for Windows protocols. Use this skill when the user asks protocol-level questions, needs message/structure details, wants section-by-section summaries, or needs cross-references across related specifications.

Recovery and Escalation Protocols

16
from diegosouzapw/awesome-omni-skill

This skill should be used when encountering blockers, repeated failures (tests failing 3+ times), stuck states, error conditions, or degraded performance during any workflow phase. Provides systematic recovery procedures, escalation paths, rollback protocols, and debugging guidance to handle failures gracefully without compounding problems.

data-client-setup

16
from diegosouzapw/awesome-omni-skill

Install and set up @data-client/react or @data-client/vue in a project. Detects project type (NextJS, Expo, React Native, Vue, plain React) and protocol (REST, GraphQL, custom), then hands off to protocol-specific setup skills.

bknd-client-setup

16
from diegosouzapw/awesome-omni-skill

Use when setting up Bknd SDK in a frontend application. Covers Api class initialization, token storage, auth state handling, React integration with BkndBrowserApp and useApp hook, framework-specific setup (Vite, Next.js, standalone), and TypeScript type registration.

atcoder-client

16
from diegosouzapw/awesome-omni-skill

Interface with AtCoder for Japanese competitive programming contests

ArchitectProtocol

16
from diegosouzapw/awesome-omni-skill

A strict 6-phase development protocol for software architecture, product design, and QA.

aegis-protocol-ratification

16
from diegosouzapw/awesome-omni-skill

Ratify AEGIS protocol governance frameworks.

add-vault-protocol

16
from diegosouzapw/awesome-omni-skill

Add support for a new ERC-4626 vault protocol. Use when the user wants to integrate a new vault protocol like IPOR, Plutus, Morpho, etc. Requires vault smart contract address, protocol name, and protocol slug as inputs.

skill-protocol-mastery

16
from diegosouzapw/awesome-omni-skill

This skill should be used when the user asks to "create a skill", "write a SKILL.md", "validate skill structure", "improve skill description", "understand skill protocol", "design skill architecture", or needs guidance on progressive disclosure, trigger phrases, writing style, or skill validation for Claude Code.