fix(mcp): capture CLAUDE_PROJECT_DIR from PWD before cd #259

Merged
lmiranda merged 1 commits from fix/mcp-project-dir-detection into development 2026-01-28 16:44:32 +00:00
Owner

Summary

  • All MCP server run.sh scripts now capture the original working directory as CLAUDE_PROJECT_DIR before changing to the script directory
  • This fixes the branch detection issue where MCP tools detected the plugin repo's branch instead of the user's project branch
  • Follow-up fix to #231 - the original fix relied on CLAUDE_PROJECT_DIR being set by Claude Code, but it is not

Test Plan

  • Merge PR and update marketplace
  • Restart Claude Code session
  • Run MCP tool (create_issue) and verify it detects the correct branch

🤖 Generated with Claude Code

## Summary - All MCP server run.sh scripts now capture the original working directory as CLAUDE_PROJECT_DIR before changing to the script directory - This fixes the branch detection issue where MCP tools detected the plugin repo's branch instead of the user's project branch - Follow-up fix to #231 - the original fix relied on CLAUDE_PROJECT_DIR being set by Claude Code, but it is not ## Test Plan - [ ] Merge PR and update marketplace - [ ] Restart Claude Code session - [ ] Run MCP tool (create_issue) and verify it detects the correct branch 🤖 Generated with [Claude Code](https://claude.com/claude-code)
lmiranda added 1 commit 2026-01-28 16:43:40 +00:00
All MCP server run.sh scripts now capture the original working
directory as CLAUDE_PROJECT_DIR before changing to the script
directory. This fixes the branch detection issue where MCP tools
detected the plugin repo's branch instead of the user's project branch.

This is a follow-up fix to #231 - the original fix relied on
CLAUDE_PROJECT_DIR being set by Claude Code, but it isn't.
Now we capture it ourselves from PWD at startup time.

Closes #231 (proper fix)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
lmiranda merged commit 8a957b1b69 into development 2026-01-28 16:44:32 +00:00
lmiranda deleted branch fix/mcp-project-dir-detection 2026-01-28 16:44:32 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: personal-projects/leo-claude-mktplace#259