Documentation Index
Fetch the complete documentation index at: https://agentclientprotocol.com/llms.txt Use this file to discover all available pages before exploring further.
Overview
How the Agent Client Protocol works
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.
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
ACP follows JSON-RPC 2.0 batch behavior. See Transports for batch handling requirements.
Message Flow
A typical flow follows this pattern:
1. Initialization Phase
- Client → Agent:
initializeto establish connection - Client → Agent:
auth/loginif required by the Agent
2. Session Setup - either:
- Client → Agent:
session/newto create a new session - Client → Agent:
session/resumeto resume an existing session
3. Prompt Lifecycle
- Client → Agent:
session/promptto send user message - Agent → Client:
session/promptresponse once the prompt is accepted - Agent → Client:
session/updatenotifications for accepted messages, state updates, and progress updates - Agent → Client: Permission requests as needed
- Client → Agent:
session/cancelto interrupt processing if needed - Agent → Client: An idle
state_updatewith a stop reason when foreground work ends, even if background activity continues
Agent
Agents are programs that use generative AI to autonomously modify code. They typically run as subprocesses of the Client.
Baseline Methods
Some baseline methods belong to optional surfaces. An Agent that returns one or more valid entries in authMethods MUST implement both auth/login and auth/logout. If authMethods is omitted or empty, Clients MUST NOT call either method.
initialize
Negotiate versions and exchange capabilities..
auth/login
Authenticate with the Agent (if required).
auth/logout
End the current authenticated state.
session/new
Create a new conversation session.
session/prompt
Send user prompts to the Agent.
session/list
session/resume
Resume an existing session, optionally replaying history.
session/close
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 operations such as tool calls and commands.
Optional Methods
elicitation/create
Request structured information from the user
(requires the matching elicitation mode capability).
Notifications
elicitation/complete
Report completion of an out-of-band URL interaction (no response expected).
session/update
Send session updates to inform the Client of changes (no response expected). This includes message updates and chunks, tool calls, updates, and content chunks, display-only terminal state and output chunks, plans, available commands updates, config option updates, context compactions, and user-facing notices.
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 use camelCase. 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.
Selected enum-like fields and tagged unions can define custom or future fallbacks. For those fields, _-prefixed values are reserved for implementation-specific extensions, while unknown non-underscore values are reserved for future ACP variants.
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
Learn about protocol extensibility to understand how to use these mechanisms.
Next Steps
- Learn about Initialization to understand version and capability negotiation
- Understand Session Setup for creating and loading sessions
- Review the Prompt Lifecycle
- Explore Extensibility to add custom features
- Check your agent implementation with the Test Compatibility Kit
This documentation is built and hosted on Mintlify, a developer documentation platform.