Where does the bug appear (feature/product)?
Cursor IDE
Describe the Bug
When an agent calls an MCP tool and sets roots while it works in a worktree, the call returns
Invalid root file:///Users/petertrost/.cursor/worktrees/add-analytics-plugin/H9GtG/packages/cusom_lints, must be under one of the registered project roots:
{uri: file:///Users/petertrost/dev/apps-workspace/add-analytics-plugin, name: add-analytics-plugin}
Steps to Reproduce
- Set up an MCP that supports roots. In my example the Dart MCP: Dart and Flutter MCP server
- Prompt an agent in worktree mode to call a tool with
rootsspecified. See above for my example, where it tried to use thedart formattool - Observe the call getting blocked
Expected Behavior
Worktrees are allowed as workspace and tool calls with roots set pass.
Operating System
MacOS
Current Cursor Version (Menu → About Cursor → Copy)
Version: 2.0.77
VSCode Version: 1.99.3
Commit: ba90f2f88e4911312761abab9492c42442117cf0
Date: 2025-11-13T23:10:43.113Z
Electron: 37.7.0
Chromium: 138.0.7204.251
Node.js: 22.20.0
V8: 13.8.258.32-electron.0
OS: Darwin arm64 25.1.0
Does this stop you from using Cursor
No - Cursor works, but with this issue