Repository navigation
[BR-2167] Switch MCP registrations with the active workspace - #1364
Open
sunishsheth2009 wants to merge 7 commits into
Open
sunishsheth2009 wants to merge 7 commits into
sunishsheth2009 wants to merge 7 commits into
Conversation
xsh310
reviewed
Oct 30, 2026
xsh310
reviewed
Oct 30, 2026
xsh310
reviewed
Oct 30, 2026
xsh310
approved these changes
Oct 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
BR-2167
Coding agents keep MCP registrations in a global config keyed by server name. Adding workspace B's MCP server while workspace A remains active can expose B's tools to an A session; appending a workspace suffix does not isolate the sessions. Model configuration already selects one active workspace.
This PR makes MCP registration follow that active-workspace boundary:
ug mcp add --workspace Brefuses to register while A is active and points toug configure --workspace B. On first setup, MCP add selects its workspace without configuring agent models.Example: with A active and
system-ai-githubsaved for A, first runug configure --workspace B --agent codex. A's registration is removed and B's saved registration is installed, if one exists. Runug mcp add --agents codex --names system.ai.githubif B has no saved selection. Start a new Codex session to use B's tools. Runningug configure --workspace A --agent codexrestores A's saved URL.Validation
tests/test_mcp.py tests/test_cli.py tests/test_agent_vscode.py: 1,023 passed locally after the review fixes.src/andtests/, Ty check onsrc/, andgit diff --checkpassed.BR-2276 PR #1363 changes nearby MCP client detection and registration code but has no functional dependency. Rebase it after this PR if this merges first.