Background
#1349 gated ManagedRequestorTasksState.refresh on the server's tasks capability so we don't fire tasks/list against servers that don't advertise it (which returned -32601 "Method not found" in the console on every connect to e.g. the NightRider example).
The same papercut exists in the other four list-fetching state managers:
core/mcp/state/managedToolsState.ts — calls listTools
core/mcp/state/managedPromptsState.ts — calls listPrompts
core/mcp/state/managedResourcesState.ts — calls listResources
core/mcp/state/managedResourceTemplatesState.ts — calls listResourceTemplates
Almost every server advertises tools/resources/prompts so the issue doesn't show up in practice today, but a "tools-only" server (or a "resources-only" server) would surface -32601 errors in the console on every connect — same root cause, same fix shape.
Screenshot
Scope
Add the same capability gate to each of the four state managers:
if (!client.getCapabilities()?.tools) {
this.tools = [];
this.dispatchTypedEvent("toolsChange", this.tools);
return this.getTools();
}
(swap tools/prompts/resources per file).
Resource templates are gated on capabilities.resources (the MCP spec doesn't define a separate resourceTemplates capability — listResourceTemplates is part of the resources surface).
Tests
Mirror the two new tests added in #1349's managedRequestorTasksState.test.ts:
- Existing tests need their
FakeInspectorClient to be constructed with the relevant capability so the live-path coverage is preserved.
- Add a "refresh skips listX when capability absent" test for each state manager.
- Add a "connect against an X-less server doesn't fire listX" test for each.
Same pattern in useManagedX.test.tsx peer files — they also need the capability set in beforeEach.
Out of scope
- Cleanup of the existing -32601 console noise in tests that intentionally probe unsupported methods (those are deliberate).
Background
#1349 gated
ManagedRequestorTasksState.refreshon the server'staskscapability so we don't firetasks/listagainst servers that don't advertise it (which returned -32601 "Method not found" in the console on every connect to e.g. the NightRider example).The same papercut exists in the other four list-fetching state managers:
core/mcp/state/managedToolsState.ts— callslistToolscore/mcp/state/managedPromptsState.ts— callslistPromptscore/mcp/state/managedResourcesState.ts— callslistResourcescore/mcp/state/managedResourceTemplatesState.ts— callslistResourceTemplatesAlmost every server advertises tools/resources/prompts so the issue doesn't show up in practice today, but a "tools-only" server (or a "resources-only" server) would surface -32601 errors in the console on every connect — same root cause, same fix shape.
Screenshot
Scope
Add the same capability gate to each of the four state managers:
(swap
tools/prompts/resourcesper file).Resource templates are gated on
capabilities.resources(the MCP spec doesn't define a separateresourceTemplatescapability — listResourceTemplates is part of the resources surface).Tests
Mirror the two new tests added in #1349's
managedRequestorTasksState.test.ts:FakeInspectorClientto be constructed with the relevant capability so the live-path coverage is preserved.Same pattern in
useManagedX.test.tsxpeer files — they also need the capability set inbeforeEach.Out of scope