Implement consistent structuredContent handling per specification clarification
Opened this issue · 0 comments
dsp-ant commented
Summary
Following the specification issue modelcontextprotocol/modelcontextprotocol#1411, the TypeScript SDK needs to ensure consistent handling of structuredContent vs content fields in tool responses.
Problem
Currently there's inconsistency across MCP implementations:
- Some clients use
structuredContentwhen available (e.g., Cursor) - Others ignore it entirely
- This leads to different behavior with the same servers
Current SDK Behavior
The TypeScript SDK has validation implemented:
typescript-sdk/src/client/index.ts
Lines 442 to 475 in 3dd074f
However, the handling needs to align with the specification clarification.
Required Changes
Once modelcontextprotocol/modelcontextprotocol#1411 is resolved, update the SDK to:
- Implement the specified client behavior for
structuredContent - Ensure proper fallback to
contentwhen needed - Validate that servers populate both fields consistently
- Add tests to verify the correct behavior
References
- Specification issue: modelcontextprotocol/modelcontextprotocol#1411
- Discord discussion: https://discord.com/channels/1358869848138059966/1411057080902746293
cc: @dsp-ant