Scxp.Sdk
0.1.6
dotnet add package Scxp.Sdk --version 0.1.6
NuGet\Install-Package Scxp.Sdk -Version 0.1.6
<PackageReference Include="Scxp.Sdk" Version="0.1.6" />
<PackageVersion Include="Scxp.Sdk" Version="0.1.6" />
<PackageReference Include="Scxp.Sdk" />
paket add Scxp.Sdk --version 0.1.6
#r "nuget: Scxp.Sdk, 0.1.6"
#:package Scxp.Sdk@0.1.6
#addin nuget:?package=Scxp.Sdk&version=0.1.6
#tool nuget:?package=Scxp.Sdk&version=0.1.6
Scxp.Sdk
.NET SDK for the Symmetric Context Exchange Protocol (SCXP) — a protocol for exchanging tool catalogs and tool calls between a consumer (which discovers and invokes tools) and a provider (which registers and serves them).
The SDK is transport-agnostic: you bring the transport (WebSocket, TCP, stdio,
...) by implementing a small IChannel, and the SDK handles the protocol —
handshake, id correlation, batching, and Gen A tool-schema generation.
Install
dotnet add package Scxp.Sdk
Provider — expose tools
using Scxp.Sdk;
public class Tools
{
[Tool(Name = "add", Domain = "com.example.math", Description = "Add two integers.")]
public int Add(int a, int b) => a + b;
}
var catalog = ProviderCatalog.FromObject(new Tools(), new Info { Name = "my-provider", Version = "1.0.0" });
// `channel` is your IChannel implementation, already connected.
var provider = await Provider.CreateAsync(channel, catalog);
// The provider now serves tools/list and tools/call.
Consumer — discover and invoke tools
using Scxp.Sdk;
using System.Text.Json.Nodes;
// `channel` is your IChannel implementation, already connected.
var consumer = await Consumer.CreateAsync(channel, new ConsumerConfig
{
Info = new Info { Name = "my-app", Version = "1.0.0" },
});
var manifest = await consumer.ListToolsAsync(); // discover
var result = await consumer.CallToolAsync("add", new JsonObject { ["a"] = 2, ["b"] = 3 });
// result.Content[0] -> "5"
Bring your own transport
Implement IChannel (send bytes, receive bytes, observe close). A runnable
WebSocket example lives in the repository under examples/.
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
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
0.1.6: Adds [ToolDomain] — domain-level description/when_to_use/when_not_to_use are now emitted in the tools/list manifest, so a consumer can choose between domains by prose instead of by role name. Declared on the class owning the domain's tools; omitting it emits the same manifest as before. In sync with scxp (Python) 0.1.6. Supports SCXP protocol version 1.