From a01798ebee2edfe9c4b13e73ba00dc670f139304 Mon Sep 17 00:00:00 2001 From: Callie Peden Date: Fri, 13 Nov 2026 00:12:50 -0500 Subject: [PATCH] web: one MCP page for every server, its sign-in and management MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The settings pane only listed http servers that had asked for a sign-in: stdio servers, servers that never asked, and every management action lived in the TUI alone, and closing Settings orphaned a sign-in in flight. Replace McpServers.svelte with an MCP servers page over the store. Every configured server (http and stdio, any state) is a compact row: a transport glyph with a status dot, the name with a chip only when it says something the toggle cannot, the address in mono, and on the right just the one thing it needs from you (sign in / grant access) and its on/off toggle. Details and the rarer actions (sign in again, sign out, check connection, edit, remove…) sit behind the row's disclosure; edit opens in the same place. Servers needing your sign-in are pinned at the top. Off servers offer only details, edit and remove, since the daemon never probes one. The page has a summary line with add server beside it, a skeleton while loading, a retry when the first read fails, an empty state and dismissible notices. The form is a label/field grid with segmented controls for transport, sign-in and tools, a headers/environment table whose secret values are password inputs, and the extras behind one disclosure; errors wait until a field has content or a save is tried, and an unsaved form guards closing Settings. The sign-in panel always offers pasting the callback address, which is how a phone or a remote browser finishes (the redirect lands on the daemon host's loopback). Every control has a visible hover in light and dark themes. Container queries reflow it under 560 px. The old api.ts MCP helpers go with McpServers.svelte. --- web/src/App.svelte | 9 + web/src/lib/McpServers.svelte | 256 ------ web/src/lib/Settings.svelte | 17 +- web/src/lib/api.ts | 32 - web/src/lib/settings/McpServerCard.svelte | 667 ++++++++++++++++ web/src/lib/settings/McpServerForm.svelte | 889 +++++++++++++++++++++ web/src/lib/settings/McpSettings.svelte | 362 +++++++++ web/src/lib/settings/McpSignInPanel.svelte | 219 +++++ 8 files changed, 2155 insertions(+), 296 deletions(-) delete mode 100644 web/src/lib/McpServers.svelte create mode 100644 web/src/lib/settings/McpServerCard.svelte create mode 100644 web/src/lib/settings/McpServerForm.svelte create mode 100644 web/src/lib/settings/McpSettings.svelte create mode 100644 web/src/lib/settings/McpSignInPanel.svelte diff --git a/web/src/App.svelte b/web/src/App.svelte index 0dc2470af..0e499a7a3 100644 --- a/web/src/App.svelte +++ b/web/src/App.svelte @@ -25,6 +25,7 @@ import Phone from './lib/Phone.svelte'; import Rail from './lib/Rail.svelte'; import { sessions } from './lib/sessions.svelte'; + import { mcp } from './lib/settings/mcp.svelte'; import { slotOf, type Board } from './lib/board.svelte'; import Tabs from './lib/Tabs.svelte'; import { lazy } from './lib/lazy'; @@ -94,6 +95,14 @@ $effect(() => localStorage.setItem(RAIL_KEY, railOpen ? 'open' : 'closed')); + // The MCP store owns sign-ins beyond Settings' lifetime; a reload + // mid-sign-in resumes. + $effect(() => { + const stop = mcp.watch(); + mcp.resume(); + return stop; + }); + // With the sessions hidden, the pointer at the canvas's edge on their side // brings them out floating over it, at once. How near counts as the edge // grows with how fast the pointer is heading there, so a flick toward the diff --git a/web/src/lib/McpServers.svelte b/web/src/lib/McpServers.svelte deleted file mode 100644 index 5f5ae5a17..000000000 --- a/web/src/lib/McpServers.svelte +++ /dev/null @@ -1,256 +0,0 @@ - - -{#if servers === null} -

reading MCP servers…

-{:else if shown.length === 0 && !failure} -

- no MCP server asks for a sign-in. one that answers with a sign-in request - shows here. -

-{:else} - -{/if} -{#if failure}{/if} - - diff --git a/web/src/lib/Settings.svelte b/web/src/lib/Settings.svelte index e06643a86..89e379460 100644 --- a/web/src/lib/Settings.svelte +++ b/web/src/lib/Settings.svelte @@ -2,7 +2,8 @@ import BrowserSettings from './settings/BrowserSettings.svelte'; import ProvidersSettings from './settings/ProvidersSettings.svelte'; import ConfigurationSettings from './settings/ConfigurationSettings.svelte'; - import McpServers from './McpServers.svelte'; + import McpSettings from './settings/McpSettings.svelte'; + import { mcp } from './settings/mcp.svelte'; import ExtensionsView from './views/ExtensionsView.svelte'; import { sessions } from './sessions.svelte'; import WebSearchSettings from './settings/WebSearchSettings.svelte'; @@ -58,8 +59,8 @@ }, { id: 'mcp', - label: 'MCP sign-ins', - detail: 'Connect your tools and services', + label: 'MCP servers', + detail: 'Tools and services your sessions reach', scope: 'shared daemon', }, { @@ -104,7 +105,7 @@ export function canClose(): boolean { if (saving) return false; - if (dirty) { + if (dirty || mcp.formDirty) { confirming = true; content?.scrollTo({ top: 0 }); return false; @@ -188,8 +189,8 @@