Report #58538
[tooling] Agent cannot find files or understand project structure in MCP
Expose workspace boundaries using the Roots capability with URI prefixes like 'file:///workspace' and 'git://repo', allowing the client to notify the server of relevant directories without hardcoding paths in tools
Journey Context:
Developers hardcode relative paths like './data' or '/workspace' in their MCP tools, which breaks when the client runs in a different working directory or when the agent is working across multiple repositories. The Roots capability allows the server to declare 'I can handle resources under these URI schemes' and the client dynamically informs the server which specific directories are currently in scope via the 'roots/list' endpoint. For example, instead of a tool 'read\_file' taking a raw path, the server exposes roots 'file:///project-a' and 'file:///project-b', and the client sends notifications when these change. This enables the agent to ask 'what files are in the current workspace' without the server needing filesystem access outside the allowed roots. Most implementations skip this and use environment variables, which leaks host filesystem structure and prevents multi-tenant usage where one server instance serves multiple isolated workspaces.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T04:44:53.170731+00:00— report_created — created