What is ACP?
ACP defines a structured way for agents (AI assistants that write and modify code) to communicate with clients (code editors like VS Code, Cursor, or Windsurf). The protocol ensures interoperability, allowing any ACP-compliant agent to work with any ACP-compliant client.Standardized
A single protocol specification that all implementations follow
Bidirectional
Both agents and clients can send requests to each other
JSON-RPC Based
Built on the proven JSON-RPC 2.0 specification
Extensible
Support for custom methods and capabilities
JSON-RPC 2.0 Foundation
ACP is built on top of JSON-RPC 2.0, a lightweight remote procedure call protocol. This means all messages follow the JSON-RPC format:JSON-RPC requests include an
id field and expect a response. Notifications omit the id field and don’t expect a response.Protocol Version
The current protocol version is defined in the SDK:Communication Model
ACP uses bidirectional communication over a stream-based transport (typically stdio):Message Flow
Both agents and clients can:- Send requests and receive responses
- Send notifications without expecting responses
- Handle incoming requests from the other side
- Receive notifications from the other side
Stream-Based Transport
ACP messages are typically transported as newline-delimited JSON (NDJSON) over standard input/output streams:ndJsonStream function.
Protocol Structure
The protocol is organized around several core concepts:Initialization
Establishing connections and negotiating capabilities
Sessions
Managing conversation contexts and state
Prompts
Processing user input and generating responses
Tool Calls
Executing operations with permission management
Key Features
Capability Negotiation
During initialization, both sides advertise their capabilities:Session Management
Sessions represent independent conversation contexts:- Create new sessions with
session/new - Load existing sessions with
session/load - Fork sessions for parallel exploration
- Resume sessions without replaying history
Real-time Updates
Agents stream progress updates to clients:Permission System
Agents request permission before sensitive operations:Learn More
Full Specification
Read the complete ACP specification
Agents and Clients
Understand the two sides of the protocol
Connections
Learn how to establish connections
Sessions
Explore session lifecycle and management
For implementation examples, see the Quickstart Guide and Examples sections.