What is ACP?
The Agent Client Protocol (ACP) is a standardized protocol that enables seamless communication between code editors (interactive programs for viewing and editing source code) and coding agents (programs that use generative AI to autonomously modify code). ACP defines a structured way for these two entities to interact:- Clients (code editors like IDEs) provide the environment and control access to resources
- Agents (AI-powered coding assistants) perform autonomous code modifications using language models
TypeScript SDK Overview
The ACP TypeScript SDK (@agentclientprotocol/sdk) is the official TypeScript implementation of the Agent Client Protocol. It provides:
- Type-safe interfaces for both Agents and Clients
- JSON-RPC 2.0 message handling with automatic validation using Zod
- Bidirectional streaming over stdio or other transports
- Complete protocol coverage including sessions, prompts, tool calls, permissions, and terminals
- Production-ready implementations used by tools like the Gemini CLI Agent
Key Capabilities
Session Management
Create, load, and manage conversation sessions with independent contexts and history
Prompt Processing
Send user prompts with rich context (files, images) and receive structured responses
Tool Calls
Execute operations like reading/writing files with built-in permission handling
Real-time Updates
Stream agent messages, tool calls, and execution plans as they happen
Terminal Support
Create and manage terminals for executing commands with output streaming
File System Access
Read and write text files in the client’s environment with proper permissions
Why Use ACP?
ACP is designed to be transport-agnostic, working over stdio, WebSockets, or any bidirectional stream. This flexibility makes it ideal for CLI tools, IDE extensions, and web applications.
- Standardized Communication: No need to build custom protocols for agent-client interaction
- Type Safety: Full TypeScript types ensure correctness at compile time
- Protocol Validation: Automatic request/response validation using Zod schemas
- Extensible: Support for custom methods and capabilities beyond the core protocol
- Well-Documented: Comprehensive protocol documentation and examples
Protocol Documentation
For a deeper understanding of the protocol specification, lifecycle, and message formats, visit the official protocol documentation:ACP Protocol Documentation
Read the complete protocol specification, architecture guides, and best practices
Next Steps
Get started building with the ACP TypeScript SDK:Installation
Install the SDK and set up your development environment
Quickstart
Build your first ACP agent or client in minutes
Building Agents
Learn how to implement an ACP-compliant agent
Building Clients
Learn how to implement an ACP-compliant client