Skip to content

No default timeout for requests (unlike TS SDK) #1374

@ochafik

Description

@ochafik

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 modelcontextprotocol/typescript-sdk#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

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Moderate issues affecting some users, edge cases, potentially valuable featurefeature requestRequest for a new feature that's not currently supportedimproves sdk consistencyImproves consistency with other SDKs such as Tyepscriptready for workEnough information for someone to start working on

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions