modelcontextprotocol / modelcontextprotocol/python-sdk
Implement consistent structuredContent handling per specification clarification
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 24.3k
- Forks
- 4k
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 31
Description
Summary
Following the specification issue modelcontextprotocol/specification#1411, the Python 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 Python SDK needs to be reviewed to ensure it properly handles the relationship between structuredContent and content fields.
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
- Ensure consistency with the TypeScript SDK implementation
References
- Specification issue: modelcontextprotocol/specification#1411
- TypeScript SDK issue: modelcontextprotocol/typescript-sdk#911
- 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.
Research direction
Read specification issue modelcontextprotocol/specification#1411 and the linked TypeScript SDK issue first; they define the behavior this Python SDK must match. Then locate the Python client and server response handling and add tests for the clarified structuredContent behavior. Done means implementing the specified fallback, validating consistent server fields, and matching the TypeScript SDK.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, typescript
- Domain
- api, backend-api-design
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100