Method AddRootAsync
AddRootAsync(McpRoot, bool, CancellationToken)
Adds a root to the available roots list.
public Task AddRootAsync(McpRoot root, bool notifyServer = true, CancellationToken cancellationToken = default)
Parameters
rootMcpRootThe root to add.
notifyServerboolWhether to send a list_changed notification to the server.
cancellationTokenCancellationTokenA token to cancel the operation.
Returns
AddRootAsync(string, string, bool, CancellationToken)
Adds a root from a local filesystem path.
public Task AddRootAsync(string path, string name = null, bool notifyServer = true, CancellationToken cancellationToken = default)
Parameters
pathstringThe local filesystem path.
namestringOptional display name for the root.
notifyServerboolWhether to send a list_changed notification to the server.
cancellationTokenCancellationTokenA token to cancel the operation.