Agent Client Protocol TypeScript SDK
The official TypeScript implementation of the Agent Client Protocol (ACP) — a standardized communication protocol between code editors and AI-powered coding agents.
Key Features
Bidirectional Communication
JSON-RPC 2.0 protocol implementation for seamless agent-client communication
Type-Safe SDK
Full TypeScript support with Zod schema validation for all protocol messages
Session Management
Create, load, fork, and resume conversation sessions with state management
File System Operations
Read and write text files within the client’s environment
Terminal Support
Execute commands and monitor terminal output for interactive workflows
Permission Handling
Request user authorization for sensitive operations with flexible permission options
Quick Start
Choose Your Role
Decide whether you’re building an Agent or a Client:
- Agent: AI-powered program that uses generative AI to autonomously modify code
- Client: Code editor or IDE that provides the interface between users and agents
Core Concepts
Protocol Overview
Understand the ACP specification and communication model
Agents and Clients
Learn about the two sides of the protocol
Connections
Establish bidirectional communication channels
Sessions
Manage conversation contexts and state
API Reference
AgentSideConnection
Agent’s view of the connection
ClientSideConnection
Client’s view of the connection
Agent Interface
Methods agents must implement
Client Interface
Methods clients must implement
Types & Schema
TypeScript types and Zod schemas
Error Handling
Protocol error codes and handling
Resources
Examples
Complete working examples of agents and clients
Official Protocol Docs
Full ACP specification and protocol documentation
GitHub Repository
View source code and contribute
NPM Package
Published package on npm registry