NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
NuGet
NuGet, #936 most downloaded on NuGet
.NET SDK for the Model Context Protocol (MCP) with hosting and dependency injection extensions.
Latest stable
2.4.0
Last release 17 days ago
07 Nov 2026
Ships fairly regularly
a new release about every 3 weeks
Nearly every release is documented
notes for 13 of 13 stable releases
Nothing withdrawn
no release was ever pulled
9 months old
13 releases · first in 2026
Drag across the ruler to compare, or tap a release to open it.
Version 2.4.0 adds experimental MCP Skills support through the new ModelContextProtocol.Extensions.Skills package, alongside OAuth hardening and relia
Version 2.4.0 adds experimental MCP Skills support through the new ModelContextProtocol.Extensions.Skills package, alongside OAuth hardening and reliability improvements for transport, session, and discovery flows. MCP Apps also now match protocol property names case-sensitively.
Full Changelog: https://github.com/modelcontextprotocol/csharp-sdk/compare/v2.3.1...v2.4.0
Your coding agent can read these notes before it upgrades. Set up the MCP server →
One column per month.
This patch release includes a security fix for authenticated stateful sessions.
This patch release includes a security fix for authenticated stateful sessions.
bfbd893) by @halter73 (co-authored by @Copilot @jeffhandley @tarekgh)Full Changelog: https://github.com/modelcontextprotocol/csharp-sdk/compare/v2.3.0...v2.3.1
[!NOTE] These release notes were drafted with GitHub Copilot.
Update SourceLink's private build dependency to resolve a vulnerable Git dependency #1873 by @halter73 (co-authored by @Copilot)
This release improves HTTP discovery, OAuth, protocol interoperability, and shutdown reliability, preserves registration order for server primitives, and exposes a TimeProvider for deterministic client timeout tests. It also corrects optional server-identity handling; applications reading McpClient.ServerInfo should adopt nullable handling.
Refer to the C# SDK Versioning documentation for details on versioning and breaking change policies.
McpClient.ServerInfo is nullable — #1903
Implementation to Implementation?. Existing non-nullable assignments or dereferences can produce nullable warnings and fail warnings-as-errors builds.2026-07-28 connections, ServerInfo is null when the server omits optional identity metadata from server/discover. Legacy initialize still requires serverInfo. Reading the property before connecting still throws InvalidOperationException.client.ServerInfo?.Name ?? "Unknown server". Self-reported identity must not be used for security decisions.ServerInfo nullable #1903 by @Coding-ProfessionalDiscoverProbeTimeout, expose McpClientOptions.TimeProvider for deterministic timeout tests, and default SSE to legacy initialization #1719 by @halter73 (co-authored by @Copilot)
InitializationTimeout and caller cancellation; it is excluded only from the short discovery-probe budget.HttpTransportMode.Sse and ProtocolVersion = "2026-07-28"; pinning the version with AutoDetect is not equivalent.RequestOptions serialization #1832 by @dfedoryshchevMcpServerFactory references in Copilot instructions #1892 by @Zir0-93Full Changelog: https://github.com/modelcontextprotocol/csharp-sdk/compare/v2.2.0...v2.3.0
[!NOTE] These release notes were drafted with GitHub Copilot and reviewed before publishing.
This release adds hybrid stateful/stateless HTTP serving so clients using the 2025-11-25 and 2026-07-28 protocol revisions can share an endpoint, and
This release adds hybrid stateful/stateless HTTP serving so clients using the 2025-11-25 and 2026-07-28 protocol revisions can share an endpoint, and fixes a malformed header-decoding edge case.
Full Changelog: https://github.com/modelcontextprotocol/csharp-sdk/compare/v2.1.0...v2.2.0
[!NOTE] These release notes were drafted with GitHub Copilot and reviewed before publishing.
This release adds an opt-in subscriptions/listen handler for custom server-side notification streams, improves HTTP transport fallback reliability, an
This release adds an opt-in subscriptions/listen handler for custom server-side notification streams, improves HTTP transport fallback reliability, and expands guidance and samples for telemetry and binary resources.
> [!NOTE] alert example #1771 by @PranavSenthilnathan (co-authored by @Copilot)Full Changelog: https://github.com/modelcontextprotocol/csharp-sdk/compare/v2.0.0...v2.1.0
Deprecate Roots, Sampling, and Logging APIs #1651
Version 2.0.0 brings the C# SDK into stable alignment with the MCP 2026-07-28 specification.
This major release introduces discovery-first negotiation, multi-round-trip requests, stateless-by-default HTTP, caching hints, standardized headers, stronger OAuth and token-cache safety, and dedicated MCP Apps and Tasks extension packages, with down-level interoperability for peers negotiating 2025-11-25 and earlier. Review the migration guidance below.
Refer to the C# SDK Versioning documentation for details on versioning and breaking-change policies.
HttpServerTransportOptions.Stateless now defaults to true. Stateless servers do not create transport sessions, expose the standalone SSE GET/DELETE endpoints, or support unsolicited server-to-client requests.Stateless = false when an existing server requires legacy stateful behavior. Stateful-only options now produce MCP9006 warnings and apply only to down-level initialize-handshake connections.server/discover first and automatically fall back to the legacy initialize handshake for down-level servers.MCP9005 warnings because these features are deprecated by the 2026-07-28 specification.MCP9005 temporarily if continued use is required while planning migration.ModelContextProtocol.Extensions.Tasks #1693
ModelContextProtocol.Extensions.Tasks, import its namespace, register Tasks with WithTasks(...), and replace Core RequestMethods.Tasks* constants with TasksProtocol members.AuthorizationRedirectDelegate and ClientOAuthOptions.AuthorizationRedirectDelegate now produce MCP9007 warnings. Migrate to ClientOAuthOptions.AuthorizationCallbackHandler so callbacks can return the authorization code, state, and issuer.UseStructuredContent = true and a non-object return type now emit the raw value and matching schema, such as structuredContent: 72, instead of wrapping it as { "result": 72 }.result property.Tool.inputSchema during deserialization #1600
Tool payload without inputSchema now throws JsonException instead of silently defaulting the schema.inputSchema; an empty {} is sufficient.S256 in code_challenge_methods_supported.application_type during dynamic client registration #1613
application_type.DynamicClientRegistrationOptions.ApplicationType explicitly when the inferred value is not appropriate.HttpRequestException, TimeoutException, or genuine I/O exception instead of always wrapping failures in IOException.IOException("Failed to connect transport.") wrapper. In AutoDetect mode, inspect the outer HttpRequestException and its inner SSE failure.insufficient_scope challenge that introduces no new scopes now throws McpException instead of retrying indefinitely.InheritEnvironmentVariables to StdioClientTransportOptions #1563 by @halter73offline_access to authorization scope when advertised (SEP-2207) #1479 by @stephentoub (co-authored by @Copilot)McpErrorCode.ResourceNotFound per SEP-2164 #1558 by @jayaraman-venkatesanMcpClient tool cache #1590 by @tarekghScopeSelectorDelegate to OAuth options #1596 by @hallloMinVersionForStandardHeaders to DraftProtocolVersion #1603 by @halter73x-mcp-header behavior with SEP-2243 clarifications #1619 by @tarekgh$ref pointer resolution after output-schema wrapping #1435 by @weinongMcpClientOptions.InitializeMeta #1599 by @adityasingh2400charset=utf-8 from HTTP application/json content types #1528 by @jayaraman-venkatesaninputSchema during deserialization #1600 by @DragonFSKYTimeToLive instead of TtlMs in public APIs #1644 by @PranavSenthilnathan (co-authored by @halter73 @Copilot)DeferChangedEvents() for batched primitive-change notifications #1689 by @jeffhandley (co-authored by @Copilot)complete result discriminator #1684 by @PranavSenthilnathan (co-authored by @Copilot @tarekgh)ModelContextProtocol.Extensions.Tasks #1693 by @jeffhandley (co-authored by @Copilot @tarekgh)application_type to dynamic client registration #1613 by @jayaraman-venkatesanClientOAuthProvider #1605 by @mikekistlerClientOAuthProvider client ID availability on cold start #1705 by @halter73 (co-authored by @Copilot)AddIncomingMessageFilter_Multiple_Filters_Execute_In_Order test #1627 by @tarekghReadEventsAsync_InStreamingMode_YieldsNewlyWrittenEvents #1491 by @ericstj (co-authored by @Copilot)DiagnosticTests.Session_TracksActivities #1495 by @ericstj (co-authored by @Copilot)http-custom-headers conformance scenario #1691 by @tarekgh_meta.ui serialization round-trip tests #1698 by @yayayouyou (co-authored by @jeffhandley)Tool.Execution reference from the main build #1660 by @halter73Tool.InputSchema silently masked malformed payloads (#1575), leading to the required-field fix in #1600._meta on initialize requests (#1593), leading to McpClientOptions.InitializeMeta in #1599.Full Changelog: https://github.com/modelcontextprotocol/csharp-sdk/compare/v1.4.1...v2.0.0
This patch release includes security fixes for OAuth authentication and authenticated HTTP sessions.
This patch release includes security fixes for OAuth authentication and authenticated HTTP sessions.
Deployments using metadata-free 2025-03-26 OAuth discovery may explicitly enable the legacy endpoint fallback only after independently verifying PKCE enforcement; otherwise, update metadata to advertise S256. The process-wide opt-in is ModelContextProtocol.Authentication.AllowLegacyOAuthMetadataFallback; it does not bypass validation of discovered metadata.
Full Changelog: https://github.com/modelcontextprotocol/csharp-sdk/compare/v1.4.1...v1.4.2
[!NOTE] These release notes were drafted with GitHub Copilot.
This release backports a memory-leak fix for HTTP/SSE-based MCP servers. StreamableHttpServerTransport now releases its Server-Sent Events response st
This release backports a memory-leak fix for HTTP/SSE-based MCP servers. StreamableHttpServerTransport now releases its Server-Sent Events response stream reference as soon as a GET request ends, instead of holding it until the session is disposed via explicit DELETE or idle timeout. Long-lived SSE clients that disconnect without sending DELETE no longer pin the underlying Kestrel connection and its associated memory-pool buffers (~20 MiB per session), preventing the sustained memory growth that could accumulate under connect/disconnect churn.
Full Changelog: https://github.com/modelcontextprotocol/csharp-sdk/compare/v1.4.0...v1.4.1
v1.4.0 introduces support for the Identity Assertion Authorization Grant (ID-JAG) flow via the new IdentityAssertionGrantProvider, enabling enterprise
v1.4.0 introduces support for the Identity Assertion Authorization Grant (ID-JAG) flow via the new IdentityAssertionGrantProvider, enabling enterprise SSO scenarios where users authenticate once via their enterprise Identity Provider and access MCP servers without per-server authorization prompts. The release also adds a new InheritEnvironmentVariables option on StdioClientTransportOptions for controlling the child server's environment, alongside two security hardening fixes: the stdio client transport no longer enumerates child-process environment variables in Trace logs, and DELETE on a Streamable HTTP session now requires the same authenticated user that initiated the session.
InheritEnvironmentVariables to StdioClientTransportOptions #1563 by @halter73 (co-authored by @Copilot)HandleDeleteRequestAsync now mirrors the HasSameUserId check already enforced on GET and POST. A DELETE with a valid Mcp-Session-Id but a different authenticated user now returns 403 Forbidden instead of terminating the session — defense-in-depth against a leaked session ID being used to DoS the original owner.IdentityAssertionGrantProvider and supporting option/response types in ModelContextProtocol.Authentication implementing the Identity Assertion Authorization Grant flow: RFC 8693 token exchange at the enterprise IdP (ID Token → JWT Authorization Grant) followed by RFC 7523 JWT bearer grant at the MCP authorization server (JAG → access token). See the new Cross-Application Access section in the transport docs for full usage details.Full Changelog: https://github.com/modelcontextprotocol/csharp-sdk/compare/v1.3.0...v1.4.0
v1.3.0 focuses on improved transport diagnostics and security-focused documentation. The new public ClientTransportClosedException gives stdio and HTT
v1.3.0 focuses on improved transport diagnostics and security-focused documentation. The new public ClientTransportClosedException gives stdio and HTTP clients structured access to transport closure details (exit codes, process IDs, stderr tails, HTTP status codes) without parsing exception messages. Two reliability fixes harden the stdio process pipeline (preventing host crashes from user StandardErrorLines callbacks) and correct the stateless HTTP transport's capability advertisement. New conceptual documentation covers role/identity propagation in tool execution, allowed-hosts and CORS guidance for HTTP servers, and aligns the docs information architecture with the MCP specification structure.
ClientTransportClosedException public and unify transport exception handling #1467 by @stephentoub (co-authored by @halter73 @Copilot)
McpClient.CreateAsync(...) now surface as IOException (the new ClientTransportClosedException derives from IOException) rather than InvalidOperationException. Caller-triggered OperationCanceledException is also no longer wrapped, matching standard async cancellation semantics.Full Changelog: https://github.com/modelcontextprotocol/csharp-sdk/compare/v1.2.0...v1.3.0
Refer to the C# SDK Versioning documentation for details on versioning and breaking change policies.
This release improves stateless HTTP transport defaults and documentation with a breaking behavioral change that we are considering as a server reliability fix and therefore not bumping the major version with this release. Legacy SSE endpoints are now disabled by default with a new HttpServerTransportOptions.EnableLegacySse property available to opt back into responding to the SSE endpoints; the property is marked as an [Obsolete] warning as we expect to remove this property in a future major version.
A warning-level [Obsolete] attribute is also applied to the RequestContext(McpServer, JsonRpcRequest) constructor, and the RequestContext(McpServer, JsonRpcRequest, TParams) overload should be used instead. This change contributes to fixes including DI scope lifetime in task-augmented tools, meta/progress combination failures, and outgoing message filter routing. We plan to remove the obsolete overload in a future major version.
Refer to the C# SDK Versioning documentation for details on versioning and breaking change policies.
MapMcp() no longer maps /sse and /message endpoints by default. Servers whose clients connect via SSE will find those endpoints removed.
If your clients connect to a /sse endpoint (e.g., https://my-server.example.com/sse), they were using the legacy SSE transport--if not running in Stateless mode. The /sse and /message endpoints are now disabled by default (EnableLegacySse is false and marked [Obsolete] with diagnostic MCP9004). Upgrading the server SDK without updating clients will break SSE connections.
Client-side migration. Change the client Endpoint from the /sse path to the root MCP endpoint — the same URL your server passes to MapMcp(). For example:
// Before (legacy SSE):
Endpoint = new Uri("https://my-server.example.com/sse")
// After (Streamable HTTP):
Endpoint = new Uri("https://my-server.example.com/")
With the default HttpTransportMode.AutoDetect transport mode, the client automatically tries Streamable HTTP first. You can also set TransportMode = HttpTransportMode.StreamableHttp explicitly if you know the server supports it.
Server-side migration. If you previously relied on /sse being mapped automatically, you now need EnableLegacySse = true (suppressing the MCP9004 warning) to keep serving those endpoints. The recommended path is to migrate all clients to Streamable HTTP and then remove EnableLegacySse.
Transition period. If some clients still need SSE while others have already migrated to Streamable HTTP, set EnableLegacySse = true with Stateless = false. Both transports are served simultaneously by MapMcp() — Streamable HTTP on the root endpoint and SSE on /sse and /message. Once all clients have migrated, remove EnableLegacySse and optionally switch to Stateless = true.
Legacy SSE endpoints are now disabled by default and must be explicitly enabled via HttpServerTransportOptions.EnableLegacySse. This is the primary reason they are disabled — the SSE transport has no built-in HTTP-level backpressure.
The legacy SSE transport separates the request and response channels: clients POST JSON-RPC messages to /message and receive responses through a long-lived GET SSE stream on /sse. The POST endpoint returns 202 Accepted immediately after queuing the message — it does not wait for the handler to complete. This means there is no HTTP-level backpressure on handler concurrency, because each POST frees its connection immediately regardless of how long the handler runs.
Internally, handlers are dispatched with a fire-and-forget pattern. A client can send unlimited POST requests to /message while keeping the GET stream open, and each one spawns a concurrent handler with no built-in limit.
The GET stream does provide session lifetime bounds: handler cancellation tokens are linked to the GET request's HttpContext.RequestAborted, so when the client disconnects the SSE stream, all in-flight handlers are cancelled. This is similar to SignalR's connection-bound lifetime model — but unlike SignalR, there is no per-client concurrency limit like MaximumParallelInvocationsPerClient. The GET stream provides cleanup on disconnect, not rate-limiting during the connection.
The RequestContext(McpServer, JsonRpcRequest) constructor is now [Obsolete] with diagnostic MCP9003, producing build warnings. The Params property is also changed from TParams? to TParams.
Migration: Use the new 3-arg constructor: new RequestContext(server, request, parameters).
Full Changelog: https://github.com/modelcontextprotocol/csharp-sdk/compare/v1.1.0...v1.2.0
Highlights of v1.1.0 include client completion details for understanding when and why a client connection ended, auto-populated completion handlers fr
Highlights of v1.1.0 include client completion details for understanding when and why a client connection ended, auto-populated completion handlers from AllowedValuesAttribute, and bug fixes for server-initiated ping handling, server capabilities initialization, and in-flight message handler cleanup.
EnablePackageValidation for all src packages with 1.0.0 baseline #1330 by @jeffhandley (co-authored by @Copilot @stephentoub)Full Changelog: https://github.com/modelcontextprotocol/csharp-sdk/compare/v1.0.0...v1.1.0
Refer to the C# SDK Versioning documentation for details on versioning and breaking change policies.
This is the first stable release of the ModelContextProtocol C# SDK. Thank you to all of the contributors who helped us achieve this milestone!
Refer to the C# SDK Versioning documentation for details on versioning and breaking change policies.
HttpServerTransportOptions.RunSessionHandler is now annotated with [Experimental("MCPEXP002")]RunSessionHandler will produce a compile-time warning (or error with TreatWarningsAsErrors); suppress with #pragma warning disable MCPEXP002ConfigureSessionOptions as an alternative; RunSessionHandler may be removed or change signatures in a future releaseRunSessionHandler experimental (MCPEXP002) #1383 by @halter73 (co-authored by @Copilot @jeffhandley)Full Changelog: https://github.com/modelcontextprotocol/csharp-sdk/compare/v1.0.0-rc.1...v1.0.0