Skip to content

fix(mcp): Move leaves a server in agents Orca's list doesn't reach - #49168

Merged
AmoabaKelvin merged 4 commits into
mainfrom
fix/mcp-move-keeps-unreached-agent-copies
Nov 25, 2026
Merged

AmoabaKelvin merged 4 commits into
mainfrom
fix/mcp-move-keeps-unreached-agent-copies

Conversation

@AmoabaKelvin

@AmoabaKelvin AmoabaKelvin commented Nov 25, 2026 •

Copy link
Copy Markdown
Collaborator

ELI5

"Move to Orca" took an MCP server out of every agent's own settings, assuming Orca would give it back to those agents from its own list. For some agents Orca can't do that yet, for example Gemini CLI (Orca no longer launches it). Those agents simply lost the server. Now Move only takes the server out of agents that really get it from Orca. The others keep their own copy. A server that only those agents have shows "Copy to Orca" instead of "Move to Orca".

Files Added Deleted Net
Test 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​13 $\color{#cf222e}{\Huge{\mathbf{−}}}$​8 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​5
Prod 12 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​251 $\color{#cf222e}{\Huge{\mathbf{−}}}$​53 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​198

What Changed

Move takes a server only out of agents whose new sessions on that host get Orca's list. The host decides per agent (listReaches in mcp-servers-import.ts):

  • Grok, Cursor and Droid: only once the user has let Orca keep its servers in their own MCP file (the existing agent-file consent).
  • Claude, Codex, OpenCode, Copilot, Pi and Amp: when their terminal launch takes Orca's servers and no launch has recorded a problem (CLI too old for the route, or Claude blocked by the organisation's settings).
  • Everything else, Gemini CLI today: never, so it keeps its copy.

The rest follows from that decision:

  • Discover rows carry a new optional removesFrom. It lists the agents Move takes the server out of, and Claude account profile copies go only when Claude is among them.
  • Confirm text, desktop and phone: the existing "Orca removes it from {{agents}} settings" now names only those agents.
  • Copy-only rows: a row with no such agent offers "Copy to Orca" in place of Move. Desktop shows it as the button; the phone hides Move in the row menu. "Move all" leaves those rows out.
  • No duplicates: an import that takes no agent copy out (a Copy, or a Move of a row left behind) reuses an identical server already in Orca instead of adding name-2. A Move that does take copies out still adds its own entry, scoped like those copies, so an existing entry that reaches less can never stand in for them. The lookup skips plugin entries and entries with a saved sign-in or headers.
  • Cheap reads: the consent and duplicate checks read the host list's file without opening the credential store, and only when the answer is used.

Product call made here (the ticket left it open): until Orca's launches reach an agent, Move leaves that agent's copy in place. I rejected two alternatives. Refusing Move outright would block consolidating servers for the agents Orca does reach. Turning on agent-file consent as a side effect of Move would write to Cursor, Grok or Droid files without the user's separate yes.

Why

Move assumed every agent with a copy would get the server back from Orca's list at launch. Discovery reads ten agents' files, but Orca launches only some of them with its list. Gemini CLI support was removed in #48447. File-based agents need the user's consent. A launch can learn that an agent's CLI can't take the servers. So "removes it from Gemini CLI settings" deleted a working server with nothing replacing it. The host already knows which agents its launches reach (terminal adapters, recorded agent problems, file consent), so the decision is made there once. Desktop, phone and older clients all follow it: an older client that doesn't know removesFrom still triggers the same host-side Move.

Linked Issue

STA-18122

Visual Proof

Settings → MCP servers → "In your agents". GitHub is in Claude Code, Codex and Gemini CLI; Figma is only in Gemini CLI.

Before After
move-copy-before.png move-copy-after.png

Before, Figma offered Move, which deleted it from Gemini CLI. After, it offers Copy. GitHub's Move confirm now reads "Orca removes it from Claude Code and Codex settings" and leaves Gemini's copy.

To try it (with ORCA_MCP_SERVERS=1):

  • Add the same server to ~/.claude.json and ~/.gemini/settings.json.
  • Open Settings → MCP servers and Move it.
  • ~/.gemini/settings.json is unchanged, and Copy on the remaining Gemini row doesn't add name-2.

Dev build: worktree ~/orca/workspaces/orca/w-rb-mcp-move, branch fix/mcp-move-keeps-unreached-agent-copies.

Testing

  • agent-mcp-config-removal.test.ts: Move of a server in Claude, Codex and Gemini takes it out of Claude and Codex only, and Gemini's file stays byte-identical. Without the change Gemini's entry is removed, and the test fails.

  • pnpm check:changed passes (format, lint, typecheck for node/web/mobile, ratchets, tests). Fixture screenshots above via pnpm fixtures:shot.

  • macOS only; the decision runs on the execution host, so SSH and paired servers get the same rule.

  • I manually tested these changes locally

  • Automated tests added/updated, or explained why not below

  • Every added test fails without this change and avoids the test anti-patterns

Performance

None, because:

  • Discover reads the host list file once (no credential store) and only when it found servers.
  • Copy reads it only to find an identical server.
  • Move reads it once.

Nothing here scales with worktrees, terminals or agents, and nothing runs while idle.

Risk

  • Claude after a restart: whether Claude is blocked by its organisation is only known after a Claude launch or check since Orca started. A Move before any Claude launch still treats Claude as reached. This is the same as before this PR, and the .bak keeps the entry.
  • Older phones: they ignore removesFrom, so their confirm names every agent while the host removes fewer. That errs on the safe side.

A plain revert restores the old "remove from every agent" Move.

Level: Medium

AI Disclosure

Review

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Ensure no issues in: Security, Cross-platform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance

Mixed versions:

  • New client with an old host: removesFrom is absent, and clients fall back to agents, matching what that host does.
  • Old client with a new host: the extra field is ignored.

Known follow-ups (P2):

  • A server whose agent copy carries headers can't be matched to Orca's saved entry, so a Copy of a leftover row can still add name-2.
  • Claude's org-settings refusal isn't remembered across restarts.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • I stated the risk: what could break, for whom, and how to back it out
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

Move took a server out of every agent's own config, though Orca never
launches Gemini CLI with its list, Grok/Cursor/Droid get it only once the
user lets Orca into their file, and an agent whose launches learned they
can't take the servers gets none. Those agents lost a working server. Move
now removes it only from agents whose sessions on that host get Orca's list,
names just those in its confirm, and a server only such agents have offers
Copy instead.
…y; read agent-file consent alone

A server moved while an agent Orca's list doesn't reach kept its copy is still
listed, so a second Move or Copy added it again as name-2. Import now reuses
the host list's server with the same definition. The consent read behind
Move's reach no longer opens the host list's servers and sign-ins.
… out

Reusing a server Orca already had and then removing the agents' copies could
leave an agent without it when Orca's entry is narrower (off for that agent,
other workspaces, a plugin's, other saved headers). A Move that takes copies out
adds its own entry scoped like them; reuse is for imports that keep every copy,
and skips plugin entries and ones with a saved sign-in or headers.
… alone

The duplicate check opened every saved sign-in on each Copy, and the consent
read ran even with nothing discovered or for a Copy that never uses it. Both
now read the host list's file without the credential store, and only when
their answer is used.
@coderabbitai

coderabbitai Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Walkthrough

The change adds agent-list reachability data to discovered MCP servers and uses it to select which agent configurations a Move operation removes. Copy operations leave agent copies in place. The renderer and mobile UI use the removal targets to determine available actions and confirmation text.

Merge Risk: Low · up to 28220

Move to Orca now removes agent copies only for agents that receive Orca's server list. In a narrow race, such as consent being withdrawn or a launch problem being recorded while the add is in progress, a copy could still be removed from an agent that no longer receives the list. The added Orca entry remains. Merge risk is low, and re-checking reach after the add would close the gap.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: Move to Orca no longer removes an MCP server from agents that Orca's server list does not reach. The changeset implements this through the removesFrom list, the listRe…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description check Passed The description follows the template closely and is mostly complete. It has an ELI5, a detailed What Changed section, a Why section with the alternatives considered, a linked issue (STA-18122), visual…
Full details: Title check

Explanation

The title names the main change: Move to Orca no longer removes an MCP server from agents that Orca's server list does not reach. The changeset implements this through the removesFrom list, the listReaches host decision, copy-only rows, and the confirm text. The title is specific and concise, and the 66-character length is acceptable. It uses the conventional fix(mcp) prefix, which is a minor style point and does not affect the result.

Full details: Description check

Explanation

The description follows the template closely and is mostly complete. It has an ELI5, a detailed What Changed section, a Why section with the alternatives considered, a linked issue (STA-18122), visual before/after proof, a testing section, a performance line, a risk section with a level and rollback path, and a checklist. The gaps are minor. The Linked Issue section does not use the template's 'Fixes #' form, the Testing section does not say which platforms were tested beyond macOS, the 'Review' and 'AI Disclosure' headings are empty, and the final lint/typecheck/test/build checklist item is unchecked. The Testing section also cites a unit test that the author says fails without the change, which is a stated check. None of these gaps make the description incomplete.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f2f59239-5214-4c0e-9b8e-1e2fe8f41762
Commits

Reviewing files that changed from the base of the PR and between 3518e7b and 2822035.

Files selected for processing: 13

  • mobile/src/mcp-servers/MobileMcpServerList.tsx
  • mobile/src/mcp-servers/mcp-server-operations.ts
  • mobile/src/mcp-servers/use-mcp-server-actions.ts
  • src/main/mcp-servers/agent-configs/agent-mcp-config-removal.test.ts
  • src/main/mcp-servers/agent-configs/agent-mcp-import.ts
  • src/main/mcp-servers/mcp-agent-problems.ts
  • src/main/mcp-servers/mcp-host-list-file-reads.ts
  • src/main/mcp-servers/mcp-host-list.ts
  • src/main/runtime/rpc/methods/mcp-servers-import.ts
  • src/renderer/src/components/settings/mcp-servers/McpServerRows.fixture.tsx
  • src/renderer/src/components/settings/mcp-servers/McpServerRows.tsx
  • src/renderer/src/components/settings/mcp-servers/McpServersPane.tsx
  • src/shared/mcp-servers/mcp-servers.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 2 remain after this review.

@AmoabaKelvin
AmoabaKelvin merged commit b239c2b into main Nov 25, 2026
58 of 59 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant