ruby-sdk/lib/mcp/server
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Koichi ITO 5ce308b082 Deliver subscriptions/listen notifications only after the acknowledgement
## Motivation and Context

Per SEP-2575, the server MUST NOT send any notification on a subscription before `notifications/subscriptions/acknowledged`.
The listen stream was registered in the delivery registry before its acknowledgement was written (the write happens outside
the lock so a stalled reader cannot block the transport), so a change notification published concurrently from another thread
could be written to the stream ahead of the acknowledgement.

The entry is now inserted inactive - still reserving the id and the cap slot atomically - and becomes eligible for delivery only
after the acknowledgement write has completed. A concurrent notification inside the window skips the inactive entry,
which is indistinguishable from the change happening just before the subscription opened.

## How Has This Been Tested?

With a new regression test pinning the window (an entry injected in the registered-but-unacknowledged state receives nothing until activation),
the full suite, RuboCop, and the conformance suite, all green.

## Breaking Changes

None. Activation happens synchronously inside the same response body proc, so an acknowledged stream behaves exactly as before.
2026-08-25 00:29:52 +09:00
..
transports Deliver subscriptions/listen notifications only after the acknowledgement 2026-08-25 00:29:52 +09:00
capabilities.rb Support Capability Extensions per SEP-2133 2026-06-14 17:20:45 +09:00
input_required_result.rb Let Handlers Return Multi Round-Trip input_required Results per SEP-2322 2026-08-08 15:07:16 +09:00
pagination.rb Support pagination per MCP specification 2026-04-18 18:23:30 +09:00
pending_response.rb Bound server-to-client requests with a timeout 2026-08-13 23:16:59 +09:00
request_state_security.rb Add opt-in requestState sealing via RequestStateSecurity 2026-08-08 18:54:14 +09:00
transports.rb Use autoload to defer loading of unused subsystems 2026-03-12 14:08:27 +09:00