The Agent Client Protocol allows Agents and Clients to communicate by exposing methods that each side can call and sending notifications to inform each other of events.Documentation Index
Fetch the complete documentation index at: https://agentclientprotocol.com/llms.txt
Use this file to discover all available pages before exploring further.
Communication Model
The protocol follows the JSON-RPC 2.0 specification with two types of messages:- Methods: Request-response pairs that expect a result or error
- Notifications: One-way messages that don’t expect a response
Message Flow
A typical flow follows this pattern:Initialization Phase
- Client → Agent:
initializeto establish connection - Client → Agent:
authenticateif required by the Agent
Session Setup - either:
- Client → Agent:
session/newto create a new session - Client → Agent:
session/loadto resume an existing session if supported
Prompt Turn
- Client → Agent:
session/promptto send user message - Agent → Client:
session/updatenotifications for progress updates - Agent → Client: File operations or permission requests as needed
- Client → Agent:
session/cancelto interrupt processing if needed - Turn ends and the Agent sends the
session/promptresponse with a stop reason
Agent
Agents are programs that use generative AI to autonomously modify code. They typically run as subprocesses of the Client.Baseline Methods
authenticate
Authenticate with the Agent (if required).
session/new
session/prompt
Send user prompts to the Agent.
Optional Methods
session/load
Load an existing session (requires
loadSession capability).session/set_mode
Notifications
session/cancel
Cancel ongoing operations (no response
expected).
Client
Clients provide the interface between users and agents. They are typically code editors (IDEs, text editors) but can also be other UIs for interacting with agents. Clients manage the environment, handle user interactions, and control access to resources.Baseline Methods
session/request_permission
Request user authorization for tool
calls.
Optional Methods
fs/read_text_file
Read file contents (requires
fs.readTextFile
capability).fs/write_text_file
Write file contents (requires
fs.writeTextFile capability).terminal/create
Create a new terminal (requires
terminal capability).terminal/output
Get terminal output and exit status (requires
terminal capability).terminal/release
Release a terminal (requires
terminal capability).terminal/wait_for_exit
Wait for terminal command to exit (requires
terminal capability).terminal/kill
Kill terminal command without releasing (requires
terminal capability).Notifications
session/update
Send session updates to inform the
Client of changes (no response expected). This includes: - Message
chunks (agent, user, thought) - Tool calls and
updates - Plans - Available commands
updates - Mode
changes
Argument requirements
- All file paths in the protocol MUST be absolute.
- Line numbers are 1-based
Error Handling
All methods follow standard JSON-RPC 2.0 error handling:- Successful responses include a
resultfield - Errors include an
errorobject withcodeandmessage - Notifications never receive responses (success or error)
Conventions
Unless explicitly defined otherwise in the schema, ACP-defined JSON object property keys usecamelCase. String values carried by discriminator fields use snake_case. The JSON-RPC envelope fields (jsonrpc, id, method, params, result, and error) follow the JSON-RPC 2.0 specification.
Extensibility
The protocol provides built-in mechanisms for adding custom functionality while maintaining compatibility:- Add custom data using
_metafields - Create custom methods by prefixing their name with underscore (
_) - Advertise custom capabilities during initialization
Next Steps
- Learn about Initialization to understand version and capability negotiation
- Understand Session Setup for creating and loading sessions
- Review the Prompt Turn lifecycle
- Explore Extensibility to add custom features