Skip to content

Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.

Go

refactor(agents): tighten the MCP tab and fix the workspace picker menu (MUL-5421) (#7056)

Bohan Jiangf97dd5e716c1
diff --git a/packages/views/agents/components/tabs/mcp-config-tab.test.tsx b/packages/views/agents/components/tabs/mcp-config-tab.test.tsx
index d081655abc..a94db97602 100644
--- a/packages/views/agents/components/tabs/mcp-config-tab.test.tsx
+++ b/packages/views/agents/components/tabs/mcp-config-tab.test.tsx
@@ -391,6 +391,28 @@ describe("McpConfigTab workspace servers", () => {
await waitFor(() => expect(mockAddServer).toHaveBeenCalledWith("srv-9"));
});
+ // A workspace can accumulate a lot of shared servers, and the picker is a
+ // menu anchored to a small button: it has to stay inside a bounded, scrolling
+ // box and keep the trigger's width instead of growing down the page.
+ it("keeps the picker bounded, scrollable, and anchored when the library is long", async () => {
+ const user = userEvent.setup();
+ workspaceMcp.library = Array.from({ length: 40 }, (_, i) =>
+ wsServer({ id: `srv-${i}`, name: `shared-server-${i}` }),
+ );
+ renderTab({ mcp_config: null });
+
+ await user.click(
+ await screen.findByRole("button", { name: /Add from workspace/ }),
+ );
+
+ const items = await screen.findAllByRole("menuitem");
+ expect(items).toHaveLength(40);
+ const menu = items[0]!.closest("[data-slot='dropdown-menu-content']");
+ expect(menu?.className).toMatch(/\bmax-h-72\b/);
+ expect(menu?.className).toMatch(/\boverflow-y-auto\b/);
+ expect(menu?.className).toMatch(/min-w-\(--anchor-width\)/);
+ });
+
it("toggles an assignment off without dropping it", async () => {
const user = userEvent.setup();
workspaceMcp.assigned = [wsServer({ enabled: true })];
diff --git a/packages/views/agents/components/tabs/mcp-config-tab.tsx b/packages/views/agents/components/tabs/mcp-config-tab.tsx
index b7641cdc35..90e0644997 100644
--- a/packages/views/agents/components/tabs/mcp-config-tab.tsx
+++ b/packages/views/agents/components/tabs/mcp-config-tab.tsx
@@ -218,21 +218,15 @@ export function McpConfigTab({
};
return (
- <div className="space-y-8">
- <p className="max-w-2xl break-words text-pretty text-body leading-6 text-muted-foreground">
- {t(($) => $.tab_body.mcp_config.intro)}
- </p>
-
+ // Three sources, one heading each. The prose that used to sit under every
+ // heading is gone: precedence is already shown where it applies (the
+ // Overridden badges) and nobody reads a paragraph to press a button.
+ <div className="space-y-6">
<section className="space-y-3">
- <div className="flex items-start justify-between gap-4">
- <div>
- <h3 className="text-body font-medium">
- {t(($) => $.tab_body.mcp_config.managed_title)}
- </h3>
- <p className="mt-1 max-w-2xl text-caption leading-5 text-muted-foreground">
- {t(($) => $.tab_body.mcp_config.managed_hint)}
- </p>
- </div>
+ <div className="flex items-center justify-between gap-4">
+ <h3 className="text-body font-medium">
+ {t(($) => $.tab_body.mcp_config.managed_title)}
+ </h3>
{!redacted && (
<Button size="sm" variant="outline" onClick={openAddDialog}>
<Plus aria-hidden="true" />
@@ -271,15 +265,10 @@ export function McpConfigTab({
</section>
<section className="space-y-3">
- <div className="flex items-start justify-between gap-4">
- <div>
- <h3 className="text-body font-medium">
- {t(($) => $.tab_body.mcp_config.workspace_title)}
- </h3>
- <p className="mt-1 max-w-2xl text-caption leading-5 text-muted-foreground">
- {t(($) => $.tab_body.mcp_config.workspace_hint)}
- </p>
- </div>
+ <div className="flex items-center justify-between gap-4">
+ <h3 className="text-body font-medium">
+ {t(($) => $.tab_body.mcp_config.workspace_title)}
+ </h3>
{canEdit && availableServers.length > 0 && (
<McpWorkspaceServerPicker
servers={availableServers}
@@ -294,7 +283,7 @@ export function McpConfigTab({
text={t(($) => $.tab_body.mcp_config.workspace_loading)}
/>
) : assignedServers.length > 0 ? (
- <ul className="divide-y divide-surface-border rounded-lg border">
+ <ul className="divide-y rounded-lg border bg-surface-raised/40">
{assignedServers.map((server) => (
<McpWorkspaceServerRow
key={server.id}
@@ -319,17 +308,16 @@ export function McpConfigTab({
</section>
<section className="space-y-3">
- <div className="flex items-start justify-between gap-4">
- <div>
- <h3 className="text-body font-medium">
- {t(($) => $.tab_body.mcp_config.runtime_title)}
- </h3>
- <p className="mt-1 max-w-2xl text-caption leading-5 text-muted-foreground">
- {t(($) => $.tab_body.mcp_config.runtime_hint, {
- runtime: runtime ? runtimeDisplayLabel(runtime) : "Runtime",
- })}
- </p>
- </div>
+ <div className="flex items-center justify-between gap-4">
+ {/* The machine name moves into the heading — it is the only part of
+ the old description that told the reader anything. */}
+ <h3 className="min-w-0 truncate text-body font-medium">
+ {runtime
+ ? t(($) => $.tab_body.mcp_config.runtime_title_named, {
+ runtime: runtimeDisplayLabel(runtime),
+ })
+ : t(($) => $.tab_body.mcp_config.runtime_title)}
+ </h3>
{runtimeId && (
<Button
variant="ghost"
@@ -468,8 +456,12 @@ function McpWorkspaceServerRow({
const { t } = useT("agents");
const enabled = server.enabled !== false;
return (
- <li className="flex items-center gap-3 px-4 py-3">
- <Server className="h-4 w-4 shrink-0 text-muted-foreground" aria-hidden="true" />
+ // Same row shape as the other two lists on this tab — icon chip, name,
+ // transport — so the three sources read as one inventory.
+ <li className="flex items-center gap-3 p-3">
+ <span className="flex size-9 shrink-0 items-center justify-center rounded-md bg-muted text-muted-foreground">
+ <Server className="h-4 w-4" aria-hidden="true" />
+ </span>
<div className="min-w-0 flex-1">
<div className="flex min-w-0 items-center gap-2">
<span className="truncate text-body font-medium">{server.name}</span>
@@ -479,7 +471,7 @@ function McpWorkspaceServerRow({
</Badge>
)}
</div>
- <p className="mt-0.5 text-caption text-muted-foreground">
+ <p className="text-caption uppercase text-muted-foreground">
{server.transport || "unknown"}
</p>
</div>
@@ -536,11 +528,21 @@ function McpWorkspaceServerPicker({
</Button>
}
/>
- <DropdownMenuContent align="end">
+ {/* Flush with the trigger's edges (`--anchor-width` is the trigger's own
+ width), free to grow for a long name, and capped so a workspace with
+ many servers scrolls instead of running off the viewport. */}
+ <DropdownMenuContent
+ align="end"
+ className="max-h-72 min-w-(--anchor-width) max-w-[min(20rem,var(--available-width))]"
+ >
{servers.map((server) => (
- <DropdownMenuItem key={server.id} onClick={() => onSelect(server.id)}>
- <span className="truncate">{server.name}</span>
- <span className="ml-2 text-caption text-muted-foreground">
+ <DropdownMenuItem
+ key={server.id}
+ className="gap-3"
+ onClick={() => onSelect(server.id)}
+ >
+ <span className="min-w-0 flex-1 truncate">{server.name}</span>
+ <span className="shrink-0 text-caption uppercase text-muted-foreground">
{server.transport || "unknown"}
</span>
</DropdownMenuItem>
diff --git a/packages/views/locales/en/agents.json b/packages/views/locales/en/agents.json
index 83d22e8cb5..87919b36d9 100644
--- a/packages/views/locales/en/agents.json
+++ b/packages/views/locales/en/agents.json
@@ -510,9 +510,7 @@
"save_failed_toast": "Failed to save custom arguments"
},
"mcp_config": {
- "intro": "Manage the MCP servers available to this agent. Servers managed by Multica are merged with servers inherited from the local runtime.",
"managed_title": "Managed by Multica",
- "managed_hint": "Saved in Multica for this agent. These servers are merged with runtime servers; a Multica server wins when names match.",
"managed_empty": "No MCP servers are managed by Multica yet.",
"add_action": "Add MCP",
"agent_disabled_badge": "Off for agent",
@@ -527,13 +525,12 @@
"workspace_library_empty": "This workspace has no MCP servers to assign yet. Add them in workspace Settings → MCP.",
"workspace_none_assigned": "No workspace MCP servers assigned to this agent yet.",
"workspace_add_action": "Add from workspace",
- "workspace_hint": "MCP servers this agent has been given from the workspace library. Nothing is assigned automatically — add what this agent should use, and switch one off to stop sending it without losing the assignment. The agent's own servers above win on a name collision.",
"workspace_loading": "Loading assigned servers…",
"dialog_name_locked": "The name cannot be changed here — renaming would add a second server and leave this one behind. Remove and re-add it instead.",
"workspace_overridden_badge": "Overridden",
"workspace_disabled_badge": "Disabled",
"runtime_title": "Inherited from runtime",
- "runtime_hint": "Discovered automatically from {{runtime}} and merged at task launch. URLs, headers, commands, and environment variables never leave the machine.",
+ "runtime_title_named": "Inherited from {{runtime}}",
"refresh_action": "Refresh",
"runtime_missing": "Assign a local runtime to discover inherited MCP servers.",
"runtime_offline": "The local runtime is offline. Reconnect it to refresh inherited MCP servers.",
diff --git a/packages/views/locales/ja/agents.json b/packages/views/locales/ja/agents.json
index 9689cb66d1..496714db6e 100644
--- a/packages/views/locales/ja/agents.json
+++ b/packages/views/locales/ja/agents.json
@@ -392,9 +392,7 @@
"save_failed_toast": "カスタム引数を保存できませんでした"
},
"mcp_config": {
- "intro": "このエージェントが使用できる MCP Server を管理します。Multica 管理の Server とローカル Runtime から継承した Server は統合して使用されます。",
"managed_title": "Multica で管理",
- "managed_hint": "このエージェント用に Multica に保存されます。Runtime MCP と統合され、同名の場合は Multica の設定が優先されます。",
"managed_empty": "Multica で管理されている MCP Server はありません。",
"add_action": "MCP を追加",
"agent_disabled_badge": "エージェントで無効",
@@ -409,13 +407,12 @@
"workspace_library_empty": "このワークスペースにはまだ割り当て可能な MCP サーバーがありません。ワークスペース設定 → MCP で追加してください。",
"workspace_none_assigned": "このエージェントにはまだワークスペース MCP サーバーが割り当てられていません。",
"workspace_add_action": "ワークスペースから追加",
- "workspace_hint": "ワークスペースライブラリからこのエージェントに割り当てられた MCP サーバー。自動では割り当てられません。使うものを追加し、オフにすると割り当てを残したまま送信を止められます。名前が衝突した場合は上のエージェント自身のサーバーが優先されます。",
"workspace_loading": "割り当て済みサーバーを読み込み中…",
"dialog_name_locked": "ここでは名前を変更できません。変更すると別のサーバーが追加され、元のサーバーが残ります。削除してから追加し直してください。",
"workspace_overridden_badge": "上書き",
"workspace_disabled_badge": "無効",
"runtime_title": "ランタイムから継承",
- "runtime_hint": "{{runtime}} から自動検出し、作業開始時にローカルで統合します。URL、ヘッダー、コマンド、環境変数はマシン外に送信されません。",
+ "runtime_title_named": "{{runtime}} から継承",
"refresh_action": "更新",
"runtime_missing": "継承 MCP サーバーを検出するには、ローカルランタイムを割り当ててください。",
"runtime_offline": "ローカルランタイムはオフラインです。再接続すると更新できます。",
diff --git a/packages/views/locales/ko/agents.json b/packages/views/locales/ko/agents.json
index c7d8681587..b1d749c559 100644
--- a/packages/views/locales/ko/agents.json
+++ b/packages/views/locales/ko/agents.json
@@ -400,9 +400,7 @@
"save_failed_toast": "사용자 지정 인자를 저장하지 못했습니다"
},
"mcp_config": {
- "intro": "이 에이전트가 사용할 수 있는 MCP Server를 관리합니다. Multica에서 관리하는 Server와 로컬 Runtime에서 상속한 Server가 함께 사용됩니다.",
"managed_title": "Multica에서 관리",
- "managed_hint": "이 에이전트용으로 Multica에 저장됩니다. Runtime MCP와 병합되며 이름이 같으면 Multica 설정이 우선합니다.",
"managed_empty": "Multica에서 관리하는 MCP Server가 없습니다.",
"add_action": "MCP 추가",
"agent_disabled_badge": "에이전트에서 꺼짐",
@@ -417,13 +415,12 @@
"workspace_library_empty": "이 워크스페이스에는 아직 할당할 MCP 서버가 없습니다. 워크스페이스 설정 → MCP에서 추가하세요.",
"workspace_none_assigned": "이 에이전트에 할당된 워크스페이스 MCP 서버가 아직 없습니다.",
"workspace_add_action": "워크스페이스에서 추가",
- "workspace_hint": "워크스페이스 라이브러리에서 이 에이전트에 할당된 MCP 서버입니다. 자동으로 할당되지 않으며, 필요한 것을 추가하고 스위치를 끄면 할당은 유지한 채 전달만 중단됩니다. 이름이 충돌하면 위의 에이전트 자체 서버가 우선합니다.",
"workspace_loading": "할당된 서버를 불러오는 중…",
"dialog_name_locked": "여기서는 이름을 바꿀 수 없습니다. 이름을 바꾸면 서버가 하나 더 추가되고 기존 서버가 남습니다. 제거 후 다시 추가하세요.",
"workspace_overridden_badge": "재정의됨",
"workspace_disabled_badge": "비활성화됨",
"runtime_title": "런타임에서 상속",
- "runtime_hint": "{{runtime}}에서 자동으로 탐색하고 작업 시작 시 로컬에서 병합합니다. URL, 헤더, 명령 및 환경 변수는 머신 외부로 전송되지 않습니다.",
+ "runtime_title_named": "{{runtime}}에서 상속",
"refresh_action": "새로고침",
"runtime_missing": "상속된 MCP 서버를 탐색하려면 로컬 런타임을 할당하세요.",
"runtime_offline": "로컬 런타임이 오프라인입니다. 다시 연결하면 새로고침할 수 있습니다.",
diff --git a/packages/views/locales/zh-Hans/agents.json b/packages/views/locales/zh-Hans/agents.json
index 9dcdc50e8b..a54c7d5475 100644
--- a/packages/views/locales/zh-Hans/agents.json
+++ b/packages/views/locales/zh-Hans/agents.json
@@ -499,9 +499,7 @@
"save_failed_toast": "保存自定义参数失败"
},
"mcp_config": {
- "intro": "管理该智能体可用的 MCP Server。由 Multica 管理的 Server 会与本地 Runtime 继承的 Server 合并使用。",
"managed_title": "由 Multica 管理",
- "managed_hint": "保存在 Multica 中并仅配置给该智能体。执行 task 时会与 Runtime MCP 合并;名称相同时以 Multica 配置为准。",
"managed_empty": "还没有由 Multica 管理的 MCP Server。",
"add_action": "添加 MCP",
"agent_disabled_badge": "已为智能体关闭",
@@ -516,13 +514,12 @@
"workspace_library_empty": "本工作区还没有可分配的 MCP 服务。请在工作区设置 → MCP 中添加。",
"workspace_none_assigned": "还没有给该智能体分配工作区 MCP 服务。",
"workspace_add_action": "从工作区添加",
- "workspace_hint": "从工作区库分配给该智能体的 MCP 服务。不会自动分配——需要用哪个就加哪个;关掉开关会停止下发但保留分配。上面该智能体自己的服务在同名时优先。",
"workspace_loading": "正在加载已分配的服务…",
"dialog_name_locked": "这里不能改名——改名会新增一个服务并把原来的留在那里。请改用移除后重新添加。",
"workspace_overridden_badge": "已覆盖",
"workspace_disabled_badge": "已禁用",
"runtime_title": "从运行时继承",
- "runtime_hint": "自动从 {{runtime}} 发现,并在 task 启动时于本机完成合并。URL、Header、命令和环境变量等敏感值不会离开本机。",
+ "runtime_title_named": "从 {{runtime}} 继承",
"refresh_action": "刷新",
"runtime_missing": "请先分配一个本地运行时,以发现继承的 MCP Server。",
"runtime_offline": "本地运行时处于离线状态,重新连接后即可刷新继承的 MCP Server。",