fix: MCP repo/init resolve the forge from a fixed launch dir + global default, not the working directory (second-forge ops break) #390
Labels
No labels
breaking
bug
documentation
enhancement
epic
good first issue
help wanted
refactoring
resolution/duplicate
resolution/invalid
resolution/wontfix
security
severity/critical
severity/high
severity/low
severity/medium
status/abandoned
status/blocked
status/needs-decision
status/needs-info
status/needs-verification
testing
upstream
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
sixfold-space/madtea#390
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What happens
I keep tokens for two forges in the store, keyed by URL. In one session the MCP tools always act on one forge, and I cannot point them at the other.
The CLI handles this correctly. Run from a checkout (or a directory) that belongs to the second forge, it resolves that forge from the origin remote or a workspace scan and uses its stored token.
auth whoamifrom there reports the right forge andSource: workspace scan.The MCP tools do not. They resolve the forge from the server's launch directory. When that directory has no git signal (empty, no repo, no origin), the chain falls through to the global git config, which is a default forge unrelated to the work.
repolist andinitthen act on that default. Creating under an org that exists only on the other forge fails with a 404.initaccepts adir, butdironly sets where the local clone lands. It does not move which forge the remote is created on. So there is no per-call way to target the second forge from the MCP surface.Why it matters
The store already holds both tokens, so both forges are reachable in principle. The gap is selection: the MCP tools choose a forge from a fixed launch directory plus a global fallback, not from the working context. And the repo-management CLI commands are redirected to the MCP tools, so I cannot drop to the CLI to work around it.
Expected
Resolve the forge the way the CLI already does, and the way git does:
For
init/create (no origin to read yet): resolve from the target directory's neighbours, or accept an explicit forge/owner in the call. Refuse rather than guess.Repro
Related