You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Expose live resource subscriptions via a hook #1325
ResourcesScreen renders a subscriptions: InspectorResourceSubscription[] prop showing which resources the user has subscribed to and when each was last updated. InspectorClient tracks subscriptions internally and dispatches notifications/resources/updated notifications, but there's no hook that surfaces the live list to React.
#1244's App.tsx passes subscriptions={[]} because no such hook exists yet. The result: onSubscribeResource / onUnsubscribeResource callbacks fire correctly, but the UI never reflects the subscription state — buttons feel no-op from the user's perspective even though the server-side subscriptions are real.
Scope
Add a state manager — core/mcp/state/resourceSubscriptionsState.ts — that subscribes to the InspectorClient's resource-subscription events and maintains an InspectorResourceSubscription[]. Updates the lastUpdated field when notifications/resources/updated arrives for a subscribed URI.
Add a useResourceSubscriptions(client, state) hook in core/react/.
Wire App.tsx to pass the real list through.
Acceptance criteria
Subscribing to a resource adds an entry visible in the Resources screen.
Unsubscribing removes the entry.
notifications/resources/updated updates the lastUpdated timestamp of the matching subscription.
Activity
fix(web): address #1244 PR review feedback (JsonValue cast, client li…
Wire App.tsx to v2 core/ hook layer; remove demo stub from InspectorV…
Expose live resource subscriptions via a hook (#1325) (#1326)