JD.SemanticKernel.Connectors.ClaudeCode
0.1.2
.NET 8.0
This package targets .NET 8.0. The package is compatible with this framework or higher.
.NET Standard 2.0
This package targets .NET Standard 2.0. The package is compatible with this framework or higher.
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package JD.SemanticKernel.Connectors.ClaudeCode --version 0.1.2
NuGet\Install-Package JD.SemanticKernel.Connectors.ClaudeCode -Version 0.1.2
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="JD.SemanticKernel.Connectors.ClaudeCode" Version="0.1.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="JD.SemanticKernel.Connectors.ClaudeCode" Version="0.1.2" />
<PackageReference Include="JD.SemanticKernel.Connectors.ClaudeCode" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add JD.SemanticKernel.Connectors.ClaudeCode --version 0.1.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: JD.SemanticKernel.Connectors.ClaudeCode, 0.1.2"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package JD.SemanticKernel.Connectors.ClaudeCode@0.1.2
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=JD.SemanticKernel.Connectors.ClaudeCode&version=0.1.2
#tool nuget:?package=JD.SemanticKernel.Connectors.ClaudeCode&version=0.1.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
JD.SemanticKernel.Connectors.ClaudeCode
A Semantic Kernel connector that bridges your local Claude Code OAuth session into Microsoft Semantic Kernel — no manual API key management needed.
Features
- Zero-config authentication — automatically reads
~/.claude/.credentials.json - Multi-source credential resolution — options → env vars → local session, in priority order
- OAuth & API key support — handles
sk-ant-oat*(Bearer) andsk-ant-api*(x-api-key) tokens - Full Semantic Kernel integration —
IKernelBuilder.UseClaudeCodeChatCompletion()one-liner - DI-friendly —
IServiceCollection.AddClaudeCodeAuthentication()for ASP.NET Core / Generic Host - Broad TFM support —
netstandard2.0,net8.0,net10.0
Quick Start
Install
dotnet add package JD.SemanticKernel.Connectors.ClaudeCode
Kernel Builder (Recommended)
using JD.SemanticKernel.Connectors.ClaudeCode;
var builder = Kernel.CreateBuilder();
builder.UseClaudeCodeChatCompletion();
var kernel = builder.Build();
var result = await kernel.InvokePromptAsync("Hello, Claude!");
Console.WriteLine(result);
Service Collection (ASP.NET Core)
builder.Services.AddClaudeCodeAuthentication(options =>
{
options.CredentialsPath = "/custom/path/.credentials.json"; // optional
});
Configuration Binding
{
"ClaudeSession": {
"ApiKey": null,
"OAuthToken": null,
"CredentialsPath": null
}
}
builder.Services.AddClaudeCodeAuthentication(builder.Configuration);
Credential Resolution Order
| Priority | Source | Description |
|---|---|---|
| 1 | ClaudeSession:ApiKey |
Explicit API key in options/config |
| 2 | ClaudeSession:OAuthToken |
Explicit OAuth token in options/config |
| 3 | ANTHROPIC_API_KEY env var |
Environment variable |
| 4 | CLAUDE_CODE_OAUTH_TOKEN env var |
Environment variable |
| 5 | ~/.claude/.credentials.json |
Claude Code local session file |
Sample CLI Tools
This repo includes three proof-of-concept tools demonstrating agentic workflows with Semantic Kernel:
| Tool | Command | Description |
|---|---|---|
| Gherkin Generator | jdgerkinator |
Converts acceptance criteria into Gherkin/Reqnroll specs |
| PR Review Agent | jdpr |
Multi-provider PR review (GitHub, Azure DevOps, GitLab) |
| Codebase Explorer | jdxplr |
Profiles codebases into structured knowledgebases |
Install as global tools:
dotnet tool install -g JD.Tools.GherkinGenerator
dotnet tool install -g JD.Tools.PullRequestReviewer
dotnet tool install -g JD.Tools.CodebaseExplorer
Documentation
Full documentation is available at the DocFX site including:
- Getting Started
- Credential Resolution
- Kernel Builder Integration
- Service Collection Integration
- HttpClientFactory
- Configuration Reference
- Sample Tools Guide
Building
dotnet build
dotnet test
Build Documentation
cd docs
dotnet tool restore
dotnet docfx docfx.json
License
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
.NETStandard 2.0
- Microsoft.Extensions.Configuration.Abstractions (>= 10.0.2)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.2)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.2)
- Microsoft.Extensions.Options (>= 10.0.2)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 10.0.2)
- System.Text.Json (>= 8.0.5)
-
net10.0
- Anthropic.SDK (>= 5.9.0)
- Microsoft.Extensions.AI (>= 10.2.0)
- Microsoft.Extensions.Configuration.Abstractions (>= 10.0.2)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.2)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.2)
- Microsoft.Extensions.Options (>= 10.0.2)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 10.0.2)
- Microsoft.SemanticKernel (>= 1.70.0)
-
net8.0
- Anthropic.SDK (>= 5.9.0)
- Microsoft.Extensions.AI (>= 10.2.0)
- Microsoft.Extensions.Configuration.Abstractions (>= 10.0.2)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.2)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.2)
- Microsoft.Extensions.Options (>= 10.0.2)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 10.0.2)
- Microsoft.SemanticKernel (>= 1.70.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.