modelcontextprotocol/csharp-sdk

The official C# SDK for Model Context Protocol servers and clients. Maintained in collaboration with Microsoft.

What it solves

It provides a standardized way for .NET applications to integrate with the Model Context Protocol (MCP), allowing developers to securely connect Large Language Models (LLMs) to various data sources and tools without needing to build custom integrations for every application.

How it works

The SDK offers a suite of NuGet packages that allow developers to implement both MCP clients and servers. It supports different deployment models, including low-level APIs for minimal dependencies, hosting and dependency injection extensions for general use, and specific libraries for HTTP-based servers. It also includes extensions for building interactive UI applications (MCP Apps) and managing long-running asynchronous tool invocations (MCP Tasks).

Who it’s for

.NET developers building AI-powered applications, services, or libraries that need to provide context or tool-access to LLMs using the Model Context Protocol.

Highlights

  • Modular Package System: Offers specialized packages for core functionality, AspNetCore integration, and specific extensions.
  • Asynchronous Task Management: Includes a dedicated extension for long-running tool invocations with status polling.
  • Interactive UI Support: Provides tools to build applications that render directly inside MCP hosts.
  • Identity Assertion: Supports the Identity Assertion Authorization Grant flow for secure cross-application access.

Related

  • Project
  • Project
  • Project
  • Project
  • Project