Skip to content

Support MCP client session resumption (sessionId reuse) in Python SDK #2116

@sr07asthana

Description

@sr07asthana

Description

Summary

The Python MCP SDK currently appears to create a new session whenever a client is instantiated. It would be valuable to support resuming an existing MCP session using a previously issued sessionId, similar to functionality discussed and addressed in the C# SDK (see modelcontextprotocol/csharp-sdk#946).

This would enable persistent and stateful workflows in agent-based systems.

Problem

At present, there does not appear to be a documented way in the Python SDK to:

  • Reuse an existing sessionId
  • Resume a previously established MCP session
  • Control session lifecycle independently of the client object's lifetime

Why This Is Important

  • In agent-driven architectures , session continuity allows:
  • More efficient orchestration
  • Reduced overhead from repeated session initialization

As MCP adoption grows across SDKs (C#, TypeScript, Python), having consistent session lifecycle capabilities improves cross-language parity and developer experience.

References

modelcontextprotocol/csharp-sdk#946

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions