feat: add MCP roots protocol support to everything server #2573
+155
−9
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
This PR adds MCP roots protocol support to the everything server to provide complete MCP feature coverage. The implementation includes:
listChanged: true
roots/list_changed
notification handlerlistRoots
tool to demonstrate roots functionalityServer Details
Motivation and Context
Resolves #2552
The everything server is designed to demonstrate all MCP protocol features for client developers to test against. However, it was missing roots protocol support, which is an important MCP capability that allows clients to specify which directories servers can access. This change ensures the everything server truly covers "everything" in the MCP specification.
While this server doesn't actually access files, implementing roots support provides:
How Has This Been Tested?
npm run build
The implementation follows the established patterns from the filesystem server's roots implementation, ensuring consistency with the existing codebase.
Breaking Changes
No breaking changes. This is purely additive functionality that doesn't affect existing server behavior or client configurations.
Types of changes
Checklist
Additional context
The implementation is based on the filesystem server's roots handling but adapted for the everything server's demonstration purposes. Key design decisions:
The
listRoots
tool provides a practical way for developers to verify that their MCP client's roots implementation is working correctly, even though this server doesn't perform file operations.