Skip to content
This repository was archived by the owner on Apr 22, 2026. It is now read-only.

Commit 6f967ff

Browse files
committed
fix: find_fuzzforge_root searches cwd first instead of __file__
1 parent 47c254e commit 6f967ff

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

  • fuzzforge-cli/src/fuzzforge_cli/commands

fuzzforge-cli/src/fuzzforge_cli/commands/mcp.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,15 +132,22 @@ def _find_fuzzforge_root() -> Path:
132132
:returns: Path to fuzzforge-oss directory.
133133
134134
"""
135-
# Try to find from current file location
136-
current = Path(__file__).resolve()
135+
# Check environment variable override first
136+
env_root = os.environ.get("FUZZFORGE_ROOT")
137+
if env_root:
138+
return Path(env_root).resolve()
139+
140+
# Walk up from cwd to find a fuzzforge root (hub-config.json is the marker)
141+
for parent in [Path.cwd(), *Path.cwd().parents]:
142+
if (parent / "hub-config.json").is_file():
143+
return parent
137144

138-
# Walk up to find fuzzforge-oss root
145+
# Fall back to __file__-based search (dev install inside fuzzforge-oss)
146+
current = Path(__file__).resolve()
139147
for parent in current.parents:
140148
if (parent / "fuzzforge-mcp").is_dir():
141149
return parent
142150

143-
# Fall back to cwd
144151
return Path.cwd()
145152

146153

0 commit comments

Comments
 (0)