Add toast for misconfigured logging #706
Merged
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.
Description
logging/setLevel
, pop up a toast with the messageServer declares logging capability but doesn't implement method "logging/setLevel"
Motivation
logging/setLevel
message during initialization if the server advertises support for thelogging
capability.Context
The MCP spec for logging states two relevant things:
The Inspector is clearly operating in spec. A server that advertises that it supports logging but actually doesn't is operating out of spec.
Other clients in the wild which follow spec will naturally do this and when it fails with them, it's more likely a real "getting in the way of work" problem.
If we revert the automatic setLevel request, we're only encouraging server developers to continue doing the wrong thing. This is after all, a tool for developers to inspect their servers and determine if they're operating correctly.
But clearly a failure to connect with no clear feedback as to why is a poor user experience and doesn't help the developer to diagnose and fix the problem. So we opted to add a toast message when a Method Not Found error is thrown as a result of sending the
logging/setLevel
request.How Has This Been Tested?
Commented out the request handler for
SetLevelRequestSchema
in the server-everything reference server, which declares support for thelogging
capability during the initialization.Breaking Changes
Nope.
Types of changes
Checklist
Additional context
This closes #696 & #699