MCP C# SDK v2.0+ Drops Object Wrapper for Array Tool Outputs in 2026-07-28 Protocol
The MCP C# SDK changed how array and scalar tool outputs are structured when both client and server negotiate the 2026-07-28 protocol version. Under the older 2025-11-25 protocol, array results had to be wrapped in an object envelope with a 'result' key inside 'structuredContent', but the newer protocol allows the value itself to be returned directly. The stable SDK (v2.0.0 and later) handles backward compatibility automatically, emitting the legacy envelope for older clients without requiring a separate handler. Developers can verify the correct wire shape by running offline contract tests using two separate client-server sessions, one per protocol version, connected via in-process pipes. Relying solely on unit tests against C# return types is insufficient, as they cannot detect whether an unintended wrapper has been reintroduced at the transport boundary.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in