Skip to content

feat(mobile): manage a host's MCP servers from the phone - #48776

Merged
AmoabaKelvin merged 3 commits into
mainfrom
mcp-mobile-ui
Nov 25, 2026
Merged

AmoabaKelvin merged 3 commits into
mainfrom
mcp-mobile-ui

Conversation

@AmoabaKelvin

@AmoabaKelvin AmoabaKelvin commented Nov 25, 2026 •

Copy link
Copy Markdown
Collaborator

ELI5

The phone can now see and change the MCP servers a computer gives its agents: turn a server on or off per agent, limit it to some workspaces, sign in to it, add one from a list or by pasting, move servers set up inside an agent into Orca's list, and let a bot use them.

Files Added Deleted Net
Test 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​26 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​26
Prod 37 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​3060 $\color{#cf222e}{\Huge{\mathbf{−}}}$​96 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​2964

What Changed

  • Host ⋯ menu gets an MCP servers entry after Accounts. It opens a new page route, /h/[hostId]/mcp, drawn from the host's page like Accounts.
  • The list has three groups. Yours has an inline Sign in on servers that need one, and Add a server. From plugins is read-only. In your agents has ⋯ with Move to Orca or Copy to Orca, and Move asks first.
  • A server's page: Account (or the command, address and secret names for a server Orca doesn't sign in to), Workspaces, a switch per installed agent with Turn all on, Share one process (command servers only) and Remove server. ⋯ has Sign in again and Sign out. An agent-wide problem (an org policy, an outdated CLI) shows under the agent in the host's words.
  • Workspaces picker: All workspaces, or only the ticked repos and folder workspaces. Taps made before the host answers are kept and sent in order.
  • Add sheet: Custom server on top, then the shared app catalog (src/shared/mcp-servers/mcp-server-catalog.ts, the same file the desktop PR ships) with the bottom search bar and the category filter. GitHub opens Custom server with its Authorization header, and Add waits for the token.
  • Custom server takes a URL, a start command, an mcpServers block or claude/codex mcp add lines. The host reads it: a new mcpServers.previewPaste {source} returns the servers it names (under the names Add would keep) for the Details rows, and mcpServers.add {source} now adds every server a paste names and also returns them as servers. The phone ships no parser. A plain URL can carry headers, sent as a config.
  • Bot Settings › Tools gets a first row, Your MCP servers, with a switch (bots.tools.setHostMcpServers) and the host's servers named under it. It shows only when the bot's tools read carries hostMcpServers, which the host sends only while its switch is on.
  • Sign in reuses the bots' paste-back page. use-bot-tool-phone-sign-in now takes the host's sign-in calls as pluggable "owned" ops, so bot tools behave exactly as before. Pasting the address ticks the first two steps.
  • Turning a server on for Grok, Cursor or Droid asks once per agent before Orca writes that agent's file (mcpServers.agentFiles.allow).
  • After a change, a toast says "Applies to new sessions", with "Restart N sessions" once the host reports terminals still on the old list. Today's hosts answer mcp_servers_not_yet, so the action stays hidden.
  • TransientToast takes an optional action. Existing callers are unchanged.

Why

MCP servers are per host. The design puts them on the host's ⋯ menu as a full page, like Accounts, and copies the bots' Tools, Add connector and sign-in screens so the phone gains no new patterns. The paste parser stays on the host because it would cost the phone's page bundle most of its remaining room. The list re-reads on focus and after every change as well as on mcpServersChanged, because a host relayed through the Mac doesn't pass that notice on.

Linked Issue

Visual Proof

Each image is the approved mock on the left and the real component on the right. The real ones come from the page bundle rendered in Chromium at 393 pt with a fake host answering the mocks' fixture data.

Figure Dark (mock, real) Light (mock, real)
Host ⋯ menu
List
Server (HTTP, signed in)
Server ⋯
Needs sign-in, agent problems
Command server
Command server, Advanced
Workspaces
File-agent confirm
Toast with Restart
Add
Add › Filter
Custom server
Sign in (before)
Sign in (pasted)
In your agents ⋯
Move confirm
Bot Settings › Tools

Differences from the mocks: Account says "Signed in", since MCP OAuth gives no account to show. The toast reads "Applies to new sessions". Confirms use the phone's bottom-sheet ConfirmModal. Agents follow the phone's agent order, and only agents Orca launches and finds installed show. Orca has no Gemini CLI agent (TuiAgent has no gemini, and saved Gemini CLI bots load as Antigravity), so it can't appear there, though discovered servers still name Gemini CLI. The command page has no ⋯ because it has nothing to offer.

