-
Notifications
You must be signed in to change notification settings - Fork 271
Open
Description
Description
When using Backlog.md MCP server from within a git worktree, task files are created in the main repository's backlog/tasks/ directory instead of the current worktree's directory.
Steps to Reproduce
- Set up a project with Backlog.md and a protected
mainbranch - Create a git worktree:
git worktree add .worktrees/feature-branch -b feature-branch main - Open Claude Code (or any MCP client) with CWD set to the worktree
- Create a task via the MCP
task_createtool
Expected: Task file created in .worktrees/feature-branch/backlog/tasks/
Actual: Task file created in the main repo's backlog/tasks/
Impact
Since main is protected, the task files created by MCP can't be committed. The workaround is to manually copy files from the main repo to the worktree, then delete the originals — which defeats the purpose of MCP automation.
Suggested Fix
Resolve the project root using process.cwd() or git rev-parse --show-toplevel at the time of each file operation, rather than at server startup. In a worktree, --show-toplevel correctly returns the worktree path.
Environment
- Backlog.md: latest (installed via homebrew)
- MCP config:
backlog mcp start(stdio, user scope) - Git worktrees via
git worktree add - macOS
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels