Documentation Index
Fetch the complete documentation index at: https://agentclientprotocol.com/llms.txt
Use this file to discover all available pages before exploring further.
- Author(s): alexhancock, jh-block
- Champion: anna239
Elevator pitch
What are you proposing to change?ACP needs a standard remote transport. We propose long-lived GET streams for server→client messages (one connection-scoped plus one per session), with POST for client→server messages, and WebSocket upgrade as an alternative on the same endpoint. A single
/acp endpoint supports two connectivity profiles:
- Streamable HTTP (POST/GET/DELETE) — Long-lived SSE streams per connection: one connection-scoped stream for connection-level server→client messages, plus one session-scoped stream per session for session-level messages. POST requests return immediately (202 Accepted, except
initialize). Requires HTTP/2. - WebSocket upgrade (GET with
Upgrade: websocket) — persistent, full-duplex, low-latency bidirectional messaging.
Status quo
How do things work today and what problems does this cause? Why would we change things?ACP only has stdio. There is no standard remote transport, which causes fragmentation as implementers invent their own HTTP layers, leading to incompatible SDKs and deployments.
What we propose to do about it
What are you proposing to improve the situation?
1. Adds an HTTP Transport
ACP adopts a streamable HTTP transport with three key characteristics:-
Long-lived GET streams (one connection-scoped, one per session) — All server→client messages (responses to requests and unsolicited notifications) are delivered via SSE streams opened with GET. The connection-scoped stream (scoped to
Acp-Connection-Id) carries connection-level messages: responses tosession/newandsession/load(which the client cannot receive on a session-scoped stream because it does not yet have asessionId), and any server-initiated messages not tied to a specific session. The session-scoped stream (scoped toAcp-Connection-Id+Acp-Session-Id) carries all messages for a single session: session update notifications, server-to-client requests likerequest_permission, and responses to session-scoped POSTs likesession/promptandsession/cancel. Responses are correlated to the POST that originated them by JSON-RPCid. -
POST requests return immediately (except initialize) — Client→server messages are sent via POST. Most POST requests return
202 Acceptedimmediately with an empty body. The actual response comes later on the appropriate GET stream, correlated by JSON-RPCid. Theinitializerequest is special: it returns200 OKwith a JSON response body containing capabilities and theAcp-Connection-Id. TheAcp-Connection-Idis also included in the response header. - Requires HTTP/2 — Streamable HTTP transport MUST use HTTP/2. This provides multiplexing for concurrent POST requests while maintaining long-lived GET streams (one connection-scoped plus one per session), and improves efficiency for high-frequency message exchanges.
4. Adds WebSocket as a first-class upgrade on the same endpoint
A GET withUpgrade: websocket upgrades to a persistent bidirectional channel — same endpoint, same lifecycle model.
This is important for ACP, as it is more bidirectional in its nature as a protocol.
5. Requires cookie support on HTTP transports
Clients MUST accept, store, and return cookies set by the server on all HTTP-based transports (Streamable HTTP and WebSocket). Cookies MUST be sent on subsequent requests to the server for the duration of the connection. Clients MAY discard all cookies when a connection is terminated. This allows servers to rely on cookies for session affinity (e.g., sticky sessions behind a load balancer) and other small amounts of per-connection state.6. Defines a unified routing model
| Method | Upgrade Header? | Behavior |
|---|---|---|
POST | — | Send JSON-RPC message. initialize returns 200 with JSON body. All others return 202 Accepted immediately. |
GET | No | Open SSE stream. Acp-Connection-Id alone → connection-scoped stream. Acp-Connection-Id + Acp-Session-Id → session-scoped stream. |
GET | Upgrade: websocket | Upgrade to WebSocket for full-duplex messaging |
DELETE | — | Terminate the connection |
7. Preserves the full ACP lifecycle
Theinitialize → initialized → messages → close lifecycle is identical regardless of transport. The Acp-Connection-Id binds requests to the initialized connection and its negotiated capabilities. Session identity is carried in JSON-RPC message bodies via the sessionId field.
Shiny future
How will things play out once this feature exists?
- SDK implementers get a clear, testable transport spec — Rust, TypeScript, and Python SDKs can all interoperate.
- Desktop clients use WebSocket for low-latency streaming; all clients support it as a baseline.
- Cloud deployments expose agents behind standard HTTP load balancers using the stateless-friendly HTTP mode, with cookie-based sticky sessions guaranteed by client support.
- Proxy chains can route ACP traffic over HTTP for multi-hop agent topologies.
Implementation details and plan
Tell me more about your implementation. What is your detailed implementation plan?
Transport Architecture
Identity Model
ACP over Streamable HTTP uses two HTTP headers for connection and session identity, plus JSON-RPC message fields:Acp-Connection-Id(HTTP header) — Transport-level identifier returned by the server in theinitializeresponse. Required on all HTTP requests afterinitializeand on every GET stream (both connection-scoped and session-scoped). Binds requests to an initialized connection and its negotiated capabilities.Acp-Session-Id(HTTP header) — Session-level identifier returned in thesession/newresponse body. Required on all session-scoped POST requests (session/prompt,session/cancel, permission responses, etc.) and on the session-scoped GET stream.sessionId(JSON-RPC field) — Session-level identifier also included in JSON-RPCparamsfor session-scoped methods and in responses on the GET streams. A single connection may host multiple sessions, each with its ownsessionIdand its own session-scoped GET stream.
Streamable HTTP Message Flow
Content Negotiation and Validation
- POST
Content-TypeMUST beapplication/json(415 otherwise). - GET
AcceptMUST includetext/event-stream(406 otherwise). - POST requests for session-scoped operations MUST include both
Acp-Connection-IdandAcp-Session-Idheaders. - GET requests without
Upgrade: websocketMUST includeAcp-Connection-Id. IfAcp-Session-Idis also present, the stream is session-scoped; otherwise it is connection-scoped. An unknownAcp-Session-Idfor the given connection returns 404. - Batch JSON-RPC requests return 501.
- HTTP/2 is REQUIRED for Streamable HTTP transport.
WebSocket Request Flow
Connection Establishment (GET with Upgrade)
Acp-Connection-Id is returned in the upgrade response headers. The client must still send initialize as the first JSON-RPC message over the WebSocket to negotiate capabilities before creating sessions.
Bidirectional Messaging
All messages are WebSocket text frames containing JSON-RPC. Binary frames are ignored. On disconnect, the server cleans up the connection and any associated sessions.Unified Endpoint Routing
Connection and Session Model
sessionId field in JSON-RPC messages. The transport layer adapts channels to the wire format (SSE events for HTTP, text frames for WebSocket).
Comparing to MCP Streamable HTTP
| MCP Requirement | ACP Implementation | Status |
|---|---|---|
| POST for all client→server messages | ✅ | Compliant |
| Accept header validation (406) | ✅ | Compliant |
| Notifications/responses return 202 | ✅ (except initialize returns 200) | Mostly compliant |
| Requests return SSE stream | ❌ (long-lived GET streams instead) | Documented deviation |
| Session ID on initialize response | ✅ (Acp-Connection-Id) | Compliant (renamed) |
| Session ID required on subsequent requests | ✅ (Acp-Connection-Id + Acp-Session-Id) | Compliant (extended) |
| GET opens SSE stream | ✅ (connection-scoped + session-scoped) | Compliant (extended) |
| DELETE terminates session | ✅ (terminates connection) | Compliant |
| 404 for unknown sessions | ✅ (unknown connection IDs) | Compliant |
| Batch requests | ❌ (returns 501) | Documented deviation |
| Resumability (Last-Event-ID) | ❌ | Future work |
| Protocol version header | ❌ | Future work |
Deviations from MCP Streamable HTTP
- Long-lived GET streams (connection-scoped + per-session): MCP opens a new SSE stream for each request response. ACP uses long-lived GET streams per connection — one connection-scoped stream plus one session-scoped stream per session. POST requests (except
initialize) return 202 Accepted immediately, and responses arrive on the appropriate GET stream correlated by JSON-RPCid. - Initialize returns JSON directly: MCP’s
initializereturns an SSE stream. ACP’sinitializereturns200 OKwith a JSON response body containing capabilities andconnectionId. TheAcp-Connection-Idis also included in the response header. - HTTP/2 required: ACP requires HTTP/2 for multiplexing concurrent POST requests alongside the long-lived GET stream.
- Two-header model: ACP uses both
Acp-Connection-Id(for connection identity) andAcp-Session-Id(for session identity on POST requests and on the session-scoped GET stream). MCP only usesMcp-Session-Id. This allows ACP to distinguish connection-level state from session-level operations while supporting multiple concurrent sessions on one connection. - WebSocket extension: MCP doesn’t define WebSocket. ACP adds it as a required client capability. Clients MUST support WebSocket, and servers MAY choose to only support WebSocket connections.
- Cookie support required: Clients MUST handle cookies on HTTP transports for the duration of the connection, enabling sticky sessions and per-connection server state.
- No batch requests: Returns 501. May be added later.
- No resumability yet in reference implementation: SSE event IDs and
Last-Event-IDresumption planned as follow-up.
Implementation Plan
- Phase 1 — Specification (this RFD): Define the transport spec and align terminology.
- Phase 2 — Reference Implementation (in progress): Working implementation in Goose (
block/goose). - Phase 3 — SDK Support: Add Streamable HTTP and WebSocket client support to Rust SDK (
sacp), then TypeScript SDK. - Phase 4 — Hardening: Origin validation,
Acp-Protocol-Version, SSE resumability, batch requests, security audit.
Frequently asked questions
What questions have arisen over the course of authoring this document or during subsequent discussions?
Why not just use MCP Streamable HTTP as-is?
MCP opens a new SSE stream for each request response, which creates many short-lived connections and complicates load balancing. ACP uses long-lived GET streams per connection (one connection-scoped plus one per session), dramatically reducing connection count and simplifying sticky session routing. This is better suited for ACP’s bidirectional, multi-session nature.How are sessions identified?
ACP usesAcp-Connection-Id in HTTP headers to identify the connection, and Acp-Session-Id (plus the sessionId JSON-RPC field) to identify sessions. A single connection may host multiple sessions. The connection-scoped GET stream delivers connection-level messages; each session-scoped GET stream delivers messages for exactly one session.
Why add WebSocket support?
ACP is highly bidirectional with frequent streaming updates. WebSocket provides true bidirectional messaging with lower per-message overhead than HTTP. Clients MUST support WebSocket so that servers can choose to only support WebSocket connections, simplifying deployment. Streamable HTTP remains available as an additional option for environments where WebSocket is not viable on the server side (e.g., serverless).How does the server distinguish WebSocket from SSE on GET?
By inspecting theUpgrade: websocket header. This is standard HTTP behavior.
Can a client have multiple sessions on one connection?
Yes. A client may callsession/new multiple times within a single Acp-Connection-Id. Each returns a distinct sessionId in the response body (delivered on the connection-scoped GET stream). For each session, the client opens a separate session-scoped GET stream using Acp-Connection-Id + Acp-Session-Id.
What alternative approaches did you consider, and why did you settle on this one?
- Per-request SSE streams (like MCP): Rejected — creates too many long-lived connections, complicates load balancing, and wastes resources.
- Separate endpoints (
/acp/http,/acp/ws): Rejected — single endpoint is simpler; WebSocket upgrade is natural HTTP. - WebSocket only: Rejected — doesn’t work through all proxies.
- Single connection-scoped GET stream with JSON-RPC demuxing: Rejected — forces both server and client to parse JSON-RPC bodies to route by session, couples all sessions’ backpressure together, and makes per-session resume/reconnect awkward. Splitting into a connection-scoped stream plus per-session streams keeps all session-level routing on HTTP headers.
How does this interact with authentication?
Authentication (see auth-methods RFD) is orthogonal and layered on top via HTTP headers, query parameters, or WebSocket subprotocols.Acp-Connection-Id and Acp-Session-Id are transport-level identifiers, not auth tokens.
What about the Acp-Protocol-Version header?
Clients SHOULD include it on all requests after initialization. Not yet implemented; part of Phase 4 hardening.
Why require HTTP/2?
HTTP/2 provides multiplexing, allowing many concurrent POST requests alongside the long-lived GET streams (one connection-scoped plus one per active session) on a single TCP connection. This is essential for efficient operation with the long-lived-stream model. HTTP/1.1 would require separate TCP connections for each concurrent POST and each GET stream, defeating the efficiency gains.Revision history
- 2025-03-10: Initial draft based on the RFC template and goose reference implementation.
- 2026-04-01: Introduced a two-header identity model:
Acp-Connection-Id(returned atinitialize, binds to the connection) andAcp-Session-Id(returned atsession/new, scopes to a session). This addresses feedback that the original singleAcp-Session-Idconflated transport binding with ACP session identity, and enables session-scoped GET listener streams for targeted server-to-client event delivery. Removed connection-scoped GET streams — all GET SSE listeners now require bothAcp-Connection-IdandAcp-Session-Id. - 2026-04-15: Minor edits
- 2026-04-23: Major revision to single long-lived GET stream model. Changed from per-request SSE streams to a single connection-scoped GET stream for all server→client messages. POST requests (except
initialize) now return 202 Accepted immediately.initializereturns 200 OK with JSON response body. Required HTTP/2 for multiplexing. This change makes the HTTP usage more similar to WebSocket and supports better the bidirectional nature of ACP. - 2026-05-04: Split the single GET stream into two: a connection-scoped stream (GET with
Acp-Connection-Id) for connection-level messages such as responses tosession/newandsession/load, and session-scoped streams (GET withAcp-Connection-Id+Acp-Session-Id) for session updates, server-to-client requests likerequest_permission, and responses to session-scoped POSTs. Routing happens on HTTP headers rather than JSON-RPC body inspection; per-session streams have independent lifetimes.