Skip to content

[Server] Dispatch protocol events for 2026-07-28 requests - #528

Merged
chr-hertel merged 2 commits into
modelcontextprotocol:mainfrom
chr-hertel:fix-stateless-protocol-events
Oct 6, 2026
Merged

chr-hertel merged 2 commits into
modelcontextprotocol:mainfrom
chr-hertel:fix-stateless-protocol-events

Conversation

@chr-hertel

Copy link
Copy Markdown
Member

Closes #527

StatelessProtocol now gets the builder's event dispatcher and dispatches RequestEvent, ResponseEvent and ErrorEvent the same way Protocol does - setRequest(), setResponse() and setError() are honoured, also on the streamed path.

@chr-hertel chr-hertel added the Server Issues & PRs related to the Server component label Oct 5, 2026
@chr-hertel
chr-hertel force-pushed the fix-stateless-protocol-events branch from 41679d7 to 1542548 Compare October 5, 2026 23:04
@chr-hertel chr-hertel added the bug Something isn't working label Oct 5, 2026
soyuka
soyuka previously approved these changes Oct 6, 2026

@mglaman mglaman left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Docs gap: events.md should cover two modern-era differences:

  • ResponseEvent fires on each InputRequiredResult round, not just the final result. Listeners that audit completed calls need to check the result type.
  • getSession() is a new in-memory session for each request. State a listener stores there is gone by the next request.

@chr-hertel
chr-hertel force-pushed the fix-stateless-protocol-events branch from cea6aa1 to 432a1a4 Compare October 6, 2026 21:28
@chr-hertel
chr-hertel merged commit 5aaea06 into modelcontextprotocol:main Oct 6, 2026
27 checks passed
@chr-hertel
chr-hertel deleted the fix-stateless-protocol-events branch October 6, 2026 21:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working Server Issues & PRs related to the Server component

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Server] Protocol events are not dispatched for 2026-07-28 requests

3 participants