modelcontextprotocol / modelcontextprotocol/python-sdk
Add option to skip output validation for mcp client
還沒有人認領這個 Issue。
- 主要語言
- Python
- 星號
- 24.3k
- 分支
- 4k
- 平均合併
- 1 天 1 小時
- 30 天內合併 PR
- 31
描述
Description
MCP Client session currently validates the output generated by MCP servers agains the reported json schema, and raises ValidationError.
This means that MCP server tools that have a not well maintained output schema, but are otherwise functional, are unusable.
The request is to add an option either at the ClientSession interface and/or the call_tool method so skip validation and return the result even if it does not conform to the output schemma
References
https://github.com/modelcontextprotocol/python-sdk/blob/main/src/mcp/client/session.py#L319-L349
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
研究方向
從 src/mcp/client/session.py 的第 319-349 行開始,追蹤 MCP 工具輸出與其回報的 JSON schema 進行檢查並引發 ValidationError 的位置。確定選擇退出驗證的選項應放在 ClientSession、call_tool,還是兩者都放。完成標準是呼叫方可以跳過輸出驗證,並接收輸出與 schema 不相符之工具的結果。
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- python
- 領域
- api
- Issue 類型
- 功能
- 難度
- 3/5
- 預估耗時
- 1-2 天
- 活躍度
- 冷清
- 描述清晰度
- 基本清楚
- 新手友好度
- 65/100