mirror of
https://github.com/modelcontextprotocol/servers.git
synced 2026-04-17 23:53:24 +02:00
Use roots cache in get-roots-list tool
* In get-roots-list.ts, query the server's cache of the latest roots from the client and only request the list from the client if it doesn't exist. * In roots.ts, export the roots map
This commit is contained in:
@@ -19,9 +19,8 @@ const config = {
|
|||||||
* The registered tool interacts with the MCP roots capability, which enables the server to access
|
* The registered tool interacts with the MCP roots capability, which enables the server to access
|
||||||
* information about the client's workspace directories or file system roots.
|
* information about the client's workspace directories or file system roots.
|
||||||
*
|
*
|
||||||
* When supported by the client, the server automatically retrieves and formats the current list
|
* When supported, the server automatically retrieves and formats the current list of roots from the
|
||||||
* of roots from the client upon connection and whenever the client sends a `roots/list_changed`
|
* client upon connection and whenever the client sends a `roots/list_changed` notification.
|
||||||
* notification.
|
|
||||||
*
|
*
|
||||||
* Therefore, this tool displays the roots that the server currently knows about for the connected
|
* Therefore, this tool displays the roots that the server currently knows about for the connected
|
||||||
* client. If for some reason the server never got the initial roots list, the tool will request the
|
* client. If for some reason the server never got the initial roots list, the tool will request the
|
||||||
|
|||||||
Reference in New Issue
Block a user