CodedProjects.AI.ApiMapper.Client.SemanticKernel
1.2.0
dotnet add package CodedProjects.AI.ApiMapper.Client.SemanticKernel --version 1.2.0
NuGet\Install-Package CodedProjects.AI.ApiMapper.Client.SemanticKernel -Version 1.2.0
<PackageReference Include="CodedProjects.AI.ApiMapper.Client.SemanticKernel" Version="1.2.0" />
<PackageVersion Include="CodedProjects.AI.ApiMapper.Client.SemanticKernel" Version="1.2.0" />
<PackageReference Include="CodedProjects.AI.ApiMapper.Client.SemanticKernel" />
paket add CodedProjects.AI.ApiMapper.Client.SemanticKernel --version 1.2.0
#r "nuget: CodedProjects.AI.ApiMapper.Client.SemanticKernel, 1.2.0"
#:package CodedProjects.AI.ApiMapper.Client.SemanticKernel@1.2.0
#addin nuget:?package=CodedProjects.AI.ApiMapper.Client.SemanticKernel&version=1.2.0
#tool nuget:?package=CodedProjects.AI.ApiMapper.Client.SemanticKernel&version=1.2.0
CodedProjects AI ApiMapper .NET SDK
The CodedProjects AI ApiMapper .NET SDK helps .NET applications discover and invoke governed AI-facing tools exposed by the AI ApiMapper Runtime.
Use these packages when you want to:
- connect an AI client to tenant-scoped tools published by AI ApiMapper,
- fetch the runtime system prompt and available tool definitions,
- invoke tools through a typed .NET client,
- bridge those tools into common .NET AI stacks such as
Microsoft.Extensions.AI, Semantic Kernel, and Azure AI Foundry.
Packages
Core client
dotnet add package CodedProjects.AI.ApiMapper.Client
Provides the base IAiApiMapperClient, HTTP client registration, authentication configuration, tool discovery, and tool invocation support.
Microsoft.Extensions.AI adapter
dotnet add package CodedProjects.AI.ApiMapper.Client.MicrosoftExtensionsAI
Converts runtime tools into AIFunction instances for Microsoft.Extensions.AI.
Semantic Kernel adapter
dotnet add package CodedProjects.AI.ApiMapper.Client.SemanticKernel
Loads published runtime tools as a Semantic Kernel plugin.
Azure AI Foundry adapter
dotnet add package CodedProjects.AI.ApiMapper.Client.AzureAIFoundry --prerelease
Adds Azure AI Foundry agent integration. This package is currently prerelease because it depends on prerelease Azure AI agent libraries.
Quick start
using CodedProjects.AI.ApiMapper.Client;
using Microsoft.Extensions.DependencyInjection;
var services = new ServiceCollection();
services
.AddApiMapperClient(options =>
{
options.BaseUrl = new Uri("https://runtime.example.com/");
options.TenantId = Guid.Parse("11111111-1111-1111-1111-111111111111");
options.ClientId = "my-ai-client";
options.SystemPromptResourceUri = "apimapper://toolsets/system-prompt";
})
.WithApiKey("replace-with-your-api-key");
After resolving IAiApiMapperClient, you can:
- call
GetSystemPromptAsync()to load the runtime-provided system prompt, - call
GetToolsAsync()to enumerate published tools, - call
InvokeToolAsync()to execute a tool with JSON-like arguments.
Examples
Runnable examples are available for:
- raw MCP-style client usage,
Microsoft.Extensions.AI,- Semantic Kernel,
- Azure AI Foundry.
Streamable HTTP / SSE
The Runtime's /mcp endpoint may answer a request with either a plain application/json body or
an SSE-framed (text/event-stream) body — both are first-class steady-state responses, not a
fallback of one another, and the choice is made server-side. CodedProjects.AI.ApiMapper.Client
handles both transparently: no configuration is needed, and every existing call
(GetToolsAsync, InvokeToolAsync, etc.) keeps working unchanged. If an SSE response is dropped
before its result arrives, the client automatically attempts one resumption via Last-Event-ID
before surfacing an error.
Two additional APIs on IAiApiMapperClient round out MCP session lifecycle support:
Closing a session
// Explicitly end the MCP session server-side (DELETE /mcp) when you're done with the client.
await client.CloseSessionAsync();
// Or dispose asynchronously, which closes the session best-effort before releasing resources:
await using var scopedClient = ...;
Listening for server-pushed messages
ListenAsync opens the standalone push stream (GET /mcp) and yields each JSON-RPC message the
Runtime pushes for the session, reconnecting automatically (with Last-Event-ID) after transient
network faults:
await foreach (var message in client.ListenAsync(cancellationToken))
{
// message is a System.Text.Json.JsonElement containing the pushed JSON-RPC payload.
Console.WriteLine(message.GetRawText());
}
Correlation IDs
Send your application's own trace ID with each call and the Runtime records it against the execution ID it generates, so you can retrieve the full platform audit trail for work you triggered. Configure an ambient provider on the client options, or pass one per call. See the SDK correlation guide.
Package metadata
- License: MIT
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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. |
-
net10.0
- CodedProjects.AI.ApiMapper.Client (>= 1.2.0)
- Microsoft.SemanticKernel (>= 1.73.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
ApiMapper SDK 1.2 release.