This project has moved from the
spring-ai-community GitHub organization to
markpollack. New releases are published under the Maven groupId
io.github.markpollack, and Java packages now use the io.github.markpollack
namespace. If you previously used org.springaicommunity, update your
dependency coordinates and imports to the current values shown below.Query (one-liner fire-and-forget), ClaudeSyncClient (blocking sessions), and ClaudeAsyncClient (reactive with Project Reactor). Pure Java β no native dependencies, and no Spring dependency either: the SDK module depends only on zt-exec, Jackson, Reactor, SLF4J and the MCP Java SDK. Spring Boot auto-configuration for Claude lives in Agent Client, not here.
This is the SDK that powers ClaudeStep in Agent Workflow β each step runs a full multi-turn Claude session internally.
Current release: 1.5.1.
1.5.0: A security, packaging and behaviour-correction release: it raises the Jackson floors so they reach standalone consumers, embeds the Apache licence in every archive, publishes a CycloneDX 1.6 SBOM, and stops a no-argument connect() from sending a prompt of its own. It follows 1.4.0, which bumped the MCP SDK from 0.15.0 to 2.0.0 (mcp-core 2.0.0), clearing CVE-2026-35568. See Whatβs New β.
Using it
How it operates
The SDK does not call the Anthropic API. It spawns the Claude Code CLI as a child process and speaks the stream-JSON control protocol to it over stdin and stdout. That shapes what you need to know:- The
claudeexecutable must be installed and authenticated on the machine that runs your code. The SDK discovers it onPATHand in the usual install locations. ANTHROPIC_API_KEYis passed through to the child process when set. Environment inheritance is otherwise a whitelist, not a copy of your whole environment.- Every session consumes real model usage and is billed. That includes the integration
test suite in the SDK repository. A no-argument
connect()sends nothing on its own: from 1.5.0 it starts and initialises the session and leaves the first turn to yourquery(...). Before 1.5.0 it substituted a literal"Hello"and billed that turn. - The child process, and its descendants, are terminated on close.
Licence
Apache License 2.0 β see the repository LICENSE. This SDK is a supporting public project and is not part of the AgentWorks BSL set.Tutorials
23 progressive modules from fundamentals to multi-agent orchestration:Query & Clients
Query API, sync client, async client, message types
Configuration
CLI options, tool permissions, permission modes, structured outputs
Sessions
Multi-turn conversations, session resume, session fork
Safety & Hooks
Permission callbacks, pre/post tool-use hooks, interrupt handling
MCP Integration
External MCP servers, multiple servers, MCP with hooks
Multi-Agent
Subagent definitions, parallel subagents, orchestrator pattern
Source
SDK Source
SDK implementation
Tutorial Code
23 runnable tutorial modules
Role in the Lab
- Agent Workflow uses
ClaudeStepwhich wrapsClaudeSyncClientβ each workflow step runs a full multi-turn Claude session - Agent Client uses the SDK for Claude Code integration with Spring Boot lifecycle and sandbox isolation
- All experiments invoke Claude through this SDK via the experiment driverβs
ClaudeSdkInvoker