# @langchain/protocol

> TypeScript bindings for the LangChain agent streaming protocol

Latest version **0.0.19** (published 2026-08-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install @langchain/protocol
pnpm add @langchain/protocol
yarn add @langchain/protocol
bun add @langchain/protocol
```

## Health

**Score 65/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; recently updated; high maintenance score.

Warnings: low downloads; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.0.19 |
| Published | 2026-08-26 |
| First published | 2026-04-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 40.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | lc-oss-admin, langchain-security |
| Keywords | langchain, langgraph, protocol, streaming, agents, typescript |

## Links

- npm: https://www.npmjs.com/package/@langchain/protocol
- npm.io page: https://npm.io/package/@langchain/protocol

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 0.0.19 (latest) — 2026-08-26
- 0.0.14-alpha.1 (dev) — 2026-04-29
- 0.0.18 — 2026-06-18
- 0.0.17 — 2026-06-18
- 0.0.16 — 2026-05-28
- 0.0.15 — 2026-04-30
- 0.0.14 — 2026-04-29
- 0.0.13 — 2026-04-24
- 0.0.12 — 2026-04-23
- 0.0.11 — 2026-04-23
- 0.0.10 — 2026-04-17
- 0.0.9 — 2026-04-16
- 0.0.8 — 2026-04-15
- 0.0.7 — 2026-04-13
- 0.0.6 — 2026-04-10
- … 5 more at https://npm.io/package/@langchain/protocol/versions

## README

# `@langchain/protocol`

TypeScript bindings for the LangChain agent streaming protocol.

This package publishes the generated TypeScript schema bindings from
`protocol.cddl` so TypeScript applications can type protocol commands, events,
results, and content blocks consistently.

## What this package includes

- Generated TypeScript protocol bindings in `protocol.ts`
- Types for top-level messages such as `Command`, `Message`, and protocol events
- Types for protocol modules including run, subscription, agent, input, state,
  and usage

## What this package does not include

This package does not currently ship a runtime client, transport, or helper APIs.
It is intended for typing protocol payloads and generated bindings only.

## Installation

```bash
npm install @langchain/protocol
```

## Usage

Use type-only imports when consuming the protocol schema:

```ts
import type {
  Command,
  Message,
  SubscribeParams,
  MessagesEvent,
} from "@langchain/protocol";
```

You can then use the exported types to model protocol payloads in your own
transport or client implementation:

```ts
import type { Command, SubscribeParams } from "@langchain/protocol";

const params: SubscribeParams = {
  channels: ["messages", "lifecycle"],
};

const subscribeCommand: Command = {
  id: 1,
  method: "subscription.subscribe",
  params,
};
```

## Source of truth

The canonical protocol definition lives at [`protocol.cddl`]([https://](https://github.com/langchain-ai/agent-protocol/blob/main/streaming/protocol.cddl)). The TypeScript
bindings in this package are generated from that schema.

---
_Source: https://npm.io/package/@langchain/protocol · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
