Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

fix(mcp): handle missing server name in McpServersTab

Steven Enamakelbe86e974779d
diff --git a/app/src/components/channels/mcp/McpServersTab.tsx b/app/src/components/channels/mcp/McpServersTab.tsx
index 28c0c33371..51e8b8ef49 100644
--- a/app/src/components/channels/mcp/McpServersTab.tsx
+++ b/app/src/components/channels/mcp/McpServersTab.tsx
@@ -14,6 +14,7 @@ import { mcpClientsApi } from '../../../services/api/mcpClientsApi';
import { openUrl } from '../../../utils/openUrl';
import ChipTabs from '../../layout/ChipTabs';
import Button from '../../ui/Button';
+import Separator from '../../ui/Separator';
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from '../../ui/Table';
import TextField from '../../ui/TextField';
import InstallDialog from './InstallDialog';
diff --git a/app/src/components/ui/ListRow.test.tsx b/app/src/components/ui/ListRow.test.tsx
new file mode 100644
index 0000000000..53aae94b0b
--- /dev/null
+++ b/app/src/components/ui/ListRow.test.tsx
@@ -0,0 +1,65 @@
+import { fireEvent, render, screen } from '@testing-library/react';
+import { describe, expect, it, vi } from 'vitest';
+
+import ListRow from './ListRow';
+
+describe('<ListRow />', () => {
+ it('renders the label and marks itself with the list-row slot', () => {
+ render(
+ <ul>
+ <ListRow label="allow.example.com" removeLabel="Remove" data-testid="row" />
+ </ul>
+ );
+
+ const row = screen.getByTestId('row');
+ expect(row).toHaveAttribute('data-slot', 'list-row');
+ expect(row).toHaveTextContent('allow.example.com');
+ });
+
+ it('omits the remove control when there is no onRemove', () => {
+ render(
+ <ul>
+ <ListRow label="pinned" removeLabel="Remove" />
+ </ul>
+ );
+
+ expect(screen.queryByRole('button')).toBeNull();
+ });
+
+ it('calls onRemove from the text remove button', () => {
+ const onRemove = vi.fn();
+ render(
+ <ul>
+ <ListRow label="entry" removeLabel="Remove" onRemove={onRemove} />
+ </ul>
+ );
+
+ fireEvent.click(screen.getByRole('button', { name: 'Remove' }));
+ expect(onRemove).toHaveBeenCalledTimes(1);
+ });
+
+ it('keeps removeLabel as the accessible name when a removeIcon replaces the text', () => {
+ const onRemove = vi.fn();
+ render(
+ <ul>
+ <ListRow
+ label="edge"
+ removeLabel="Detach edge"
+ removeIcon="✕"
+ removeTestId="detach"
+ onRemove={onRemove}
+ />
+ </ul>
+ );
+
+ // The painted glyph is the icon, but the a11y tree still reads the label.
+ const button = screen.getByTestId('detach');
+ expect(button).toHaveAccessibleName('Detach edge');
+ expect(button).toHaveAttribute('title', 'Detach edge');
+ expect(button).toHaveTextContent('✕');
+ expect(button).not.toHaveTextContent('Detach edge');
+
+ fireEvent.click(button);
+ expect(onRemove).toHaveBeenCalledTimes(1);
+ });
+});