ACP TypeScript SDK

Official TypeScript SDK for the Agent Client Protocol connecting editors and AI coding agents

SDK
npm
v1.5.0
259 stars
Apache License 2.0

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
85 /100 Excellent
Development Activity 100
Maintenance 100
Community 64
Maturity 36
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
79 /100 Good
Architecture 83
Code Quality 84
Innovation 80
Learning Curve 68

The ACP TypeScript SDK is the official implementation of the Agent Client Protocol, a standardized JSON-RPC-based protocol that lets code editors and AI-powered coding agents communicate over a common interface instead of each editor integrating each agent one-off. It ships typed builders for both sides of the protocol: agent({ name }) for implementing an agent that registers initialize, newSession, and prompt handlers, and client({ name }) for implementing an editor-side client that registers handlers like requestPermission and sessionUpdate.

Beyond the core stdio JSON-RPC connection, the SDK exposes experimental transports for HTTP streaming, WebSockets, and a Node.js process adapter, plus a Zod-validated, generated schema layer so protocol messages are type-checked at compile time. It backs production integrations such as the Gemini CLI’s editor integration and is consumed directly by editors like Zed.

What You Get

  • Typed agent({ name }) and client({ name }) builder APIs for implementing either side of the ACP protocol
  • A core JSON-RPC connection layer (connection.ts, jsonrpc.ts) handling request/response correlation, notifications, and error propagation
  • Generated, Zod-validated schema types (schema/zod.gen.js, schema/types.gen.js) kept in sync with the protocol specification
  • Experimental transport adapters for HTTP streaming, WebSockets, and Node.js process I/O beyond the default stdio stream
  • Runtime narrowing helpers (declaration-merged guards) for extensible protocol unions like CreateElicitationResponse
  • Working example implementations of both Agents and Clients under src/examples

Common Use Cases

  • Building a new AI coding agent that needs to speak a standard protocol to any ACP-compatible editor
  • Adding ACP client support to a code editor so it can drive third-party coding agents
  • Wiring an agent’s prompt/sessionUpdate flow into an editor’s UI via typed handler registration
  • Prototyping agent/client behavior locally using the bundled example implementations
  • Bridging an existing agent (e.g. a CLI-based coding assistant) into ACP via the Node.js process adapter

Under The Hood

Architecture: The package is organized around a central acp.ts entrypoint (~4,200 lines) that re-exports generated schema types and guards, and layers typed agent()/client() builder functions over a lower-level JSON-RPC engine split across connection.ts (message routing/handler registration) and jsonrpc.ts (~1,400 lines: request IDs, correlation, RequestError, notification dispatch); transport concerns are decoupled from protocol logic through a Stream interface implemented separately for stdio, HTTP (http-stream.ts), WebSockets (ws-stream.ts, ws-server.ts), and Node.js child processes (node-adapter.ts). Tech Stack: Modern TypeScript (ESM-only, type: module) targeting Node.js, with Zod as a peer dependency for schema validation, ws for WebSocket transport, and a generated schema layer produced via @hey-api/openapi-ts from the protocol specification, keeping hand-written code and generated code (*.gen.ts) clearly separated. Code Quality: Every core module has a co-located .test.ts file (connection, jsonrpc, server, sse, ws-stream, schema-deserialize, cookie-store) run under Vitest, and the check script chains lint, format-check, spellcheck, build, test, and TypeDoc verification, indicating a CI-enforced quality bar; tsc strictness plus generated Zod schemas gives both compile-time and runtime type safety. API Design: The builder pattern (agent({...}).initialize(...).newSession(...).prompt(...)) reads as a fluent, discoverable surface that only requires implementing the handlers relevant to one’s role, while re-exporting protocol constants (AGENT_METHODS, CLIENT_METHODS, PROTOCOL_VERSION) keeps consumers aligned with the spec without hardcoding method name strings.

Used by 15 apps in this directory

TypeScript
95%
Apache 2.0

AionUi

AI Agents · Productivity

33,179

Free, open-source Cowork desktop app that unifies Claude Code, Codex, Gemini CLI, and 20+ AI agents into a single platform with multi-agent teams, 24/7 cron automation, and zero-config built-in agent.

View details
85
Repo Health
76
Technical
66
Dependency
Built with
TypeScript 95%
Updated 3 weeks ago
TypeScript
98%
Apache 2.0

Cline

AI Code Assistants

69,455

An open-source AI coding agent that lives in your editor and terminal — reads and edits your codebase, runs commands, browses the web, and requires human approval for every action by default.

View details
90
Repo Health
74
Technical
65
Dependency
Built with
TypeScript 98%
Updated 5 days ago
TypeScript
96%
MIT

deepseek-harness

AI Agents · AI Development · Developer Tools

237,945

An open-source, plugin-based agent harness from DeepSeek AI that runs coding and automation agents across web, desktop, CLI, and SDK surfaces.

View details
81
Repo Health
89
Technical
74
Dependency
Built with
TypeScript 96%
Updated 6 days ago
TypeScript
98%
MIT

Kimi Code CLI

AI Agents · AI Code Assistants · Developer Tools

7,705

A single-binary, terminal-native coding agent that reads, edits, and runs code end to end, built by Moonshot AI for Kimi models but pluggable with Anthropic, OpenAI, and Google providers too.

View details
82
Repo Health
87
Technical
67
Dependency
Built with
TypeScript 98%
Updated 5 days ago
TypeScript
92%
Apache 2.0

Apache Maka

AI Agents · AI Development · Developer Tools

5,668

An Apache-incubated agent workspace that treats every model call, tool run, and permission decision as an append-only, replayable event log instead of disposable chat history.

View details
81
Repo Health
85
Technical
81
Dependency
Built with
TypeScript 92%
Updated 5 days ago
TypeScript
99%
Apache 2.0

Mastra Code

AI Code Assistants

28,378

"A coding agent that never compacts" — a terminal-based AI coding agent built on the Mastra framework, with Observational Memory instead of context compaction, multi-model support, and OAuth login for Claude Max or ChatGPT Plus.

View details
90
Repo Health
73
Technical
65
Dependency
Built with
TypeScript 99%
Updated 5 days ago
TypeScript
97%
GPL 3.0

OpenKnowledge

Code Editors · Knowledge Management · Note Taking

4,337

A beautiful, local-first markdown IDE that turns any git repo into a live collaborative workspace for humans and AI coding agents like Claude, Codex, and OpenCode.

View details
79
Repo Health
89
Technical
64
Dependency
Built with
TypeScript 97%
Updated 5 days ago
TypeScript
90%
MIT

open-pencil

AI Design Tools · Design Tools

8,642

An open-source design editor that reads native Figma files, ships a built-in AI assistant with 100+ design tools, and offers real-time serverless collaboration — all without giving up your files.

View details
81
Repo Health
78
Technical
69
Dependency
Built with
TypeScript 90%
Updated 1 weeks ago
TypeScript
91%
MIT

OpenClaw

AI Agents · AI Assistants

390,670

An open-source AI assistant that runs on your own hardware and meets you in Discord, Slack, WhatsApp, iMessage, Telegram, and 20+ other channels, with native apps for every major platform.

View details
88
Repo Health
88
Technical
68
Dependency
Built with
TypeScript 91%
Updated 5 days ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers