Skip to content

Releases: modelcontextprotocol/csharp-sdk

v0.4.1-preview.1

25 Nov 23:44
7f25ae9

Choose a tag to compare

v0.4.1-preview.1 Pre-release
Pre-release

Breaking Changes

The v0.4.1-preview.1 release includes breaking changes included in #892 and #969.

  1. #892 audits and standardizes MCP protocol types for consistency, including API changes for:
  2. Property mutability
  3. Required properties
  4. Collection types used for properties
  5. #969 implements SEP-1330: Elicitation Enum Schema Improvements and Standards Compliance, which involved a breaking change to the specification:
  6. EnumSchema is marked [Obsolete] using the default CS0618 diagnostic, and it becomes an alias for LegacyTitledEnumSchema, which is also marked as [Obsolete] using the default CS0618 diagnostic

Path to 1.0.0

We are working toward the first stable version of the C# SDK as version 1.0.0, which will have compliance with Version 2025-11-25 of the MCP specification. We will publish at least one more pre-release version of the SDK before declaring the stable version, and breaking changes to Remove obsolete interfaces and extension methods (#774) are expected as part of stablizing the API.

Refer to the new C# SDK Versioning documentation for information regarding our versioning, breaking change, and support approaches once we publish the 1.0.0 release.

What's Changed

  • Add default value support for all primitive types in elicitation schemas (SEP-1034) by @Copilot in #924
  • Audit protocol types by @MackinnonBuck in #892
  • Implement SEP-986: Specify Format for Tool Names by @stephentoub in #945
  • Add public constructors to McpClient types for reusing cached definitions by @Copilot in #938
  • Tweak how McpClientTool.InvokeAsync exposes some content by @stephentoub in #941
  • Ignore unexpected properties when deserializing a ContentBlock by @jeffhandley in #956
  • Remove prerelease requirement from global.json by @eiriktsarpalis in #961
  • Add Description property to Implementation type per MCP spec by @Copilot in #966
  • Remove TODOs related to AllowOutOfOrderMetadataProperty workarounds. by @eiriktsarpalis in #977
  • Make JsonRpcMessageWithId.RequestId non-required by @MackinnonBuck in #984
  • Implement SEP-1330: Standards-compliant enum schemas for elicitation by @Copilot in #969
  • Add production-ready incremental source generator for automatic Description attributes from XML comments by @Copilot in #899
  • Add tools support to sampling by @stephentoub in #976
  • Use JsonElement.Parse for string-to-JsonElement deserialization by @Copilot in #1002
  • Fix race condition in StdioClientTransport on .NET Framework by @Copilot in #996
  • Tokens can be cached beyond the lifetime of the (http) transport. by @halllo in #834
  • Add ability for client to resume session by @halter73 in #1029

Documentation Updates

  • Update ModelId in QuickStartClient to non-deprecated version by @PederHP in #926
  • Add file-based MCP server sample by @PederHP in #931
  • Align error handling documentation with SEP-1303 by @Copilot in #967
  • Fix a couple issues in the client sample readme by @ericstj in #994
  • Fix documentation typos and incorrect type references by @Copilot in #993
  • Introduce versioning, breaking changes, and support document by @jeffhandley in #986
  • Address additional feedback on Versioning doc by @jeffhandley in #999
  • Tweak the file-based MCP server sample by @eiriktsarpalis in #1019
  • Writing style edits by @gewarren in #1024

Repository Infrastructure Updates

New Contributors

Full Changelog: v0.4.0-preview.3...v0.4.1-preview.1

v0.4.0-preview.3

20 Oct 19:59
2da9299

Choose a tag to compare

v0.4.0-preview.3 Pre-release
Pre-release

What's Changed

  • Implement SEP-973: Icons and metadata support for Implementations, Resources, Tools, and Prompts by @Copilot in #802
  • Fix slow shutdown when a Streamable HTTP client is connected by @halter73 in #843
  • Fix sample projects to work in GitHub Codespaces by installing .NET 9.0 SDK by @Copilot in #854
  • Fix markdown links in docs and add docfx CI validation by @Copilot in #862
  • Remove problematic System.Net.Http package reference from tests by @stephentoub in #867
  • Propagate tool call exceptions through filters by @halter73 in #844
  • Fix comments on McpServerTool/Prompt/Resource by @stephentoub in #866
  • Add net10.0 assets and run some fixers by @stephentoub in #875
  • Fix: Synthesize handlers for empty tool/prompt/resource collections by @Copilot in #865
  • Convert EverythingServer to use Streamable HTTP by @mikekistler in #709
  • Add McpMetaAttribute for attaching metadata to tools, prompts, and resources by @Copilot in #857
  • Add comprehensive test coverage for resource capability preservation with WithResources by @Copilot in #896
  • Fix regression matching templated McpServerResources by @halter73 in #897
  • Call Regex.IsMatch when Match is not needed by @halter73 in #903

Repository Infrastructure Updates

  • ✨ Set up Copilot instructions for repository by @Copilot in #858
  • Pin global.json to rc.1 SDK by @halter73 in #869
  • Pin GitHub workflows to rc.1 SDK by @halter73 in #871
  • Delete .github/workflows/copilot-setup-steps.yml by @stephentoub in #882
  • Update copilot-setup-steps.yml to use global.json for .NET SDK version by @Copilot in #888
  • Add copilot-setup-steps.yml to preinstall .NET 10 SDK in GitHub Copilot environment by @Copilot in #877
  • Move copilot-setup-steps.yml to workflows directory per GitHub documentation by @Copilot in #879
  • Add copilot setup steps by @stephentoub in #885
  • Onboard repository to Dependabot for automated testing and AI dependency updates by @Copilot in #800
  • Bump actions/setup-node from 4.3.0 to 5.0.0 by @dependabot[bot] in #845
  • Bump actions/upload-pages-artifact from 3.0.1 to 4.0.0 by @dependabot[bot] in #848
  • Bump danielpalme/ReportGenerator-GitHub-Action from 5.4.4 to 5.4.17 by @dependabot[bot] in #847
  • Bump actions/setup-dotnet from 4.3.1 to 5.0.0 by @dependabot[bot] in #846
  • Bump becheran/mlc from 0.21.0 to 1.0.0 by @dependabot[bot] in #852
  • Bump actions/checkout from 4.2.2 to 5.0.0 by @dependabot[bot] in #851
  • Bump actions/download-artifact from 4.2.1 to 5.0.0 by @dependabot[bot] in #849
  • Bump the opentelemetry-testing group with 2 updates by @dependabot[bot] in #901
  • Bump actions/setup-node from 5.0.0 to 6.0.0 by @dependabot[bot] in #900
  • Update download-artifact path reference by @jeffhandley in #905

Full Changelog: v0.4.0-preview.2...v0.4.0-preview.3

v0.4.0-preview.2

08 Oct 18:26
da30f0e

Choose a tag to compare

v0.4.0-preview.2 Pre-release
Pre-release

Breaking Changes

The v0.4.0-preview.2 release includes a breaking change to the Streamable HTTP transport's Stateless mode. Because Stateless mode no longer uses a session ID nor relies on data protection, client information like the client's name and version are no longer tracked across requests meaning McpServer.ClientInfo will always be null. If you need ClientInfo in your handlers, we recommend using the default stateful mode.

What's Changed

Full Changelog: v0.4.0-preview.1...v0.4.0-preview.2

v0.4.0-preview.1

25 Sep 16:37
be2d0f5

Choose a tag to compare

v0.4.0-preview.1 Pre-release
Pre-release

Breaking Changes

The v0.4.0-preview.1 release includes several breaking API changes, included in #723 and #765.

  1. Interfaces were replaced by abstract classes to better allow evolution of the API surface in future versions.
  2. Factory classes were deprecated and replaced by static factory methods to improve usability and align with existing .NET patterns such as HttpClient.
  3. The 'Sse' (Server-Sent Events) APIs were renamed to use 'Http', aligning with the revised Transports nomenclature.
  4. APIs for handlers and callbacks were decoupled from the protocol representation for improved separation of concerns.

Interfaces replaced by abstract classes

The IMcpClient, IMcpServer, and IMcpEndpoint interfaces are marked as [Obsolete] and will be removed in an upcoming release. These interfaces are replaced by new abstract classes.

Old New
IMcpClient McpClient
IMcpServer McpServer
IMcpEndpoint McpSession

Action: Replace usages of the obsolete interfaces with the new abstract types. Change variable, field, and parameter types. Optional, but recommended: rename identifiers like endpointsession for clarity.

Factory classes deprecated

The McpClientFactory and McpServerFactory classes are marked as [Obsolete] and will be removed in an upcoming release.

Old New
McpClientFactory.CreateAsync(...) McpClient.CreateAsync(...)
McpServerFactory.CreateAsync(...) McpServer.CreateAsync(...)

Action: Replace calls to the factory classes with the static factory methods on the abstract classes.

Rename SseClientTransport to HttpClientTransport

The SseClientTransport and SseClientTransportOptions classes were renamed to reflect Http naming instead of Sse.

Old New
SseClientTransport HttpClientTransport
SseClientTransportOptions HttpClientTransportOptions

Action: Update usage of these types to utilize the new type names.

Decouple handlers and collections from protocol types

Handlers and collections in the Capabilities types are now obsolete; they've been moved to McpClientOptions and McpServerOptions.

Old New
myClientOptions.Capabilities.NotificationHandlers myClientOptions.Handlers.NotificationHandlers
myClientOptions.Capabilities.Elicitation.ElicitationHandler myClientOptions.Handlers.ElicitationHandler
myClientOptions.Capabilities.Roots.RootsHandler myClientOptions.Handlers.RootsHandler
myClientOptions.Capabilities.Sampling.SamplingHandler myClientOptions.Handlers.SamplingHandler
myServerOptions.Capabilities.NotificationHandlers myServerOptions.Handlers.NotificationHandlers
myServerOptions.Capabilities.Completions.CompleteHandler myServerOptions.Handlers.CompleteHandler
myServerOptions.Capabilities.Logging.SetLoggingLevelHandler myServerOptions.Handlers.SetLoggingLevelHandler
myServerOptions.Capabilities.Prompts.ListPromptsHandler myServerOptions.Handlers.ListPromptsHandler
myServerOptions.Capabilities.Prompts.GetPromptHandler myServerOptions.Handlers.GetPromptHandler
myServerOptions.Capabilities.Prompts.PromptCollection myServerOptions.PromptCollection
myServerOptions.Capabilities.Resources.ListResourceTemplatesHandler myServerOptions.Handlers.ListResourceTemplatesHandler
myServerOptions.Capabilities.Resources.ListResourcesHandler myServerOptions.Handlers.ListResourcesHandler
myServerOptions.Capabilities.Resources.ReadResourceHandler myServerOptions.Handlers.ReadResourceHandler
myServerOptions.Capabilities.Resources.SubscribeToResourcesHandler myServerOptions.Handlers.SubscribeToResourcesHandler
myServerOptions.Capabilities.Resources.UnsubscribeFromResourcesHandler myServerOptions.Handlers.UnsubscribeFromResourcesHandler
myServerOptions.Capabilities.Resources.ResourceCollection myServerOptions.ResourceCollection
myServerOptions.Capabilities.Tools.ListToolsHandler myServerOptions.Handlers.ListToolsHandler
myServerOptions.Capabilities.Tools.CallToolHandler myServerOptions.Handlers.CallToolHandler
myServerOptions.Capabilities.Tools.ToolCollection myServerOptions.ToolCollection

Action: Replace usages of the obsolete handlers and collections with the corresponding APIs on the options types.

Collections

Old

new McpServerOptions() 
{
    Capabilities = new() 
    {
        Tools = new() 
        { 
            ToolCollection = [McpServerTool.Create(...)] 
        }
    }
};

New

new McpServerOptions()
{
    ToolCollection = [McpServerTool.Create(...)]
};

Handlers

Old

new McpServerOptions()
{
    Capabilities = new()
    {
        Tools = new()
        {
            CallToolHandler = (request, ct) => { ... }
        }
    }
};

New

new McpServerOptions()
{
    Handlers = new()
    {
        CallToolHandler = (request, ct) => { ... }
    }
};

What's Changed

New Contributors

Read more

v0.3.0-preview.4

20 Aug 19:09
15f8e89

Choose a tag to compare

v0.3.0-preview.4 Pre-release
Pre-release

What's Changed

  • Respect HandleResponse() and SkipHandler() calls in OnResourceMetadataRequest by @halter73 in #607
  • UnreferenceDisposable made slimmer by @Scooletz in #627
  • IdleTracking uses lists instead of SortedSet by @Scooletz in #629
  • Fix ResourceLinkBlock deserialization by adding missing "name" case by @Copilot in #645
  • Add an in-memory transport sample by @stephentoub in #664
  • Remove 'Sse' from AspNetCoreSseServer sample name by @halter73 in #665
  • Fix NotSupportedException when returning IEnumerable by @Copilot in #675
  • Enhance HTTP and MCP session logging by @theojiang25 in #608
  • Remove special-casing of string enumerables in McpServerTool by @stephentoub in #699
  • Prune idle sessions before starting new ones by @halter73 in #701
  • Add framework for conceptual docs by @mikekistler in #708

New Contributors

Full Changelog: v0.3.0-preview.3...v0.3.0-preview.4

v0.3.0-preview.3

16 Jul 13:18
3156818

Choose a tag to compare

v0.3.0-preview.3 Pre-release
Pre-release

What's Changed

New Contributors

Full Changelog: v0.3.0-preview.2...v0.3.0-preview.3

v0.3.0-preview.2

03 Jul 21:49
a6fd6fc

Choose a tag to compare

v0.3.0-preview.2 Pre-release
Pre-release

What's Changed

New Contributors

Full Changelog: v0.3.0-preview.1...v0.3.0-preview.2

v0.3.0-preview.1

20 Jun 16:18
283a052

Choose a tag to compare

v0.3.0-preview.1 Pre-release
Pre-release

What's Changed

New Contributors

Full Changelog: v0.2.0-preview.3...v0.3.0-preview.1

v0.2.0-preview.3

03 Jun 20:42
046903c

Choose a tag to compare

v0.2.0-preview.3 Pre-release
Pre-release

What's Changed

Full Changelog: v0.2.0-preview.2...v0.2.0-preview.3

v0.2.0-preview.2

29 May 17:01
6351b3d

Choose a tag to compare

v0.2.0-preview.2 Pre-release
Pre-release

What's Changed

New Contributors

Full Changelog: 0.2.0-preview.1...v0.2.0-preview.2