ben-vargas/ai-sdk-provider-claude-code

Vercel AI SDK community provider for Claude Agent SDK

What it solves

This project provides a bridge between the Vercel AI SDK and the official Anthropic Claude Agent SDK (and Claude Code CLI). It allows developers to use Claude's agentic capabilities—such as tool use and session management—within the standardized interface of the Vercel AI SDK, simplifying the integration of Claude agents into JavaScript/TypeScript applications.

How it works

The library acts as a provider for the Vercel AI SDK. By installing the provider and authenticating the Claude Code CLI on the local machine, developers can call claudeCode() to instantiate a model. The provider then translates AI SDK requests (like streamText or generateText) into calls that the @anthropic-ai/claude-agent-sdk can understand, handling the mapping of messages, tools, and structured outputs.

Who it’s for

TypeScript and JavaScript developers who are already using the Vercel AI SDK and want to leverage the official Claude Agent SDK and Claude Code's agentic features without writing a custom integration layer.

Highlights

  • Vercel AI SDK Compatibility: Supports multiple versions of the AI SDK (v4 through v7).
  • Native Structured Outputs: Supports constrained decoding for schema-compliant JSON outputs using Zod.
  • Agentic Tooling: Integration with MCP (Model Context Protocol) servers and tool permission management.
  • Session Management: Capabilities for creating, resuming, forking, and deleting agent sessions.
  • Advanced Controls: Access to query controllers for live-session control and budget limits in USD.
  • Multi-turn Conversations: Full support for streaming and multi-turn interactions.

Related

  • Project
  • Project
  • Project
  • Project
  • Project