Skip to main content

What is a Client?

In the Agent-Client Protocol (ACP), a client is the application that provides the interface between users and AI agents. Clients are typically:
  • Code editors (VS Code, JetBrains IDEs, Vim/Neovim)
  • Terminal applications
  • Web-based IDEs
  • Custom developer tools
The client is responsible for:
  • Creating and managing connections to agents
  • Handling user input and displaying agent responses
  • Managing file system access and security
  • Requesting and displaying permission prompts
  • Running terminal commands on behalf of the agent

Architecture Overview

The ACP TypeScript SDK provides two main components for building clients:
1

ClientSideConnection

The main connection class that communicates with agents. It implements the Agent interface, providing methods like initialize(), newSession(), and prompt().
2

Client Interface

Your client implementation must implement the Client interface, which handles incoming requests from the agent such as permission requests, session updates, and file system operations.

Communication Model

ACP uses a bidirectional JSON-RPC 2.0 protocol over standard input/output (stdin/stdout):

Client Responsibilities

1. Session Management

Clients create and manage conversation sessions, each with its own context and history.

2. Permission Control

Clients must implement permission requests to give users control over what the agent can do.

3. Resource Access

Clients provide sandboxed access to:
  • File system (read/write operations)
  • Terminal execution
  • Environment information

4. UI Updates

Clients handle real-time session updates to display:
  • Agent messages and thoughts
  • Tool call progress
  • Execution plans
  • Error states

Example Client

Here’s a minimal client implementation:

Next Steps

ClientSideConnection

Learn about the connection class and its methods

Client Interface

Implement the required Client interface

Session Updates

Handle real-time updates from the agent

Permissions

Implement permission request UI

Full Example

For a complete working example, see the example client in the SDK repository:
The example client demonstrates all client capabilities including file system operations, terminal management, and permission handling.