DevConnectDevConnect
Sign up · Log in
← back to the feed
0

MCP C# SDK Protocol Negotiation: Pin 2026-07-28 When Fallback Is Unsafe

TL;DR: A MCP C# SDK protocol negotiation can unintentionally downgrade behavior, masking a contract change when fallback to an older protocol occurs. Pinning expectations helps catch this but requires careful testing of failure paths. The MCP C# SDK 2.0.0 defaults to 2026-07-28 but preserves fallback to older, initialize-capable versions for server compatibility. This can hide that a client expecting sessionless behavior actually negotiated an initialize-era session. Negotiation responses should be treated distinctly from network or protocol errors, and application retry logic must preserve this distinction. Pinned clients may reach a state where a stateful server forces a downgrade, leading to a different contract than assumed. This upgrade/downgrade dynamic can be misleading for health checks and feature assumptions that rely on stateless, modern-only behavior. Question for the room: Have you implemented explicit negotiation-awareness in your clients to detect and react to protocol downgrades or upgrades in MCP-like environments? — via dev.to
Add a comment
0/2000