TsgcWSAPIClient_MCP › Events › OnMCPListRoots
Fires when the server asks the client for its filesystem roots (roots/list).
property OnMCPListRoots: TsgcAI_MCP_Client_OnListRootsEvent;
// TsgcAI_MCP_Client_OnListRootsEvent = procedure(Sender: TObject; const aRequest: TsgcAI_MCP_Request_RootsList; const aResponse: TsgcAI_MCP_Response_RootsList) of object
—
Server-initiated event: the server issued a roots/list request or notification to discover which workspace roots (project folders, URIs) the host exposes. Populate aResponse.Result.Roots with the entries you want to advertise. The component replies to the server automatically once the handler returns. Use this event so tools such as code search or file access stay within the boundaries the user has explicitly approved.
procedure TMainForm.MCPListRoots(Sender: TObject;
const aRequest: TsgcAI_MCP_Request_RootsList;
const aResponse: TsgcAI_MCP_Response_RootsList);
begin
aResponse.Result.Roots.Add('file:///C:/Projects/Demo', 'Demo workspace');
end;