Skip to content

Add resource subscribe/unsubscribe support to McpAsyncServer#838

Open
tzolov wants to merge 3 commits intomainfrom
resource-subscription-support
Open

Add resource subscribe/unsubscribe support to McpAsyncServer#838
tzolov wants to merge 3 commits intomainfrom
resource-subscription-support

Conversation

@tzolov
Copy link
Contributor

@tzolov tzolov commented Feb 26, 2026

  • Register resources/subscribe and resources/unsubscribe handlers when the subscribe server capability is enabled
  • Track active subscriptions in a ConcurrentHashMap keyed by resource URI
  • Emit notifications/resources/updated when addResource() is called for a subscribed URI; also send listChanged notification if enabled
  • Add ResourceSubscriptionTests covering the capability guard, subscribe/ unsubscribe happy paths, and the updated notification flow

Note: as with some other notifications this impl. is not bound to user sessions

Resolves: #837, #776

- Register resources/subscribe and resources/unsubscribe handlers when
  the subscribe server capability is enabled
- Track active subscriptions in a ConcurrentHashMap keyed by resource URI
- Emit notifications/resources/updated when addResource() is called for
  a subscribed URI; also send listChanged notification if enabled
- Add ResourceSubscriptionTests covering the capability guard, subscribe/
  unsubscribe happy paths, and the updated notification flow

Note: as with some other notificaitons this impl. is not bound to user sessiosns

Resolves: #837, #776

Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
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.

Implement resource subscribe/unsubscribe feature

1 participant