mirror of
https://github.com/modelcontextprotocol/servers.git
synced 2026-04-18 08:03:26 +02:00
feat: add MCP roots protocol support to everything server
- Add roots capability declaration with listChanged: true - Implement roots/list_changed notification handler - Add initialization handler to request initial roots from client - Add new listRoots tool to demonstrate roots functionality - Add comprehensive logging for roots protocol events - Update README.md with roots documentation Resolves #2552 The everything server now demonstrates all MCP features including the roots protocol. This provides a complete reference implementation for client developers to test their roots protocol implementation against, even though this server doesn't access files directly.
This commit is contained in:
@@ -89,6 +89,13 @@ This MCP server attempts to exercise all the features of the MCP protocol. It is
|
||||
- `structuredContent` field conformant to the output schema
|
||||
- A backward compatible Text Content field, a SHOULD advisory in the specification
|
||||
|
||||
11. `listRoots`
|
||||
- Lists the current MCP roots provided by the client
|
||||
- Demonstrates the roots protocol capability even though this server doesn't access files
|
||||
- No inputs required
|
||||
- Returns: List of current roots with their URIs and names, or a message if no roots are set
|
||||
- Shows how servers can interact with the MCP roots protocol
|
||||
|
||||
### Resources
|
||||
|
||||
The server provides 100 test resources in two formats:
|
||||
@@ -129,6 +136,18 @@ Resource features:
|
||||
- Returns: Multi-turn conversation with an embedded resource reference
|
||||
- Shows how to include resources directly in prompt messages
|
||||
|
||||
### Roots
|
||||
|
||||
The server demonstrates the MCP roots protocol capability:
|
||||
|
||||
- Declares `roots: { listChanged: true }` capability to indicate support for roots
|
||||
- Handles `roots/list_changed` notifications from clients
|
||||
- Requests initial roots during server initialization
|
||||
- Provides a `listRoots` tool to display current roots
|
||||
- Logs roots-related events for demonstration purposes
|
||||
|
||||
Note: This server doesn't actually access files, but demonstrates how servers can interact with the roots protocol for clients that need to understand which directories are available for file operations.
|
||||
|
||||
### Logging
|
||||
|
||||
The server sends random-leveled log messages every 15 seconds, e.g.:
|
||||
|
||||
Reference in New Issue
Block a user