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 中发送请求和处理进度的路径。将其行为与 TypeScript SDK 的 60 秒默认值以及关于 resetTimeoutOnProgress 的讨论进行比较。完成的标准是:针对已发送的请求,实现并验证达成共识的默认超时行为。

由索引模型根据 Issue 内容生成。

评估

技术栈
python
领域
api
Issue 类型
功能
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。