-
Notifications
You must be signed in to change notification settings - Fork 5
feat: add conformance tests for SEP-1699 SSE polling #47
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
+1,938
−337
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Adds conformance tests for SEP-1699 (SSE Polling via Server-Side Disconnect) which allows servers to close connections while maintaining SSE streams for long-polling behavior. New scenarios: - server-sse-polling: Tests server sends priming event (id + empty data) and retry field before closing connection (SHOULD requirements) - sse-retry: Tests client respects SSE retry field timing when reconnecting (MUST requirement) These tests will initially fail for TypeScript SDK as it doesn't currently respect the retry field from SSE events.
The test was incorrectly measuring timing between all requests (POST and GET), but the retry field only applies to GET SSE stream reconnections. Changes: - Only track timestamps and Last-Event-ID for GET requests - Return 202 Accepted for notifications to trigger client GET stream - Add eventsource-parser dependency
Enhance timing validation and event ordering checks: Client test (sse-retry): - Add "very late" threshold (>2x retry value) as FAILURE - Distinguish between slightly late (WARNING) and very late (FAILURE) Server test (sse-polling): - Check that priming event is sent immediately (first event) - Warn if server disconnects without sending event ID first
The eventsource-parser library delivers retry through onRetry callback, not as a property on EventSourceMessage objects.
Server may return 400 when GET request is missing session context (mcp-session-id header). Treat as INFO similar to 405.
- Rewrite server tests to validate priming events on POST SSE streams - Update client tests for POST→GET reconnection flow with retry timing - Add eventStore and retryInterval to example server - All 3 server conformance checks now pass
New scenario tests that servers properly support multiple concurrent GET SSE streams per SEP-1699 spec requirement.
The multiple-streams test was incorrectly testing standalone GET streams, which are limited to one per session by SDK design. The spec's "multiple concurrent streams" refers to POST-initiated SSE streams, where each POST request gets its own unique streamId. Changes: - Rewrite server-sse-multiple-streams to use concurrent POST requests - Each POST request may return SSE or JSON (both valid per spec) - Update test expectations to allow INFO status for JSON responses - Add documentation clarifying standalone GET vs POST stream behavior
commit: |
This was referenced Nov 23, 2025
4303ddf to
e6898e7
Compare
🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
pcarleton
approved these changes
Nov 24, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds conformance tests for SEP-1699 which introduces SSE polling via server-side disconnect.
Summary
sse-retry): validates retry field timing (MUST), Last-Event-ID on reconnection (SHOULD)server-sse-polling): validates priming event with id and empty data, retry fieldserver-sse-multiple-streams): validates multiple concurrent POST SSE streamsChanges since previous PR
server-sse-multiple-streamsto test POST-initiated concurrent streams (not standalone GET)How Has This Been Tested?
Tested with modelcontextprotocol/typescript-sdk#1129
Checklist