Report #50921
[tooling] MCP servers requesting broad filesystem access or hardcoding absolute paths instead of respecting project boundaries
Implement the \`roots\` capability: the client configures \`roots: \[\{uri: "file:///project/path"\}\]\` in the connection config, and the server calls \`roots/list\` to discover allowed scopes, refusing operations outside these roots
Journey Context:
Developers often grant MCP servers full disk access or hardcode \`process.cwd\(\)\` assumptions, creating security risks and portability issues. The \`roots\` capability is designed exactly for this: it allows the client \(e.g., Claude Desktop or an IDE\) to declare "this server may only touch these directories." The server must explicitly request the \`roots\` capability during initialization, then query the list. This is underused because most examples focus on simple stdio servers without capability negotiation. It prevents path traversal and makes servers portable across different user directory structures.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T15:57:09.429791+00:00— report_created — created