Skip to content

Anthropic Claude Agent SDK (TypeScript)

TypeScript port of the Claude Agent SDK. Same Computer Use, MCP, tool-use, and streaming capabilities — built for Node and browser environments.

Install

Terminal window
npm install @anthropic-ai/claude-agent-sdk

Version

v0.2.128 · May 2026 · Node 18+

Best for

Full-stack Claude apps, Node streaming servers, MCP-rich workflows.

  • v0.2.127–0.2.128 (May 5) — Patch releases; dependency updates.
  • v0.2.124–0.2.126 (May 1) — Patch releases; dependency updates. Note: 0.2.125 was not published.
  • v0.2.122–0.2.123 (April 29) — Patch releases; dependency updates.
  • v0.2.120–0.2.121 (April 26–28) — Patch releases; dependency updates.
  • v0.2.118–0.2.119 (April 23–24) — Patch releases; dependency updates.
  • v0.2.117 (April 21) — Patch release; dependency updates.
  • v0.2.116 (April 20) — Stability improvements.
  • v0.2.111–0.2.114 (April 16–17) — Patch series: MCP protocol alignment, extended-thinking type alignment with Python SDK, performance improvements.
  • v0.2.110 — Multibyte character fix; MCP cleanup; extended thinking config types.
  • Prior: package rename (@anthropic-ai/claude-code-sdk@anthropic-ai/claude-agent-sdk); Computer Use; MCP; session management; hooks.

There is no Agent class in @anthropic-ai/claude-agent-sdk 0.2.117. The public entry points are query() (one-shot) and the lower-level exports listed on the package. Earlier drafts of this page documented a new Agent({...}) constructor — it does not exist.

// One-shot query
import { query } from '@anthropic-ai/claude-agent-sdk';
for await (const message of query({
prompt: 'What is 15 + 27?',
options: {
model: 'claude-3-5-sonnet-latest',
systemPrompt: 'You are a helpful assistant.',
},
})) {
console.log(message);
}

For richer session flows use the session helpers (forkSession, listSessions, InMemorySessionStore) or the MCP server factory createSdkMcpServer.

Ready? Start Zero → Hero Step 1 →


DateFramework version (installed)Summary of changesReviewer
2026-05-05@anthropic-ai/claude-agent-sdk 0.2.128Version bumped 0.2.126 → 0.2.128 (two patch releases: 0.2.127, 0.2.128); “What’s new” updated; revision history entry added. query (runtime export), PermissionMode/McpServerConfig (TypeScript type exports in sdk.d.ts) verified against npm @anthropic-ai/claude-agent-sdk@latest (0.2.128, 2026-05-05, .routine-envs/check-0505-node).Claude routine
2026-05-01@anthropic-ai/claude-agent-sdk 0.2.126Version bumped 0.2.123 → 0.2.126 (two patch releases: 0.2.124, 0.2.126; 0.2.125 not published); “What’s new” section updated for 0.2.124–0.2.126 patch series. Version confirmed against npm @anthropic-ai/claude-agent-sdk@latest (0.2.126, 2026-05-01).Claude routine
2026-04-29@anthropic-ai/claude-agent-sdk 0.2.123Version bumped 0.2.121 → 0.2.123 (two patch releases: 0.2.122, 0.2.123); “What’s new” section updated for 0.2.122–0.2.123 patch series. Version confirmed against npm.Claude routine
2026-04-28@anthropic-ai/claude-agent-sdk 0.2.121Version bumped 0.2.119 → 0.2.121 (two patch releases); “What’s new” section updated for 0.2.120–0.2.121 patch series. Version confirmed against npm.Claude routine
2026-04-24@anthropic-ai/claude-agent-sdk 0.2.119Version bumped 0.2.117 → 0.2.119; “What’s new” section updated for 0.2.118–0.2.119 patch series.Claude routine
2026-04-22@anthropic-ai/claude-agent-sdk 0.2.117Version bumped 0.2.116 → 0.2.117; “What’s new” section updated; revision history entries added for 0.2.111–0.2.117 patch series.Claude routine
2026-04-21@anthropic-ai/claude-agent-sdk 0.2.116Minimal example rewritten after pkg introspection: new Agent(...) does not exist; use query() / session helpers. Banner bumped to 0.2.116.
2026-04-18@anthropic-ai/claude-agent-sdk 0.2.113Stability fixes; SDK rename stabilised.
2025Renamed from @anthropic-ai/claude-code-sdk to @anthropic-ai/claude-agent-sdk.

Note: Python implementation lives at Claude Agent SDK (Python).