MCP C# SDK

Active
GitHub C# NOASSERTION

Description

The official C# SDK for the Model Context Protocol, maintained in collaboration with Microsoft, enabling developers to build MCP servers and clients in the .NET ecosystem.

Key Features

  • Official C# SDK for Model Context Protocol maintained in collaboration with Microsoft
  • Three-tier package architecture: Core (minimal), Main (hosting+DI), and AspNetCore (HTTP servers)
  • Full MCP client and server implementation for .NET applications and services
  • Cross-application access support via Identity Assertion Authorization Grant flow
  • Dependency injection and hosting extensions for seamless ASP.NET Core integration
  • Comprehensive API documentation and sample projects for quick onboarding

Use Cases

💡 Building MCP servers in .NET to expose tools and resources to LLM applications
💡 Creating MCP clients in C# to connect LLM agents with enterprise data sources
💡 Integrating MCP into existing ASP.NET Core web services with dependency injection
💡 Implementing secure cross-application authentication for multi-tenant MCP deployments
💡 Developing .NET libraries that standardize LLM context integration across services

Categories

Quick Start

Install via NuGet: 'dotnet add package ModelContextProtocol' (or ModelContextProtocol.AspNetCore for HTTP servers). Follow the Getting Started guide at csharp.sdk.modelcontextprotocol.io for client and server setup examples. Browse the samples directory for complete working examples.

Related Projects