Testing

  • 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

  • Every screen above, in dark and light, in the page harness. Also worst-case data (64-character names, long URLs and commands, a long host name, 320 pt width, many workspaces) and the empty list. Fixed what broke: long Workspaces values now count ("All but 3"), the Advanced title wraps, and agent problems take at most two lines.

  • Rapid workspace taps against a host that answers after 600 ms: both ticks stick.

  • Host paste methods, checked with a throwaway test against the real handlers and the real parser (host list mocked, not committed): previewPaste on an mcpServers block with linear taken names github and linear-2; add adds both with the paste's names (nameGiven: false) and returns server plus servers; add {source: url, name} keeps the given name; broken JSON is refused.

  • mcp-server-words.test.ts pins the workspace encoding the phone writes (from All, a tick means only that one; otherwise the choice for later workspaces stays). Bot tools page tests still pass.

  • pnpm check:changed, mobile typecheck, build:mobile-web with its verify. No asset in the page bundle contains the paste parser or jsonc-parser.

  • Gate off equals main. The ⋯ entry and every read need mcp-servers.v1, which a host lists only while ORCA_MCP_SERVERS is on (dark-switch-runtime-capabilities.ts). Without it, the menu has no entry, and a deep link to the route shows "MCP servers aren't on " and sends no mcpServers.* request. The bot Tools row needs hostMcpServers in the tools read, which the host sends only with the switch on. mcpServers.previewPaste and add refuse with mcp_servers_off like every method in the family. The bot sign-in hook, toast and step number keep their old behaviour for existing callers.

Performance

None on existing screens: everything new runs only while the MCP servers page (or the bot Tools page, for one mcpServers.list read) is open. The page bundle grows by 38 KB of eager bytes, all of it the new screens: 11,519,426 of the 11,534,336 fence against 11,481,304 on main. It adds 433 bytes before the first route. The chunk sweep table is re-measured for the new route. On the page, the list reads on open, on focus and after changes. Custom server asks the host for a preview once typing pauses (250 ms). The CLI health check (mcpServers.problems) runs once per open for servers Orca doesn't sign in to and is cancelled on leave, as the bots' Tools page does.

Risk

Low while the switch is off, since nothing new is reachable. With it on, the riskiest parts are the shared pieces. The bot tools sign-in hook now takes pluggable ops, and the bot path builds the same calls as before. mcpServers.add {source} now reads mcpServers blocks and mcp add lines and adds each server; a refused one leaves the earlier ones added. A plain revert backs it all out. Nothing is stored on the phone.

Level: Low

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

mcpServers.cancelProblems aborting a health check other clients joined is a host-side issue, tracked separately.

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 25, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Adds a mobile MCP server management screen with catalog browsing, custom server entry, server settings, workspace selection, and sign-in. Adds host-side paste preview and multi-server add support. Registers the MCP route for native and web, and adds a bot tools setting to enable or disable host MCP servers.

Merge Risk: Low · up to ac1cb · assessed changes only

Path filters excluded changed files. This rating applies only to the assessed changes.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title states the main change: the phone gains a page for managing a host's MCP servers. It names the feature and its scope, and it matches the changeset, which adds the host MCP servers page, list…
Description check Passed The description fills every template section with substance: ELI5, What Changed, Why, Visual Proof with before/after images, Testing, Performance, Risk, and Notes. Two gaps remain. The Linked Issue se…
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.
Full details: Title check

Explanation

The title states the main change: the phone gains a page for managing a host's MCP servers. It names the feature and its scope, and it matches the changeset, which adds the host MCP servers page, list, add sheet, custom server page, sign-in, and host RPC support.

Full details: Description check

Explanation

The description fills every template section with substance: ELI5, What Changed, Why, Visual Proof with before/after images, Testing, Performance, Risk, and Notes. Two gaps remain. The Linked Issue section is empty, and the template requires an issue link ('Fixes #' is unfilled). The AI Disclosure and Review sections are also empty, although the template lets internal contributors skip the disclosure. The Level in Risk is set to Low. The final checklist item for lint, typecheck, test, and build is unchecked, with a note that CI may cover it.

  • 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: 44894ecc-39ce-497c-b4a5-f937fcd85807
Commits

Reviewing files that changed from the base of the PR and between 6c609bf and ac1cb08.

Files selected for processing: 1

  • src/main/runtime/rpc/methods/mcp-servers.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 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: 6

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: e6276041-3432-4cd1-becb-5d10ae0e2b09
Commits

Reviewing files that changed from the base of the PR and between 46aae50 and 63b228d.

