Skip to content

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

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Moderate issues affecting some users, edge cases, potentially valuable featureenhancementRequest for a new feature that's not currently supportedv2Affects the v2 line (2.x on main)

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions