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 structured outputs—within the standardized interface of the Vercel AI SDK, eliminating the need to write provider-specific code for these advanced features.
How it works
The library acts as a provider for the Vercel AI SDK. It wraps the @anthropic-ai/claude-agent-sdk and the Claude Code CLI, translating AI SDK calls (like streamText or generateText) into instructions that the Claude Agent SDK can execute. It supports multiple versions of the AI SDK (v4 through v7) and handles the underlying authentication and session management required by the Claude CLI.
Who it’s for
Developers building AI applications with the Vercel AI SDK who want to leverage the specific agentic tools, MCP (Model Context Protocol) servers, and native structured output capabilities of the Claude Agent SDK.
Highlights
- Vercel AI SDK Integration: Full compatibility with
streamTextandgenerateTextacross multiple SDK versions. - Native Structured Outputs: Supports constrained decoding via Zod schemas to ensure valid, schema-compliant JSON output.
- Agentic Tooling: Access to MCP servers, tool permissions, and custom plugins.
- Advanced Session Control: Features for resuming, forking, and managing sessions, including budget limits and sandbox configuration.
- Fine-grained Callbacks: Provides hooks for
onSdkMessage,canUseTool, and other task/MCP status events.
Related
- Project
- Project
- Project
- Project
- Project