Tolerate MethodNotFound for optional capabilities in ListCapabilities - #6660
Merged
ChrisJBurns merged 1 commit intoSep 15, 2026
Conversation
The ListCapabilities path (used by health checks and capability aggregation) was missing the -32601 tolerance that the session-init path already had. A backend that advertises the resources or prompts capability but answers the corresponding list method with JSON-RPC -32601 (Method not found) caused the entire backend to be marked degraded/unavailable, silently dropping all of its tools. The parent revision already gates on serverCaps.Resources/Prompts before probing, so unadvertised capabilities are not called. This change defends the remaining edge case where a backend advertises a capability but does not implement the list method (e.g. Atlassian Rovo, see stacklok#5231), aligning the ListCapabilities path with the existing session-init tolerance. Legacy path (queryResources, queryPrompts): - Detect mcp.ErrMethodNotFound and return an empty result set with a WARN log instead of propagating the error. Modern path (modernEnumerate): - Set degradeNotFound=true for resources/list and prompts/list in modernListOptional, matching the existing resources/templates/list behavior. Update the modernListOptional doc comment to reflect that resources/list and prompts/list are no longer fatal. tools/list remains strict when the backend advertises the tools capability; advertising tools while returning MethodNotFound for tools/list is treated as an inconsistent backend implementation. Closes stacklok#6339 Signed-off-by: hellouz818 <hellouz818@gmail.com>
hellouz818
requested review from
ChrisJBurns,
JAORMX,
amirejaz,
jerm-dro,
jhrozek and
tgrunnagle
as code owners
September 15, 2026 07:06
ChrisJBurns
approved these changes
Sep 15, 2026
Collaborator
|
/retest |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6660 +/- ##
==========================================
+ Coverage 78.93% 79.13% +0.19%
==========================================
Files 782 785 +3
Lines 78065 78309 +244
==========================================
+ Hits 61620 61966 +346
+ Misses 16440 16338 -102
Partials 5 5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Collaborator
|
Thanks for the contribution @hellouz818 have merged the above! 🚀 |
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ListCapabilitiesalready respects advertised capabilities, so unadvertised resource and prompt capabilities are not probed.This change covers the remaining interoperability case where a backend advertises
resourcesorpromptsbut returns-32601 Method not foundfor thecorresponding list method.
The session-init path (
queryBackendResources/queryBackendPromptsinmcp_session.go) already tolerates this behavior. This PR aligns theListCapabilitiespath, used by health checks and capability aggregation, with the same handling.
This prevents otherwise healthy backends from being marked degraded and keeps their tools available through the vMCP.
Related to #6339
Type of change
Test plan
task test)Verified against a production vMCP deployment running ToolHive v0.46.0 with an Atlassian Jira MCP backend that advertises the
resourcescapability but returns-32601forresources/list.Added regression coverage for:
resources/listreturningMethodNotFoundwhile tools continue to aggregateprompts/listreturningMethodNotFoundwhile tools continue to aggregateresources/listorprompts/listDoes this introduce a user-facing change?
Yes.
Backends that advertise
resourcesorpromptsbut return-32601 Method not foundfor the corresponding list method are no longer marked degraded solely becauseof that optional capability. Their remaining capabilities, including tools, continue to aggregate and route normally through the vMCP.
Special notes for reviewers
The parent revision already gates
resources/listandprompts/listonserverCaps.Resources != nilandserverCaps.Prompts != nil, so the original #6339 caseof probing unadvertised capabilities is already handled.
This PR addresses the adjacent interoperability case where a backend advertises an optional capability but does not implement its list method, as seen with
Atlassian Rovo (#5231).
tools/listremains strict when the backend advertises the tools capability. Advertising tools while returningMethodNotFoundfortools/listis treated as aninconsistent backend implementation.
Generated with Claude Code