ExMCP.ACP.Protocol (ex_mcp v0.9.0)
View SourceACP-specific message encoding.
Delegates JSON-RPC 2.0 framing to ExMCP.Internal.Protocol and adds
ACP method-specific encoding on top.
ACP uses integer protocol versions (default: 1) rather than MCP's date-based strings.
Summary
Functions
Encodes an authenticate request.
Encodes a JSON-RPC error response.
Encodes a response to a fs/read_text_file request from the agent.
Encodes a response to a fs/write_text_file request from the agent.
Encodes an initialize request.
Encodes a response to a session/request_permission request from the agent.
Encodes a JSON-RPC success response.
Encodes a session/cancel notification (no id field).
Encodes a session/list request. Stabilized in ACP spec March 9, 2026.
Encodes a session/load request to resume an existing session.
Encodes a session/new request.
Encodes a session/prompt request.
Encodes a session/setConfigOption request.
Encodes a session/setMode request.
Generates a unique request ID.
Parses a raw JSON-RPC message without validation.
Functions
Encodes an authenticate request.
Authentication is currently in RFD draft stage in the ACP spec. Error code -32000 indicates authentication is required.
Parameters
params— authentication parameters (provider-specific)
Encodes a JSON-RPC error response.
Encodes a response to a fs/read_text_file request from the agent.
Encodes a response to a fs/write_text_file request from the agent.
@spec encode_initialize(map(), map() | nil, pos_integer()) :: map()
Encodes an initialize request.
Parameters
client_info—%{"name" => ..., "version" => ...}capabilities— client capabilities map (optional)protocol_version— integer (default: 1)
Encodes a response to a session/request_permission request from the agent.
Encodes a JSON-RPC success response.
Encodes a session/cancel notification (no id field).
Encodes a session/list request. Stabilized in ACP spec March 9, 2026.
Encodes a session/load request to resume an existing session.
Encodes a session/new request.
Encodes a session/prompt request.
Encodes a session/setConfigOption request.
Encodes a session/setMode request.
Generates a unique request ID.
Parses a raw JSON-RPC message without validation.