Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/modelcontextprotocol/csharp-sdk/llms.txt

Use this file to discover all available pages before exploring further.

The MCP C# SDK consists of three main NuGet packages, each designed for specific use cases. Choose the package that best fits your project’s requirements.

Available Packages

ModelContextProtocol.Core

Core client and low-level server APIs with minimal dependencies

ModelContextProtocol

Main package with hosting and dependency injection extensions

ModelContextProtocol.AspNetCore

HTTP-based MCP server capabilities for ASP.NET Core

Package Details

ModelContextProtocol.Core

NuGet version Best for: Projects that only need client functionality or low-level server APIs with minimal dependencies. Key Features:
  • MCP client implementation
  • Low-level server APIs
  • Core protocol types and utilities
  • Minimal dependency footprint
Installation:
dotnet add package ModelContextProtocol.Core

ModelContextProtocol

NuGet version Best for: Most projects that don’t need HTTP server capabilities. Key Features:
  • All features from ModelContextProtocol.Core
  • Hosting extensions
  • Dependency injection support
  • Server builder APIs
Installation:
dotnet add package ModelContextProtocol
This is the recommended package for most server implementations using stdio or other non-HTTP transports.

ModelContextProtocol.AspNetCore

NuGet version Best for: HTTP-based MCP server implementations. Key Features:
  • All features from ModelContextProtocol
  • ASP.NET Core integration
  • HTTP transport support
  • SSE (Server-Sent Events) capabilities
Installation:
dotnet add package ModelContextProtocol.AspNetCore

Package Selection Guide

Use this decision tree to select the right package:
Use ModelContextProtocol.Core for the minimal dependency footprint, or ModelContextProtocol if you need hosting and dependency injection features.
Use ModelContextProtocol for hosting and dependency injection support.
Use ModelContextProtocol.AspNetCore for full ASP.NET Core integration.
Use ModelContextProtocol.Core for the smallest footprint.

Version Compatibility

All three packages follow the same versioning scheme and are released together. When using multiple packages, ensure they are all on the same version to avoid compatibility issues.
Mixing different versions of MCP packages in the same project can lead to runtime errors and unexpected behavior.

Next Steps

Build docs developers (and LLMs) love