Skip to content

Conversation

@lvluoyue
Copy link
Contributor

@lvluoyue lvluoyue commented Nov 21, 2025

Decouple the Protocol class from direct dependency on TransportInterface to support server instance reuse across multiple transport mechanisms.

Motivation and Context

Currently, the Protocol class can only be connected to a single transport instance due to internal state management and restrictions. Once connected, it cannot be reused with another transport. This change removes that limitation to allow a single Protocol instance to be used with multiple transports.The same issue exists in the TypeScript SDK: modelcontextprotocol/typescript-sdk#961

Types of changes

  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • My code follows the repository's style guidelines
  • I have read the MCP Documentation
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

@lvluoyue lvluoyue closed this Nov 23, 2025
@lvluoyue lvluoyue reopened this Nov 24, 2025
@lvluoyue lvluoyue changed the title Decouple Server from TransportInterface for reusability [Server] Decouple Protocol from TransportInterface for reusability Nov 25, 2025
@chr-hertel
Copy link
Member

Makes sense to me - @CodeWithKyrian agree? see related symfony/ai#999 for motivation

@CodeWithKyrian
Copy link
Contributor

Makes perfect sense to me as well 👍🏼👍🏼.

@chr-hertel chr-hertel merged commit 280e8b6 into modelcontextprotocol:main Nov 30, 2025
20 checks passed
Copy link
Contributor

@Nyholm Nyholm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lovely. I agree to make the Protocol stateless

@chr-hertel chr-hertel added the BC Break Breaking the Backwards Compatibility Promise label Nov 30, 2025
@chr-hertel
Copy link
Member

missed to put BC Break here - we removed the getTransport() here - Tobias catched it tho 🙏

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

Labels

BC Break Breaking the Backwards Compatibility Promise

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants