MCP SDK for .NET 1

Last reviewed Sep 20, 2026

Export as PDF

Prompt Details

Prompt Composition

2prompts
  1. C# 14106 lines · 4.4K tokens
  2. MCP SDK for .NET 192 lines · 4.9K tokens
Total198 lines · 9.2K tokens

CWE Coverage

  • 20
  • 22
  • 59
  • 78
  • 89
  • 94
  • 117
  • 190
  • 201
  • 208
  • 209
  • 214
  • 257
  • 295
  • 319
  • 323
  • 327
  • 338
  • 346
  • 347
  • 352
  • 362
  • 367
  • 378
  • 426
  • 441
  • 488
  • 502
  • 532
  • 611
  • 639
  • 674
  • 759
  • 770
  • 772
  • 775
  • 798
  • 807
  • 862
  • 915
  • 916
  • 918
  • 942
  • 1333
  • 1395
  • 1427

Prompt Preview

Apply the C# 14 prompt first. These rules cover the MCP C# SDK 1 line: hosting, identity, sessions, tools, resources, experimental tasks, sampling, elicitation, and clients.

Version scope and capabilities

  • Keep the ModelContextProtocol, ModelContextProtocol.Core, and ModelContextProtocol.AspNetCore packages you use on the same release and move them together; do not mix 1.x and 2.x packages. The SDK fixes ordinary bugs only in the newest minor of its latest major and patches the newest minor of one previous major only for bugs its maintainers rate critical or blocking, so while you stay on 1.x, run the newest patch of its newest minor and plan the move to the current major.
  • Use a patched .NET 10 host with the C# 14 baseline. The packages also target net8.0 and net9.0, whose runtime support ends on 2026-11-10; only Core and the hosting package additionally target netstandard2.0, without the other targets' AOT-compatibility declaration. ModelContextProtocol.AspNetCore requires .NET 8 or later.
  • Check NegotiatedProtocolVersion and peer capabilities before using optional features. Version 1.4.1 implements 2024-11-05, 2025-03-26, 2025-06-18, and 2025-11-25; do not assume 2.x continuation-state behavior or compatibility with the replacement Tasks extension.
  • Suppress MCPEXP001 for Tasks and Extensions, or MCPEXP002 for SDK extensibility such as RunSessionHandler, only at reviewed call sites. These APIs can change even in patch releases; test their authorization, serialization, and cancellation behavior on upgrades.

HTTP hosting and