MCP usage — root blocked for worktree

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

  1. Set up an MCP that supports roots. In my example the Dart MCP: Dart and Flutter MCP server
  2. Prompt an agent in worktree mode to call a tool with roots specified. See above for my example, where it tried to use the dart format tool
  3. 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

Hey, thanks for the report. This looks like a workspace root validation issue when using worktrees together with MCP tools.

I’ve already escalated this for investigation. Based on the error, the worktree path (~/.cursor/worktrees/…) is not being recognized as a valid path under your project root, which is why MCP tools don’t work correctly in worktree mode.

Temporary workaround: for now, you’ll need to use the agent in local workspace mode (not worktree) when using MCP tools that require the roots parameter.

Let me know if you discover any additional details about this issue!

1 Like

This topic was automatically closed 22 days after the last reply. New replies are no longer allowed.