Docs
Choose your preferred AI platform and authentication method to get started with Agentsfera.
C# SDK
Agentsfera C# SDK
The Agentsfera C# SDK provides a type-safe .NET client for integrating MCP functionality into enterprise applications, ASP.NET services, and desktop software. Built on the official Model Context Protocol .NET library, it offers seamless access to 500+ business integrations through a modern, async-first C# API.
Why Use the C# SDK?
- Enterprise-Grade Type Safety: Full C# type definitions with nullable reference types and compile-time error checking for robust applications.
- .NET Ecosystem Integration: Works seamlessly with ASP.NET Core, WPF, WinForms, Blazor, and .NET MAUI applications.
- Async/Await Support: Modern async patterns with Task-based asynchronous programming for responsive applications.
- NuGet Package Manager: Simple installation via dotnet CLI, Visual Studio Package Manager, or Paket for easy dependency management.
Installation & Setup
Install via NuGet with a single command. Authenticate using API keys in HTTP headers, then access tools from any enabled integration using strongly-typed method calls.
Installation
Install the official MCP C# SDK using your package manager:
dotnet add package ModelContextProtocol --prereleaseC# SDK
using ModelContextProtocol.Client;
var httpClient = new HttpClient();
httpClient.DefaultRequestHeaders.Add("Authorization", "Bearer sk-7aefcd76-44c0-4687-a0a9-43599d050fdd");
httpClient.DefaultRequestHeaders.Add("user-session-id", "your-user-unique-id");
var transport = new SseClientTransport(new()
{
Endpoint = new Uri("https://api.agentsfera.ai"),
Name = "undefined"
}, httpClient);
var client = await McpClientFactory.CreateAsync(transport);
// Print the list of tools available from the server
foreach (var tool in await client.ListToolsAsync())
{
Console.WriteLine($"{tool.Name} ({tool.Description})");
}No API keys found. Create an API key first to use the C# SDK integration.
