modelcontextprotocol / modelcontextprotocol/typescript-sdk
Implement consistent structuredContent handling per specification clarification
@dsp-ant is already working on this.
Since Sep 1, 2025.
- Dominant language
- TypeScript
- Stars
- 13.4k
- Forks
- 2.2k
- Avg merge
- 3d 15h
- Merged PRs (30d)
- 4
Description
Summary
Following the specification issue modelcontextprotocol/specification#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: https://github.com/modelcontextprotocol/typescript-sdk/blob/3dd074f8a25b92994e0e8cc69d3ffe9112a1f32b/src/client/index.ts#L442-L475
However, the handling needs to align with the specification clarification.
Required Changes
Once modelcontextprotocol/specification#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/specification#1411
- Discord discussion: https://discord.com/channels/1358869848138059966/1411057080902746293
cc: @dsp-ant
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.