You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
MCP native Roots is deprecated (SEP-2577, no successor for this use case) and nearly static in practice: hosts rarely expose UI to change roots mid-session, and roots/list_changed is host-initiated only. Soft roots (SetSoftRoots) are portable across every Repl channel (CLI, REPL, hosted sessions, MCP), testable, and mutable mid-session — but today they are shadowed by hard roots whenever the client supports the Roots capability, and they are handler-global mutable state.
Proposed design
Soft roots become the canonical source of truth for IMcpClientRoots.Current (and likely a channel-neutral abstraction promoted out of Repl.Mcp, e.g. IReplWorkspaceRoots).
Native MCP roots act as a seed: when the client provides roots, they initialize the session's soft roots at session start (and on roots/list_changed), then the soft set lives its own life. This inverts today's precedence, where hard roots shadow soft roots and a model cannot refocus its scope on a roots-capable host.
Mutation is opt-in and app-controlled: no mutating tool is exposed by default. Roots-as-security-boundary must remain possible — letting the model rewrite its own scope is self-escalation (workspace use C:\), so apps that want dynamism map an explicit command (and can mark it .Destructive()).
Context
MCP native Roots is deprecated (SEP-2577, no successor for this use case) and nearly static in practice: hosts rarely expose UI to change roots mid-session, and
roots/list_changedis host-initiated only. Soft roots (SetSoftRoots) are portable across every Repl channel (CLI, REPL, hosted sessions, MCP), testable, and mutable mid-session — but today they are shadowed by hard roots whenever the client supports the Roots capability, and they are handler-global mutable state.Proposed design
IMcpClientRoots.Current(and likely a channel-neutral abstraction promoted out of Repl.Mcp, e.g.IReplWorkspaceRoots).roots/list_changed), then the soft set lives its own life. This inverts today's precedence, where hard roots shadow soft roots and a model cannot refocus its scope on a roots-capable host.workspace use C:\), so apps that want dynamism map an explicit command (and can mark it.Destructive()).Priority
Modest — multi-session MCP with roots (stdio) is rare today; the value grows with HTTP hosting (PR #27) and WebSocket/Telnet hosts.
Dependencies
ModelContextProtocolv2.0 #51 (SDK 2.0 posture), PR feat(mcp): migrate to ModelContextProtocol 2.0 line (2.0.0-preview.3) #71 (per-session hard-roots cache, the tactical fix this design supersedes).