modelcontextprotocol / modelcontextprotocol/python-sdk
Implement consistent structuredContent handling per specification clarification
還沒有人認領這個 Issue。
- 主要語言
- Python
- 星號
- 24.3k
- 分支
- 4k
- 平均合併
- 1 天 1 小時
- 30 天內合併 PR
- 31
描述
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
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
研究方向
首先閱讀規格 issue modelcontextprotocol/specification#1411 以及連結的 TypeScript SDK issue;它們定義了此 Python SDK 必須符合的行為。接著找出 Python 用戶端和伺服器的回應處理,並為已釐清的 structuredContent 行為新增測試。完成的標準是實作指定的 fallback、驗證伺服器欄位的一致性,並與 TypeScript SDK 保持一致。
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- python, typescript
- 領域
- api, backend-api-design
- Issue 類型
- 功能
- 難度
- 5/5
- 預估耗時
- 一週以上
- 活躍度
- 停滯
- 描述清晰度
- 需要釐清
- 新手友好度
- 25/100