Report #5105
[tooling] MCP server accessing entire filesystem instead of project-specific directories
Respect the \`roots\` capability provided by the client. Scope all filesystem operations to the URI roots listed in \`client/roots\`, falling back to cwd only if empty.
Journey Context:
Servers often default to \`process.cwd\(\)\` or \`/\`, which is dangerous and incorrect in multi-root workspaces \(e.g., VS Code with multiple folders\). The client exposes \`roots\` via the \`roots\` capability. A well-behaved server must treat these as chroot boundaries. If the server declares \`roots\` support in its capabilities, the client will provide the list; the server must enforce it. This prevents path traversal and keeps agents scoped to relevant code.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T20:40:37.312543+00:00— report_created — created