You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(mcp): give every native chat the host's MCP servers, with an Orca group in /mcp - #48707
When you add an MCP server once in Orca, every new chat on that computer can use it, unless you turn it off for that agent or that project. The chat's /mcp list shows those servers under "Orca", with a link to where you manage them. All of it is behind the MCP servers switch, which is still off.
Files
Added
Deleted
Net
Test
5
$\color{#1a7f37}{\Huge{\mathbf{+}}}$243
$\color{#cf222e}{\Huge{\mathbf{−}}}$32
$\color{#1a7f37}{\Huge{\mathbf{+}}}$211
Prod
60
$\color{#1a7f37}{\Huge{\mathbf{+}}}$947
$\color{#cf222e}{\Huge{\mathbf{−}}}$257
$\color{#1a7f37}{\Huge{\mathbf{+}}}$690
What Changed
Before: only a bot's chats got MCP servers from Orca: its own tools, through Orca's local relay. Other chats got only what each agent's own config set up.
Filtering: a server is left out when it's off for that agent, or when the chat's workspace (its repo, or a folder workspace) isn't one it's on for.
Name clashes: a server is also left out when the agent's own config already has one with that name. The agent's own server runs instead. For Claude that means the launch account's user and folder-local servers plus the folder's .mcp.json. Other agents are checked against their user and project files, read with the readers from feat(mcp): read and move MCP servers from agents' own config files #48632. Codex also checks the account home's config.toml.
Relay: servers with saved headers or an Orca sign-in go through the relay. Every non-bot session shares one host token per Orca run, in a new ORCA_MCP_TOKEN; the bot identity variable is unchanged. Relay grants now name an owner (a bot or the host) and the folders the token may reach. Bot tools stay under /bot-tools/… and host-list servers are under /mcp-servers/…. The host's shared token is bound only by the computer-wide call limits, not the per-bot ones.
Token exposure: Claude and Pi configs name ${ORCA_MCP_TOKEN}, so only they get the token in env. Codex and ACP carry it in their MCP config, so their shell commands never see it.
Bots: a bot takes the host list only when the user opts it in. bots.tools.list answers hostMcpServers, and a new bots.tools.setHostMcpServers sets it. The bot's own tool wins a name clash. Changing the setting bumps the bot's tools epoch, so its running chats relaunch on their next turn.
Tray (desktop and phone): Claude and Codex rows for servers a chat got from the host list are tagged orca and grouped first as ORCA. A "Manage MCP servers" link opens the host's settings: pane mcp-servers on desktop, /h/<hostId>/mcp on the phone. It shows only when the host advertises mcp-servers.v1. The desktop list grows from 208 to 320 px so ORCA, PROJECT and CLAUDE.AI fit. The phone list's share of the screen goes from 0.4 to 0.5.
Blocked Claude:mcpServers.list gains agentProblems. Claude is marked blocked when its organization's managed settings refuse --mcp-config, which shows up as a cached flag refusal, a CLI exit with that refusal, or a failed tools check. Such a chat starts without the host's servers and gets no "your tools are off" note, since that note is meant for bots.
BotLaunchTools is renamed SessionMcpTools. The per-agent emitters are unchanged.
Why
This is PR 3 of the MCP-servers-in-Orca plan: the host list does nothing until sessions get it. The change widens the seam bots already use (resolveSessionToolServers → basis.toolServers()) to every session instead of building a second delivery path. It reuses the relay, the saved-credential store and the emitters.
Linked Issue
N/A, part of the MCP servers fleet (stacked work after #48631 and #48632).
Visual Proof
Before: today's tray has no Orca group or footer link. The mock is next to the built result, using the same fixture data (desktop: component fixture; phone: MobileNativeChatMcpPanel rendered through the web bundle).
Mock
Built
Desktop dark
Desktop light
Phone dark
Phone light
Testing
I ran a hidden serve built from this branch on macOS, on a scratch profile. Claude ran with no spend: the real CLI (2.1.332) against a fake Anthropic API. A fake MCP server only answered when it saw the x-api-key header.
Switch on: I added a server with a saved x-api-key header and a command server, then opened a Claude chat in a repo. agentSession.mcp listed probe as connected, 1 tool, source: "orca". The upstream server received x-api-key: s3cret from the relay. Claude's argv carried only "authorization":"Bearer ${ORCA_MCP_TOKEN}", and its env had ORCA_MCP_TOKEN, not the bot token.
Turned off: I turned probe off for Claude and the command server off for that repo. The next chat listed neither.
Switch off: I restarted the serve without the switch. With the same list still on disk, a new chat's Claude process had no --mcp-config and no ORCA_MCP_TOKEN, and mcpServers.list refused with mcp_servers_off.
Automated tests:
session-mcp-launch.test.ts:
With the switch off, nothing is added, even for an opted-in bot.
With it on, servers are filtered by agent and workspace, relayed servers use /mcp-servers/ and ORCA_MCP_TOKEN, and the bot's own server wins a clash.
A hostMcpServers key the bot writes into its own tools file grants nothing.
bot-tool-relay.test.ts: a token reaches only the folders its grant names, and the host token names no bot.
Not run: Windows, Linux, SSH, and live Codex, ACP or Pi chats. Those launch paths pass typecheck and run through the same resolver.
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 while the switch is off: the resolver returns before reading anything. With it on, each chat launch reads the host list file once. When the list gives the chat at least one server, the launch also reads the agent's own MCP config files (user and project) to check for name clashes. Nothing runs per turn or per keystroke.
Risk
Level: Medium
Switch off: with ORCA_MCP_SERVERS unset, launches are unchanged. Bot launches still grant {bot folder} with ORCA_BOT_TOOLS_TOKEN and /bot-tools/ URLs. Non-bot launches get nothing, the host advertises no mcp-servers.v1, and the tray shows no link.
Bot self-grant (found in review, fixed here): the approved design kept the bot opt-in as a key in the bot's own .orca/bot-tools.json. That file sits in the bot's home, which its agent writes every turn. A bot, or a prompt injection reaching it, could have turned it on itself and reached every host server, including the user's Orca sign-ins through the relay. A bot's own tools can't reach those, because its credentials are sealed per folder.
The opt-in is now a hostMcpServers field on the bot record.
Only bots.tools.setHostMcpServers sets it. That method refuses calls from the bot's own chat and runs, and from Look around.
bots.update can't set it (its params are strict and don't list it), and it isn't written to or read back from the bot's bot.json.
Launches and Orca's own tool checks read the record, never the tools file.
Relay: the relay grant now carries a set of folders instead of one. A bot's health check or sign-in re-grants with its current opt-in, so it doesn't cut off host servers in that bot's running chats.
Known gaps (follow-ups):
The "Manage MCP servers" link points at the Settings pane and phone route that the desktop-ui and mobile-ui PRs add. The switch stays off until they land.
Name clashes coming only from Codex -c overrides in the user's own command settings aren't detected.
Host-list changes apply to new sessions. The running-session restart offer comes in the terminal-delivery PR.
Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.
Notes
Security: the relay checks a token's path scope; non-bot sessions never get the bot identity variable; secrets never go on argv.
Cross-platform: paths go through resolve/join. Windows cmd /c shims for stdio servers are unchanged (claudeServerConfig).
Remote: launches resolve on the execution host, which reads its own list.
Mobile: the phone tray gets the group and link, gated on the routed host's capability.
Backwards compatibility: older hosts lack mcp-servers.v1, so the link stays hidden. New fields are optional.
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)
…a group in /mcp
Chats get the host's MCP server list at launch, filtered by agent and
workspace and skipping names the agent's own config already uses. Servers
with saved values go through the relay under one host token in
ORCA_MCP_TOKEN. Bots keep their own tools and take the host list only when
the user opts them in on the bot's record. Behind ORCA_MCP_SERVERS: with
the switch off, launches are unchanged.
No actionable comments were generated in the recent review.
Walkthrough
The changes add host MCP server selection for sessions, including bot opt-in and workspace filtering. Session tool construction supports host and bot relay folders. ACP, Claude, Codex, and Pi launch paths use the selected servers. RPC methods expose bot host-server settings and Claude configuration status. Desktop and mobile MCP trays link to host MCP settings, and Orca servers receive updated labels and grouping.
Merge Risk: Low · up to ad580 · assessed changes only
Path filters excluded changed files. This rating applies only to the assessed changes.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the main change: giving every native chat the host's MCP server list, plus an Orca group in the /mcp tray. The changeset adds host-list delivery for Claude, Codex, ACP and Pi sessions,…
Description check
The description follows the template sections: ELI5, What Changed, Why, Linked Issue, Visual Proof, Testing, Performance, Risk, AI Disclosure, Review, Agent skill upstream boundary, Notes, and Checkli…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title names the main change: giving every native chat the host's MCP server list, plus an Orca group in the /mcp tray. The changeset adds host-list delivery for Claude, Codex, ACP and Pi sessions, the Orca tray group, and the bot opt-in. The title is specific and matches the primary change.
Full details: Description check
Explanation
The description follows the template sections: ELI5, What Changed, Why, Linked Issue, Visual Proof, Testing, Performance, Risk, AI Disclosure, Review, Agent skill upstream boundary, Notes, and Checklist. It explains the before/after behavior, the mechanism, the risk and back-out plan, and the performance impact. The Linked Issue section says N/A and gives a reason, and the AI Disclosure and Review sections are empty. The template asks for a linked issue for outside contributors. The author appears to be a maintainer, so the empty AI Disclosure section is allowed. Some checklist items remain unchecked, including lint, typecheck, test and build, and the small-PR item. Those are reviewer concerns, not template gaps.
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.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 3 remain after this review.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.
The reason will be displayed to describe this comment to others. Learn more.
Minor · Functional Correctness · Quick win
Include names from .mcp.json files in parent directories when filtering host servers.
claudeOwnServerNames reads only join(cwd, '.mcp.json'). Claude Code also loads project .mcp.json files from parent directories of the working directory. A host server whose name matches an ancestor server passes this filter and is delivered. The filter is meant to omit it.
Collect mcpServers keys from .mcp.json in cwd and in each ancestor directory, then merge them into the returned names. Use the same read helper for each file. The ancestor walk should match Claude Code's discovery rule, which reads parent directories up to the filesystem root.
The reason will be displayed to describe this comment to others. Learn more.
Minor · Functional Correctness · Quick win
Read the same Codex home in the host-name lookup that the spawn uses.
The lookup at line 187 receives environment before the selected account home is applied. The spawn at line 239 applies that home as CODEX_HOME. When the selected account home differs from the home the lookup reads, the lookup can read a different config.toml from the one Codex loads. A host server can then be removed because another account defines the same name. A host server can also be kept when the selected account already defines that name, and Codex then merges the two entries.
The lookup must read the Codex home that the spawn uses. Derive the lookup environment from the selected account home, not from the pre-patch environment, so both reads resolve the same home.
The reason will be displayed to describe this comment to others. Learn more.
Minor · Data Integrity & Integration · Quick win
Resolve the agent's user config from the launch HOME, not the host home.
agentOwnMcpServerNames passes homeDir: homedir() with the launch env. The resolvers in agent-mcp-config-locations.ts build user-file paths from homeDir unless a specific variable such as CODEX_HOME or XDG_CONFIG_HOME overrides them. A launch that sets HOME to another directory makes the helper read the host user's config. Name collisions and omitted servers are then computed from the wrong files.
The inspected launch paths set CODEX_HOME and the XDG variables, not HOME. This case does not occur on those paths today. The defect still exists in the helper: its homeDir does not match the environment it receives. Derive the home directory from env.HOME when present, and fall back to homedir() only when it is not set.
The reason will be displayed to describe this comment to others. Learn more.
Minor · Functional Correctness · Quick win
Disable the switch explicitly in the switch-off test.
If the test process starts with ORCA_MCP_SERVERS=1, this test launches with host servers enabled and fails its empty-server assertions. afterEach clears the variable only after the test finishes.
Clear the variable before this test launches. Keep the next test's explicit assignment to '1'.
The reason will be displayed to describe this comment to others. Learn more.
Minor · Functional Correctness · Quick win
The MCP management link selects a settings section that no page renders.
openMcpServersSettings targets pane mcp-servers. The settings page resolves that pane to the section id mcp-servers. No section in this tree uses that id, so the link cannot open a rendered MCP servers page. The serverId argument also does not affect the resolved section for this pane.
Hide the Manage MCP servers link until the MCP servers section is registered. Alternatively, register that section in this change. Either choice makes the link match the rendered settings pages.
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: 09944d2f-f69b-402d-8fbf-56e07c8cb33d
Commits
Reviewing files that changed from the base of the PR and between aeca235 and 528bca8.
Files ignored due to path filters: 1
src/shared/rpc-contract/rpc-params-catalog.generated.ts is excluded by !**/*.generated.*
Files selected for processing: 7
config/main-blocking-helper-baseline.txt
src/main/mcp-servers/mcp-host-list.ts
src/main/mcp-servers/mcp-plugin-server-sync.ts
src/main/runtime/rpc/methods/mcp-servers.ts
src/renderer/src/i18n/locales/en.json
src/shared/bot-types.ts
src/shared/mcp-servers/mcp-servers.ts
Files skipped from review as they are similar to previous changes: 2
config/main-blocking-helper-baseline.txt
src/renderer/src/i18n/locales/en.json
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 3 remain after this review.
The reason will be displayed to describe this comment to others. Learn more.
Minor · Functional Correctness · Quick win
mcpServersForLaunch documents a read-only launch, but its read can write legacy headers.
mcpServersForLaunch says a launch never writes the host list. It calls readBotToolsSnapshot, though, and that call runs readMigratedSnapshot. When any server still stores headers inline, readMigratedSnapshot writes the file to move them into the credential store before it returns. A launch therefore writes for that input, contrary to the function's stated contract.
If that write fails, for example because the host folder is not writable, the error propagates out of mcpServersForLaunch. session-mcp-launch.ts catches it, logs a warning, and starts the session without host MCP servers. The chat still starts, but the host servers are missing for that session. This affects only lists that still contain inline headers.
Give the launch read a path that does not migrate or write, and keep the migration on the settings and write paths that already perform it. The migration should stay on the path that already performs it. Confirm that the launch read returns the same servers and filtering that mcpServersForLaunch uses.
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
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.
ELI5
When you add an MCP server once in Orca, every new chat on that computer can use it, unless you turn it off for that agent or that project. The chat's
/mcplist shows those servers under "Orca", with a link to where you manage them. All of it is behind the MCP servers switch, which is still off.What Changed
ORCA_MCP_SERVERS=1: every Claude, Codex, ACP and Pi chat also gets the host's server list (from feat(mcp): per-host MCP server list with the mcpServers RPC, behind ORCA_MCP_SERVERS #48631) at launch..mcp.json. Other agents are checked against their user and project files, read with the readers from feat(mcp): read and move MCP servers from agents' own config files #48632. Codex also checks the account home'sconfig.toml.ORCA_MCP_TOKEN; the bot identity variable is unchanged. Relay grants now name an owner (a bot or the host) and the folders the token may reach. Bot tools stay under/bot-tools/…and host-list servers are under/mcp-servers/…. The host's shared token is bound only by the computer-wide call limits, not the per-bot ones.${ORCA_MCP_TOKEN}, so only they get the token in env. Codex and ACP carry it in their MCP config, so their shell commands never see it.bots.tools.listanswershostMcpServers, and a newbots.tools.setHostMcpServerssets it. The bot's own tool wins a name clash. Changing the setting bumps the bot's tools epoch, so its running chats relaunch on their next turn.orcaand grouped first as ORCA. A "Manage MCP servers" link opens the host's settings: panemcp-serverson desktop,/h/<hostId>/mcpon the phone. It shows only when the host advertisesmcp-servers.v1. The desktop list grows from 208 to 320 px so ORCA, PROJECT and CLAUDE.AI fit. The phone list's share of the screen goes from 0.4 to 0.5.mcpServers.listgainsagentProblems. Claude is markedblockedwhen its organization's managed settings refuse--mcp-config, which shows up as a cached flag refusal, a CLI exit with that refusal, or a failed tools check. Such a chat starts without the host's servers and gets no "your tools are off" note, since that note is meant for bots.BotLaunchToolsis renamedSessionMcpTools. The per-agent emitters are unchanged.Why
This is PR 3 of the MCP-servers-in-Orca plan: the host list does nothing until sessions get it. The change widens the seam bots already use (
resolveSessionToolServers→basis.toolServers()) to every session instead of building a second delivery path. It reuses the relay, the saved-credential store and the emitters.Linked Issue
N/A, part of the MCP servers fleet (stacked work after #48631 and #48632).
Visual Proof
Before: today's tray has no Orca group or footer link. The mock is next to the built result, using the same fixture data (desktop: component fixture; phone:
MobileNativeChatMcpPanelrendered through the web bundle).Testing
I ran a hidden serve built from this branch on macOS, on a scratch profile. Claude ran with no spend: the real CLI (2.1.332) against a fake Anthropic API. A fake MCP server only answered when it saw the
x-api-keyheader.Switch on: I added a server with a saved
x-api-keyheader and a command server, then opened a Claude chat in a repo.agentSession.mcplistedprobeasconnected, 1 tool,source: "orca". The upstream server receivedx-api-key: s3cretfrom the relay. Claude's argv carried only"authorization":"Bearer ${ORCA_MCP_TOKEN}", and its env hadORCA_MCP_TOKEN, not the bot token.Turned off: I turned
probeoff for Claude and the command server off for that repo. The next chat listed neither.Switch off: I restarted the serve without the switch. With the same list still on disk, a new chat's Claude process had no
--mcp-configand noORCA_MCP_TOKEN, andmcpServers.listrefused withmcp_servers_off.Automated tests:
session-mcp-launch.test.ts:/mcp-servers/andORCA_MCP_TOKEN, and the bot's own server wins a clash.hostMcpServerskey the bot writes into its own tools file grants nothing.bot-tool-relay.test.ts: a token reaches only the folders its grant names, and the host token names no bot.Not run: Windows, Linux, SSH, and live Codex, ACP or Pi chats. Those launch paths pass typecheck and run through the same resolver.
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 while the switch is off: the resolver returns before reading anything. With it on, each chat launch reads the host list file once. When the list gives the chat at least one server, the launch also reads the agent's own MCP config files (user and project) to check for name clashes. Nothing runs per turn or per keystroke.
Risk
Level: Medium
ORCA_MCP_SERVERSunset, launches are unchanged. Bot launches still grant{bot folder}withORCA_BOT_TOOLS_TOKENand/bot-tools/URLs. Non-bot launches get nothing, the host advertises nomcp-servers.v1, and the tray shows no link..orca/bot-tools.json. That file sits in the bot's home, which its agent writes every turn. A bot, or a prompt injection reaching it, could have turned it on itself and reached every host server, including the user's Orca sign-ins through the relay. A bot's own tools can't reach those, because its credentials are sealed per folder.hostMcpServersfield on the bot record.bots.tools.setHostMcpServerssets it. That method refuses calls from the bot's own chat and runs, and from Look around.bots.updatecan't set it (its params are strict and don't list it), and it isn't written to or read back from the bot'sbot.json.-coverrides in the user's own command settings aren't detected.AI Disclosure
Review
Agent skill upstream boundary
Notes
resolve/join. Windowscmd /cshims for stdio servers are unchanged (claudeServerConfig).mcp-servers.v1, so the link stays hidden. New fields are optional.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)