Summary
On the Resources screen, the Subscribe/Unsubscribe button (SubscribeButton in ResourcePreviewPanel) and the Subscriptions accordion section (in ResourceControls) are always rendered, even when the connected server does not advertise the resource subscription capability. These controls should be hidden when the server doesn't support subscriptions, since they can't do anything useful.
Expected behavior
When the server's capabilities do not include resources.subscribe === true:
- Do not render the Subscribe/Unsubscribe button in
ResourcePreviewPanel.
- Do not render the "Subscriptions" accordion section in
ResourceControls.
When the server does advertise resources.subscribe, both should render as they do today.
Relevant code
- Capability source:
ServerCapabilities.resources.subscribe, exposed to the UI via useInspectorClient (core/react/useInspectorClient.ts) and already used in core/mcp/inspectorClient.ts (e.g. this.capabilities?.resources?.subscribe === true).
- Subscribe button:
clients/web/src/components/groups/ResourcePreviewPanel/ResourcePreviewPanel.tsx (renders SubscribeButton).
- Subscriptions accordion section:
clients/web/src/components/groups/ResourceControls/ResourceControls.tsx (the value="subscriptions" Accordion.Item).
- Both flow through
ResourcesScreen → InspectorView, which already receives capabilities from useInspectorClient.
Implementation notes
- Thread a boolean prop (e.g.
supportsSubscriptions) down from InspectorView → ResourcesScreen → ResourceControls / ResourcePreviewPanel, derived from capabilities?.resources?.subscribe === true. Keep the components "dumb" (data + callbacks as props) per the v2 architecture.
- Remember to update/add tests and Storybook stories for the hidden vs. shown states (
ResourceControls, ResourcePreviewPanel, SubscribeButton).
Summary
On the Resources screen, the Subscribe/Unsubscribe button (
SubscribeButtoninResourcePreviewPanel) and the Subscriptions accordion section (inResourceControls) are always rendered, even when the connected server does not advertise the resource subscription capability. These controls should be hidden when the server doesn't support subscriptions, since they can't do anything useful.Expected behavior
When the server's capabilities do not include
resources.subscribe === true:ResourcePreviewPanel.ResourceControls.When the server does advertise
resources.subscribe, both should render as they do today.Relevant code
ServerCapabilities.resources.subscribe, exposed to the UI viauseInspectorClient(core/react/useInspectorClient.ts) and already used incore/mcp/inspectorClient.ts(e.g.this.capabilities?.resources?.subscribe === true).clients/web/src/components/groups/ResourcePreviewPanel/ResourcePreviewPanel.tsx(rendersSubscribeButton).clients/web/src/components/groups/ResourceControls/ResourceControls.tsx(thevalue="subscriptions"Accordion.Item).ResourcesScreen→InspectorView, which already receivescapabilitiesfromuseInspectorClient.Implementation notes
supportsSubscriptions) down fromInspectorView→ResourcesScreen→ResourceControls/ResourcePreviewPanel, derived fromcapabilities?.resources?.subscribe === true. Keep the components "dumb" (data + callbacks as props) per the v2 architecture.ResourceControls,ResourcePreviewPanel,SubscribeButton).