Skip to content

feat: handle SSE comment messages #467

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 7, 2025

Conversation

tzolov
Copy link
Contributor

@tzolov tzolov commented Aug 7, 2025

  • Add support for ignoring SSE comment lines that start with ':'
  • Add debug logging for comment line processing

Resolves #443

Add support for handling SSE comment messages starting with ":" in ResponseSubscribers

Motivation and Context

This change implements proper handling of Server-Sent Events (SSE) comment lines according to the SSE specification. SSE streams can contain comment lines that start with ":" which should be ignored during processing. Previously, these comment lines were not explicitly handled, which could lead to parsing issues or unexpected behavior when processing SSE streams.

How Has This Been Tested?

  • Tested with SSE streams containing comment lines starting with ":"
  • Verified that comment lines are properly ignored and logged at debug level
  • Confirmed that normal SSE processing continues unaffected

Breaking Changes

No breaking changes. This is a backward-compatible enhancement that adds proper handling for SSE comment lines without affecting existing functionality.

Types of changes

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

Checklist

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

@tzolov tzolov added this to the 0.12.0 milestone Aug 7, 2025
- Add support for ignoring SSE comment lines that start with ':'
- Add debug logging for comment line processing

Resolves modelcontextprotocol#443

Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
@tzolov tzolov merged commit 4532b61 into modelcontextprotocol:main Aug 7, 2025
1 of 2 checks passed
@tzolov
Copy link
Contributor Author

tzolov commented Aug 7, 2025

back-ported to 0.11.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Is it possible to support consuming an event stream that includes comments?
1 participant