Skip to content

feat(mcp): list a chat's MCP servers in the /mcp tray before its first message - #50908

Merged
AmoabaKelvin merged 8 commits into
mainfrom
mcp-tray-at-rest
Nov 27, 2026
Merged

AmoabaKelvin merged 8 commits into
mainfrom
mcp-tray-at-rest

Conversation

@AmoabaKelvin

@AmoabaKelvin AmoabaKelvin commented Nov 27, 2026 •

Copy link
Copy Markdown
Collaborator

ELI5

Open /mcp in a new chat and you now see the MCP servers it will get, before you send anything. Until now the tray only said "Connect when you send your next message" and listed nothing.

Based on #50062 by @hishikit.

Files Added Deleted Net
Test 0 0 0 0
Prod 35 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​468 $\color{#cf222e}{\Huge{\mathbf{−}}}$​76 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​392

What Changed

  • Before the first message, the /mcp tray lists the chat's servers under the "Connect when you send your next message" line:
    • Orca rows come from the same resolver delivery uses, for that agent and workspace. Plugin servers are included. Names the agent's own config already has are skipped, as delivery skips them. A server Orca signs in to that is signed out shows "Needs sign-in". The group is hidden when Claude's org settings block Orca's servers or the agent ignores a session's servers.
    • The agent's own rows (User, Local, Project) come from the agent-config readers, on the account folder the next turn launches on. Disabled servers show as disabled, including Claude's per-folder /mcp disable list.
  • Claude: the host now answers not-running with an optional servers list. Older clients ignore it and keep the hint.
  • Codex: at rest it already lists its own servers through a short-lived app-server. The Orca rows that list was missing are now added.
  • ACP agents and Pi: these have no /mcp of their own. With MCP servers on, the host now offers /mcp for every agent.
    • At rest they list as above.
    • While running, they list what Orca delivered at launch plus their own servers, with a new neutral row status unreported. Under the header (which keeps its sign-in counts) a line says " doesn't report connection status", on desktop and phone.
  • After the first message, Claude and Codex rows switch to live status as before, because the tray already re-reads when the agent starts.
  • A disabled server reads "Disabled" on both desktop and phone (the phone used to say "Off"; it now reuses the desktop's translations).
  • Beside an Orca group, the agent's unlabeled servers get the agent's name as a heading (CODEX), so they don't read as Orca's.
  • Keeps Show configured project MCP servers before the first Claude chat message #50062's renderer fix: the tray waits for the host to create the chat (!transport.sessionPending) instead of asking too early and showing "Update Orca".

Why

Orca already knows before launch which servers a chat will get, and its readers know the agent's own. Building the list on the host means desktop, phone and remote hosts all get it from one place. #50062 added a third .mcp.json reader for Claude only; this reuses the launch resolver and the existing readers instead.

Linked Issue

Part of the MCP servers in Orca work. Supersedes #50062.

Visual Proof

Approved mock (live tray) vs this PR before the first message. Desktop shots are from a hidden dev build with ORCA_MCP_SERVERS=1: three host-list servers (two need sign-in, one command), a scratch repo with .mcp.json and opencode.json. Phone shots render the real phone tray component in a phone-width web harness with the same rows the host returned.

Desktop

Dark Light
Mock (d14) mock-desktop-dark mock-desktop-light
Before: Claude at rest before-dark before-light
After: Claude at rest claude-rest-dark claude-rest-light
After: Codex at rest codex-rest-dark codex-rest-light
After: OpenCode (ACP) at rest opencode-rest-dark opencode-rest-light
After: OpenCode (ACP) running opencode-run-dark opencode-run-light

Phone

Dark Light
Mock mock-phone-dark mock-phone-light
Claude at rest phone-claude-dark phone-claude-light
Codex at rest phone-codex-dark phone-codex-light
OpenCode at rest phone-opencodeRest-dark phone-opencodeRest-light
OpenCode running phone-opencodeRun-dark phone-opencodeRun-light

Testing

  • macOS, hidden dev build with ORCA_MCP_SERVERS=1:

    • Fresh Claude, Codex and OpenCode chats list Orca rows plus their own before the first message.
    • After one message, Claude's tray switched to live status in place (Orca rows reported by Claude).
    • A running OpenCode chat lists its delivered and own rows as unreported.
    • A "enabled": false OpenCode entry shows Disabled.
  • Switch off, so gate-off equals main: same profile relaunched without ORCA_MCP_SERVERS.

    • A fresh Claude chat's tray shows only "Connect when you send your next message".
    • OpenCode offers no /mcp.
    • In code, the handler returns before any new work unless isMcpServersFeatureEnabled() (knows), and mcpServers is added to the agents list only with the switch on. Orca-source rows, unreported and not-running.servers only come from a host with the switch on.
  • pnpm check:changed passes. The existing agent-own-mcp-server-names test covers the refactored config read.

  • 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

No test added: this is UI and RPC wiring, proven live above. The config-read refactor keeps delivery's names identical and is covered by the existing test.

Performance

Only with ORCA_MCP_SERVERS=1, and only when a tray asks while the agent can't list its servers. That means on open, on /mcp, and when the agent starts or stops, never on a timer.

  • Each read does one host-list read, one config read per agent file location, and sign-ins only for the rows shown.
  • Claude's user file is read only for this folder's block, which also trims the existing launch-time name read.
  • A running Claude or Codex answer returns before any of this.
  • One credential-store read is baselined, as mcpServers.list is.

Risk

Level: Low. Everything new sits behind ORCA_MCP_SERVERS, and only mcp-turn-on (#48972, held) turns it on.

  • Riskiest part: an older desktop or phone talking to a new host with the switch on. It ignores servers and keeps the hint. An unreported row shows as a name with no status. Nothing breaks.
  • The read path never writes agent files.
  • Bot chats keep main's behaviour.
  • Back out with a plain revert.

AI Disclosure

Review

  • src/main/mcp-servers/session-mcp-at-rest.ts is the new decision.
  • structured-agent-session-mcp.ts is the gate.
  • Follow-ups are listed under Notes.

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

  • Host-side, so remote hosts and phones get the same list.
  • No new paths, processes or shell code.
  • Follow-ups, not in this PR:
    • OMP's own servers aren't listed yet: its reader needs the launch-time version probe.
    • The at-rest config read uses the host env plus Claude's account folder, not each agent's settings env overlay or ACP account home.

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)

@coderabbitai

coderabbitai Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Structured-session MCP responses can include known server rows when an agent cannot provide a complete list. The result protocol and panel state support not-running server lists and unreported connection status. The MCP feature flag affects registered-agent capabilities and whether known-server augmentation applies. Desktop and mobile trays display these results with agent-specific status messages and source labels. Status text and translations were updated for disabled, unreported, and sign-in-required servers.

Merge Risk: Low · up to 559aa

The /mcp tray can occasionally hide a configured server or show the wrong status for a disabled Orca bridge. These are small display issues and do not block merging, but owners should follow up.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: the /mcp tray now lists a chat's MCP servers before its first message. The changeset adds host-side server listing (session-mcp-at-rest, agent-config readers, mobile a…
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 repository template and covers the ELI5, What Changed, Why, Visual Proof, Testing, Performance, Risk, Review, Notes, and Checklist sections. It explains the feature (listin…
Full details: Title check

Explanation

The title names the main change: the /mcp tray now lists a chat's MCP servers before its first message. The changeset adds host-side server listing (session-mcp-at-rest, agent-config readers, mobile and desktop tray rendering) that matches this. The title uses the conventional feat(mcp) prefix and stays concise.

Full details: Description check

Explanation

The description follows the repository template and covers the ELI5, What Changed, Why, Visual Proof, Testing, Performance, Risk, Review, Notes, and Checklist sections. It explains the feature (listing a chat's MCP servers in the /mcp tray before the first message), the mechanism (host-side resolver and agent-config readers), the gating behind ORCA_MCP_SERVERS, and the backout path (plain revert). Visual proof is provided with before/after images for desktop and phone. The Linked Issue section says the work is part of the MCP servers effort and supersedes #50062 but does not contain a 'Fixes #' issue link, which the template says should always exist for outside contributors. The AI Disclosure section is empty. The Level field is filled in as Low. The Performance section is complete. Minor gaps: no issue is linked, and the AI Disclosure section is blank, though the template says it can be skipped for internal team members.

  • 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

Recent 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: a54ef30c-7664-4bbe-857e-cd995dfa164f
Commits

Reviewing files that changed from the base of the PR and between 8b26441 and 559aa7b.

Files selected for processing: 13

  • mobile/src/i18n/locales/de.json
  • mobile/src/i18n/locales/en.json
  • mobile/src/i18n/locales/es.json
  • mobile/src/i18n/locales/fr.json
  • mobile/src/i18n/locales/ja.json
  • mobile/src/i18n/locales/ko.json
  • mobile/src/i18n/locales/pt.json
  • mobile/src/i18n/locales/ru.json
  • mobile/src/i18n/locales/tr.json
  • mobile/src/i18n/locales/zh-Hant.json
  • mobile/src/i18n/locales/zh.json
  • mobile/src/session/native-chat/mcp/mobile-native-chat-mcp-server-copy.ts
  • src/renderer/src/components/native-chat/mcp/NativeChatMcpTray.tsx
Files skipped from review as they are similar to previous changes: 1

  • mobile/src/i18n/locales/en.json

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

@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: 2

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: 4945d418-d755-43ef-8093-4109adea062f
Commits

Reviewing files that changed from the base of the PR and between 14c6146 and 8b26441.

Files selected for processing: 25

  • config/main-blocking-helper-baseline.txt
  • mobile/src/i18n/locales/en.json
  • mobile/src/session/native-chat/mcp/MobileNativeChatMcpPanel.tsx
  • mobile/src/session/native-chat/mcp/MobileNativeChatMcpTray.tsx
  • mobile/src/session/native-chat/mcp/mobile-native-chat-mcp-server-copy.ts
  • mobile/src/session/native-chat/mcp/use-mobile-structured-mcp-panel.ts
  • src/main/mcp-servers/agent-configs/agent-mcp-config-read.ts
  • src/main/mcp-servers/agent-own-mcp-server-names.ts
  • src/main/mcp-servers/mcp-agent-problems.ts
  • src/main/mcp-servers/session-mcp-at-rest.ts
  • src/main/native-chat/agent-session-wire/host/structured-agent-session-conversation-reads.ts
  • src/main/native-chat/agent-session-wire/host/structured-agent-session-host.ts
  • src/main/runtime/rpc/methods/structured-sessions/catalog/structured-agent-session-agents.ts
  • src/main/runtime/rpc/methods/structured-sessions/catalog/structured-agent-session-mcp.ts
  • src/renderer/src/components/native-chat/composer/submit/native-chat-structured-composer-transport.ts
  • src/renderer/src/components/native-chat/composer/submit/use-native-chat-structured-composer-transport.ts
  • src/renderer/src/components/native-chat/mcp/NativeChatMcpServerRow.tsx
  • src/renderer/src/components/native-chat/mcp/NativeChatMcpTray.fixture.tsx
  • src/renderer/src/components/native-chat/mcp/NativeChatMcpTray.tsx
  • src/renderer/src/components/native-chat/mcp/native-chat-mcp-server-text.ts
  • src/renderer/src/components/native-chat/pane/actions/NativeChatStructuredComposerTabStrips.tsx
  • src/renderer/src/i18n/locales/en.json
  • src/shared/agent-session/options/protocol/agent-session-mcp.ts
  • src/shared/agent-session/view/use-agent-session-mcp-panel.ts
  • src/shared/mcp/agent-mcp-config-entry.ts

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

if (!inFolder(source) || !isOrcaOwnedAgentMcpServer(server)) {
continue
}
orcaOwned.add(configName)

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.

Minor · Functional Correctness · Quick win

Track Orca ownership per scoped entry.

If a user entry and a project entry share a name, and only one is an Orca bridge, this set marks both entries as Orca-owned. knownRows then excludes the non-bridge entry too. The configured server disappears from the tray.

Use the same scope/projectPath/name identity that knownRows uses, or attach ownership to each entry. Keep the name-only collections for delivery deduplication.

// One row per file entry, Orca's own bridges left out (they show under Orca).
const own = new Map<string, AgentSessionMcpServer>()
for (const entry of config.entries) {
if (!config.orcaOwned.has(entry.name)) {

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.

Minor · Functional Correctness · Quick win

Preserve disabled state for Orca bridge rows.

If an Orca bridge entry has enabled: false or disabled: true, agentOwnMcpConfig still records its host name in bridged. This branch excludes the entry before checking entry.disabled. For a non-OAuth host server, orcaRows then displays not-started or unreported instead of disabled.

Carry the bridge's disabled state into its Orca row. Keep its name reserved so delivery does not add a duplicate server.

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