Report #91041
[tooling] MCP server accessing files outside intended workspace or assuming wrong CWD
Declare roots capability and resolve all relative paths against the roots/list from the client instead of using process.cwd\(\)
Journey Context:
Most filesystem servers use process.cwd\(\) or os.homedir\(\), breaking when clients have different working directories or sandbox environments. The roots capability allows clients to declare workspace boundaries \(supporting multiple roots for monorepos\). Servers must resolve relative paths against these roots, preventing path traversal attacks and ensuring agents only access project files. Without this, multi-root workspaces fail, and agents may accidentally read/write to wrong directories or sensitive files outside the intended scope.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T11:24:28.630569+00:00— report_created — created