modelcontextprotocol / modelcontextprotocol/python-sdk

No default timeout for requests (unlike TS SDK)

未關閉
#1,374 4 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

enhancement improves sdk consistency needs decision P2
主要語言
Python
星號
24.3k
分支
4k
平均合併
1 天 1 小時
30 天內合併 PR
31

描述

Initial Checks
Description

Spec states: Implementations SHOULD establish timeouts for all sent requests, to prevent hung connections and resource exhaustion.

The TypeScript SDK does have a default timeout of 60 seconds on requests, and the difference between Python & TypeScript is the crux of https://github.com/modelcontextprotocol/typescript-sdk/issues/245 (which also suggests 60 seconds might not be long enough). Also related, TypeScript has a resetTimeoutOnProgress option (defaulting to falst), which would probably be useful if we do introduce a default to the Python SDK.

Example Code

Python & MCP Python SDK
Latest

貢獻指南

開啟貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

研究方向

Issue 中沒有指定檔案或測試,因此請先找出 Python SDK 中傳送 request 與處理進度的路徑。將其行為與 TypeScript SDK 的 60 秒預設值,以及關於 resetTimeoutOnProgress 的討論進行比較。完成的標準是:針對已傳送的 request,實作並驗證已達成共識的預設 timeout 行為。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
python
領域
api
Issue 類型
功能
難度
4/5
預估耗時
3-5 天
活躍度
停滯
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。