mirror of
https://github.com/modelcontextprotocol/servers.git
synced 2026-04-20 12:55:21 +02:00
Get roots unconditionally when syncRoots is called
* In server/roots.ts - in syncRoots, if roots are supported fetch them * In get-roots-list.ts, - Don't import and inspect current roots map, just call syncRoots to get the list.
This commit is contained in:
@@ -27,8 +27,8 @@ export const syncRoots = async (server: McpServer, sessionId?: string) => {
|
||||
const clientCapabilities = server.server.getClientCapabilities() || {};
|
||||
const clientSupportsRoots: boolean = clientCapabilities.roots !== undefined;
|
||||
|
||||
// If roots have not been fetched for this client, fetch them
|
||||
if (clientSupportsRoots && !roots.has(sessionId)) {
|
||||
// Fetch the roots list for this client
|
||||
if (clientSupportsRoots) {
|
||||
// Function to request the updated roots list from the client
|
||||
const requestRoots = async () => {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user