modelcontextprotocol/csharp-sdk
The official C# SDK for Model Context Protocol servers and clients. Maintained in collaboration with Microsoft.
What it solves
MCP standardizes how applications provide context to LLMs, enabling secure integration between LLMs and various data sources and tools. This SDK brings MCP to the .NET ecosystem, letting developers implement clients and servers without reinventing the protocol, while offering modular packages to keep dependencies minimal.
How it works
The SDK is split into multiple NuGet packages, each targeting a specific need:
- ModelContextProtocol.Core: minimal client and low-level server APIs with the fewest dependencies.
- ModelContextProtocol: the main package with hosting and dependency injection extensions, ideal for most projects that don't need HTTP server capabilities.
- ModelContextProtocol.AspNetCore: for building HTTP-based MCP servers.
- ModelContextProtocol.Extensions.Apps: supports interactive UI applications that render inside MCP hosts.
- ModelContextProtocol.Extensions.Skills: serves and consumes Agent Skills with verifiable file manifests.
- ModelContextProtocol.Extensions.Tasks: runs long‑running tool invocations asynchronously with status polling and input requests. It also supports the Cross‑Application Access Identity Assertion Authorization Grant flow, and includes complete getting‑started guides, samples, and API documentation.
Who it's for
.NET developers and teams building applications, services, or libraries that need to expose or consume MCP capabilities—whether as clients, servers, or embedded UI. It's suitable for projects that want a standard, secure way to connect LLMs to their own data and tools.
Highlights
- Official SDK for the Model Context Protocol, maintained by the MCP organization.
- Modular package design to minimize dependencies based on use case.
- Full support for HTTP-based servers via ASP.NET Core integration.
- Extensions for interactive apps, agent skills, and asynchronous task handling.
- Includes identity assertion support for cross-application access.
- Licensed under Apache License 2.0.
Related
- Project
- Project
- Project
- Project
- Project