Private
Public Access
0
0
Files
manual_slop/scripts
ed c44f3adc11 fix(mcp): context-aware project_root detection (cwd + script_root fallback)
The MCP server's project_root was hardcoded to the script's parent dir.
When opencode launches the MCP from a sibling clone (e.g., main repo
launches the tier2 clone's MCP via the hardcoded path in main repo's
opencode.json), the MCP only allowed paths inside the tier2 clone —
even when the user was working in the main repo.

Fix: use os.getcwd() as the primary project_root (the user's actual
working dir) and fall back to the script's home. Read mcp_paths.toml
from cwd first, then script home. This way:

- MCP launched from tier2 + cwd=main  -> allows [main, tier2]
- MCP launched from main + cwd=main  -> allows [main]
- MCP launched from tier2 + cwd=tier2 -> allows [tier2] (preserves sandbox)

Takes effect after the next opencode restart.
2026-06-19 19:50:20 -04:00
..
2026-06-07 11:51:36 -04:00
2026-06-07 11:51:36 -04:00