Skip to content

IMcpClientRoots

Provides access to MCP client roots for the current MCP session.

public interface IMcpClientRoots

Clears the soft roots for the current session.

void ClearSoftRoots()

Resolves the current effective roots for the session, refreshing native roots on demand when supported.

ValueTask<IReadOnlyList<McpClientRoot>> GetAsync(CancellationToken cancellationToken = default)

ValueTask<IReadOnlyList<McpClientRoot>>

Sets soft roots for the current session.

void SetSoftRoots(IEnumerable<McpClientRoot> roots)
  • roots (IEnumerable<McpClientRoot>)

Gets the current effective roots for the session. Native roots are preferred when supported; otherwise soft roots are returned.

IReadOnlyList<McpClientRoot> Current { get; }

IReadOnlyList<McpClientRoot>

Gets a value that indicates whether soft roots were configured for the current session.

bool HasSoftRoots { get; }

bool

Gets a value that indicates whether the connected MCP client supports native roots discovery.

bool IsSupported { get; }

bool