Files selected for processing: 29

  • config/scripts/build/mobile-web-app/mobile-web-page-routes.mjs
  • config/scripts/build/mobile-web-app/verify-mobile-web-app-bundle.mjs
  • config/scripts/localization/catalog-validation/localization-surfaces.mjs
  • mobile/app/h/[hostId]/mcp.tsx
  • mobile/app/h/[hostId]/mcp.web.tsx
  • mobile/src/bots/tools/MobileBotToolSignInPage.tsx
  • mobile/src/bots/tools/bot-tool-operations.ts
  • mobile/src/bots/tools/use-bot-tool-phone-sign-in.ts
  • mobile/src/components/feedback/TransientToast.tsx
  • mobile/src/components/feedback/transient-toast-styles.ts
  • mobile/src/host-screen/host-screen-header.tsx
  • mobile/src/i18n/locales/en.json
  • mobile/src/mcp-servers/McpPageFrame.tsx
  • mobile/src/mcp-servers/MobileMcpAddSheet.tsx
  • mobile/src/mcp-servers/MobileMcpCustomServerPage.tsx
  • mobile/src/mcp-servers/MobileMcpServerList.tsx
  • mobile/src/mcp-servers/MobileMcpServerPage.tsx
  • mobile/src/mcp-servers/MobileMcpServersScreen.tsx
  • mobile/src/mcp-servers/MobileMcpSignInSheet.tsx
  • mobile/src/mcp-servers/MobileMcpWorkspacesPage.tsx
  • mobile/src/mcp-servers/mcp-server-operations.ts
  • mobile/src/mcp-servers/mcp-server-row-parts.tsx
  • mobile/src/mcp-servers/mcp-server-words.test.ts
  • mobile/src/mcp-servers/mcp-server-words.ts
  • mobile/src/mcp-servers/use-mcp-server-actions.ts
  • mobile/src/mcp-servers/use-mcp-servers-data.ts
  • mobile/src/navigation/host-stack-screens.ts
  • mobile/web-entry/web-overrides.json
  • src/shared/mcp-servers/mcp-server-catalog.ts

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

Comment on lines +75 to +76
const onHost = (entry: McpServerCatalogEntry) =>
props.servers.find((server) => mcpCatalogEntryOf(server)?.id === entry.id)

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

Do not use a name-only match to identify an installed app.

mcpCatalogEntryOf accepts server.name === entry.id before it checks the address. If an unrelated command server is named github, this check marks GitHub as Added. Tapping GitHub opens that command server and never starts the catalog add.

Match the configured app for this existence check. If a different configuration owns the catalog name, allocate a free name for the new server. Keep opening the existing server when its configuration matches.

