Release: fix project directory detection for MCP server #72

Merged
lmiranda merged 2 commits from development into main 2026-01-21 21:41:55 +00:00
Owner

Summary

Merges fix for issue #70 - MCP tools now correctly detect project directory for git remote auto-detection.

Problem

MCP server runs with cwd = plugin directory, causing git remote detection to fail.

Solution

Added _find_project_directory() with multiple fallback strategies:

  1. CLAUDE_PROJECT_DIR env var
  2. PWD env var (if has .git or .env)
  3. cwd fallback (for tests)

Tests: 9 config tests passing

Fixes #70

## Summary Merges fix for issue #70 - MCP tools now correctly detect project directory for git remote auto-detection. ### Problem MCP server runs with cwd = plugin directory, causing git remote detection to fail. ### Solution Added `_find_project_directory()` with multiple fallback strategies: 1. `CLAUDE_PROJECT_DIR` env var 2. `PWD` env var (if has `.git` or `.env`) 3. `cwd` fallback (for tests) **Tests:** 9 config tests passing Fixes #70
lmiranda added 2 commits 2026-01-21 21:39:10 +00:00
The MCP server runs with cwd set to the plugin directory, not the
user's project directory. This caused git remote auto-detection to
fail because it was looking at the wrong directory.

Changes:
- Added _find_project_directory() method with multiple strategies:
  1. CLAUDE_PROJECT_DIR environment variable
  2. PWD environment variable (if it has .git or .env)
  3. Current working directory (if it has .git or .env)
- Updated _detect_repo_from_git() to accept project_dir parameter
- Added 3 new tests for project directory detection

Fixes #70

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
lmiranda merged commit 5da29c8e35 into main 2026-01-21 21:41:55 +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#72