pub struct WorkspaceConfig {
pub kind: WorkspaceKind,
pub root: Option<String>,
pub watch: bool,
pub sandbox_root: Option<String>,
pub adopt_client_roots: bool,
pub applies_to: Option<AppliesTo>,
}Fields§
§kind: WorkspaceKind§root: Option<String>Local-mode only: path to the directory to bind as the source root. Relative paths resolve against the YAML’s parent dir.
watch: boolLocal-mode only: wire the framework’s file watcher to root
(debounced rebuild trigger via the post-activate hook).
sandbox_root: Option<String>Local-mode only: the outer containment boundary for runtime root
swaps. When set, set_root_dir refuses any target that does not
resolve inside this directory; root itself must be inside it or
the server refuses to boot. Relative paths resolve against the
YAML’s parent dir, exactly like root.
Unset is the default and means unbounded — set_root_dir
accepts any directory, which is the historical behaviour every
existing deployment relies on.
adopt_client_roots: boolLocal-mode only: adopt a root advertised by the MCP client
(roots/list) when the operator configured none.
Off by default, and fallback-only even when on: workspace.root,
--watch, --source-root and --workspace all win, and an explicit
set_root_dir permanently ends adoption for the session. With it on,
workspace.root may be omitted — the server then boots unanchored and
binds nothing until a client offers a root (and stays unanchored if
none ever arrives). Without it, a missing workspace.root is the same
boot error it has always been.
Pair it with sandbox_root: the client’s root is
a suggestion, the boundary is what actually contains it.
Deprecated upstream. MCP roots is deprecated as of protocol
revision 2026-07-28 (SEP-2577) — “New implementations SHOULD NOT
adopt it” — and is eligible for removal in the first revision released
on or after 2027-07-28. The migration path named by the spec is to pass
directories via tool parameters, resource URIs, or server configuration
(workspace.root).
applies_to: Option<AppliesTo>Optional opt-in for the find_workspace_manifest parent-walk
fallback. When set, this manifest is auto-discovered by
mcp-server --workspace DIR (and similar callers) only when
the operator’s DIR matches the declaration here. When
unset, the parent-walk fallback NEVER fires for this manifest
— operators must pass --mcp-config explicitly.
Values are glob patterns matching the workspace dir’s basename (single-segment match — parent-walk is always single-level). Three forms:
- Single pattern (
./repos,repos,*,a*,prod-?): match against the workspace dir’s basename. Literal strings likereposmatch onlyrepos; glob patterns like*orprod-*match any name fitting the pattern. - List of patterns (
[./repos, ./clones],[prod-*, test-*]): match if any pattern matches. Useful for curated subsets or multiple naming conventions in one manifest.
Leading ./ is optional and stripped at parse time. Patterns
must be single-segment — ./a/b is rejected. Invalid glob
syntax is rejected at parse time.
Eliminates the accidental-discovery footgun where a workspace manifest is auto-picked-up by an unrelated sibling dir. The manifest’s own declaration is the opt-in.
Trait Implementations§
Source§impl Clone for WorkspaceConfig
impl Clone for WorkspaceConfig
Source§fn clone(&self) -> WorkspaceConfig
fn clone(&self) -> WorkspaceConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more