Official Model Context Protocol C# SDK v2.0 Releases with Stateless HTTP Transport
The Model Context Protocol C# SDK reached v2.0, bringing full compliance with the 2026-07-28 spec revision. The HTTP transport is now stateless by default, eliminating session handshakes and sticky routing requirements for horizontal deployments.
Impact: High
Why it matters
You can now build and deploy scale-out MCP servers on ASP.NET Core and Docker without needing session migration or sticky load balancing.
TL;DR
- 01Upgrading to MCP C# SDK v2.0 enables fully stateless HTTP operation on ASP.NET Core.
- 02Sticky sessions and session migration are no longer required for load balancing.
- 03Use [McpHeader] to let API gateways route agent traffic without deep body inspection.
Key facts
- Spec Version
- 2026-07-28 revision
- Default Transport Mode
- Stateless HTTP
- Backward Compatibility
- Full compatibility with v1 endpoints
Stateless HTTP Workloads by Default
In version 2.0, HttpServerTransportOptions.Stateless defaults to true. Legacy session-based Server-Sent Events endpoints and sticky transport requirements are marked obsolete. Servers compile directly as native ASP.NET Core applications:
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddMcpServer().WithHttpTransport();Parameter-Based Header Routing
Intermediaries can route traffic without inspecting JSON-RPC payloads. By tagging tool arguments with [McpHeader], client libraries hoist parameters into Mcp-Param-* or custom HTTP headers:
[McpServerTool(Name = "get_order_status")]
public static async Task<string> GetOrderStatus(
[McpHeader("Region")] string region,
string orderId) => await orders.GetStatusAsync(region, orderId);If the HTTP header and the underlying JSON-RPC body values mismatch, the SDK safely rejects the request with a HeaderMismatch error.
Try it in 2 minutes
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddMcpServer().WithHttpTransport();
[McpServerTool(Name = "get_order_status")]
public static async Task<string> GetOrderStatus(
[McpHeader("Region")] string region,
string orderId) => await orders.GetStatusAsync(region, orderId);csharp
✓ When to use
- Use when building horizontally scalable MCP server tools hosted on cloud container platforms or serverless infrastructure.
✕ When NOT to use
- Do not force stateless mode if your agent architecture strictly requires unsolicited server-to-client push events over long-lived SSE.
What to do today
- Update project dependencies to Microsoft.ModelContextProtocol.SDK 2.0.
- Remove custom session state persistence layers from your MCP HTTP transport setups.
- Annotate routing-critical parameters with [McpHeader] for gateway load balancing.
Sources