function useServerDetails(client: RpcClient | null, server: PhoneMcpServer): BotToolDetails | null {
const [details, setDetails] = useState<BotToolDetails | null>(null)
const signsIn = server.signIn !== undefined
useEffect(() => {

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

Invalidate details when the read inputs change.

If server.detail changes after a successful read, this effect retains the previous details. The page shows the old configuration while loading. If the request fails, the old configuration remains indefinitely.

Clear the stored details when starting another read, or associate each result with its request inputs and return only a matching result.

return (
<BottomDrawerModalHost>
<View style={styles.page}>
<OptionPager pager={pager} fill main={list} page={pager.page ? serverPage : null} />

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

Dismiss MCP controls when the capability disappears.

If the host removes mcp-servers.v1 while a server page is open, only the underlying list shows the unavailable state. This pager still shows the server page. Its online prop remains true, so its toggles can still send mcpServers.* requests through the actions hook.

When capable becomes false, dismiss the server/workspace pages and sheets, and prevent their mutation callbacks from sending requests.

onClose={() => setSigningIn(null)}
onSignedIn={(server) => {
setSigningIn(null)
data.reread()

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

Re-read the server list after sign-in completes, not by joining an in-flight read.

The sign-in completion callback calls data.reread(). That call uses cancelRefetch: false, so it joins a list read that is already in flight. The hook's own comments say such a read may have been sent before a change. If the sign-in completes while that read is pending, the cached list can keep "Needs sign-in" for the server after the "Signed in" toast appears. The row stays stale until the next focus refetch, host notice, or other change.

Use the same after-in-flight re-read that applyServer uses, such as refetchHostQueryAfterInFlight on the list query, for the sign-in completion path. Keep the joining reread for the focus and retry paths.

change(async (live) => {
let last: { server: PhoneMcpServer } | null = null
for (const agent of agents) {
last = mcpServerSetAgentEnabled.interpret(

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 · Data Integrity & Integration · Quick win

Reconcile completed agent changes when a batch fails partway.

enable sends one request per agent, in sequence. If a later request fails, run shows a toast and returns null. change then skips applyServer. The server cache keeps its pre-batch state, although the host already applied the earlier agent changes. Those agent toggles can show the wrong state until a list re-read runs. That re-read happens on a mcpServersChanged notice or when the screen regains focus. The data hook notes that a relayed host's notice may not reach the phone.

Make a failed batch reconcile its completed changes. Either apply the last successful response before reporting the failure, or re-read the list after any batch that fails after a successful request. The re-read option requires passing reread into useMcpServerActions, because the hook does not receive it today.

]
}, [repos.data, folders.data])

const problems = useMcpServerProblems(client, list.data?.servers ?? null)

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

Apply the capability gate to the problems check.

If the screen reopens with a cached server list after the host capability is disabled, this hook still receives the client and cached servers. Its effect sends mcpServers.problems even though enabled is false. Disabling a TanStack v5 query does not remove its cached data. (tanstack.com)

Pass an enabled-gated client to useMcpServerProblems. Keep the existing check when enabled is true. This preserves the PR requirement that an unavailable screen sends no mcpServers.* requests.

…ervers.v1

Host ⋯ › MCP servers: the host's list (yours, from plugins, in your
agents with Move/Copy), a server page with per-agent switches,
workspaces, shared process, sign in/out and Remove, an Add sheet over the
shared catalog with Custom server, the bots' paste-back sign-in, and the
bot Tools 'Your MCP servers' row. Pastes are read on the host
(mcpServers.previewPaste, and mcpServers.add adds every server a paste
names), so the phone ships no parser. Every entry point needs the host's
mcp-servers.v1 capability, which it lists only while its MCP servers
switch is on.

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

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: 338a5da3-72f9-4436-adcc-2aa78f33d300
Commits

Reviewing files that changed from the base of the PR and between 63b228d and f155e65.

Files ignored due to path filters: 1

  • src/shared/rpc-contract/rpc-params-catalog.generated.ts is excluded by !**/*.generated.*
Files selected for processing: 14

  • mobile/src/bots/tools/MobileBotHostMcpServersRow.tsx
  • mobile/src/bots/tools/MobileBotToolsPage.tsx
  • mobile/src/bots/tools/bot-tool-operations.ts
  • mobile/src/bots/tools/use-bot-tools-page.ts
  • mobile/src/i18n/locales/en.json
  • mobile/src/mcp-servers/MobileMcpCustomServerPage.tsx
  • mobile/src/mcp-servers/MobileMcpServerPage.tsx
  • mobile/src/mcp-servers/mcp-server-operations.ts
  • src/main/mcp-servers/mcp-server-paste.ts
  • src/main/runtime/rpc/methods/mcp-servers-paste.ts
  • src/main/runtime/rpc/methods/mcp-servers.ts
  • src/main/runtime/rpc/methods/rpc-method-registry.ts
  • src/main/runtime/rpc/server/runtime-rpc-mobile-mcp-server-methods.ts
  • src/shared/rpc-contract/mcp-servers-params.ts
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; 0 remain after this review.

Comment on lines +54 to +57
.catch((caught: unknown) =>
props.showToast(caught instanceof Error ? caught.message : String(caught))
)
.finally(() => setPending(null))

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

Reconcile the preference after a delivery-unknown failure.

When the preference write fails with a delivery-unknown error, the host may already have saved the new value. The row clears pending and shows the old enabled prop. It does not reread the list. The error toast says the change failed, which can be misleading.

Reconnect does not fix this state. The connected-edge invalidation covers only react-query queries. The bot tools list is read through direct RPC calls and kept in local state. A reconnect therefore does not reread it, and a timeout does not reconnect at all. The switch can keep showing the old value until the list is read again.

On this failure path, the row should request a fresh read of the bot tools list, for example through props.onChanged. The row should not clear pending and show the stale prop. Confirm that the page's onChanged handler performs that reread before relying on it.

botId={props.bot.id}
enabled={hostMcp}
online={props.online}
onChanged={() => void page.reread()}

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

Return the confirmation read's promise.

After a successful write, this callback starts page.reread() but returns undefined. The row then clears pending before the read finishes. With a delayed host, the switch returns to its old value and accepts another tap based on that stale value.

Return page.reread() and change the row's onChanged contract to return Promise<void>. Its existing .then(props.onChanged) can then keep the switch pending until confirmation finishes.

@AmoabaKelvin
AmoabaKelvin merged commit 57caa28 into main Nov 25, 2026
100 of 102 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