Skip to content

Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure

TypeScript

feat(control-ui): simplify connector actions and show authentication

Josué027a2b0406bf
diff --git a/control-ui/app/hosts/[name]/page.tsx b/control-ui/app/hosts/[name]/page.tsx
index fb40cb4e7..0fd3d912e 100644
--- a/control-ui/app/hosts/[name]/page.tsx
+++ b/control-ui/app/hosts/[name]/page.tsx
@@ -15,6 +15,7 @@ import { SubscriptionCapabilityNotice } from '@components/SubscriptionCapability
import { useToast } from '@components/Toast'
import { HOST_DEFAULT_TAB, HOST_TABS } from '@constants/hostDetails'
import { CONTROL_ROUTES } from '@constants/routes'
+import { connectorAuthenticationLabel } from '@lib/connectorAuthentication'
import { useSubscriptionCapabilities } from '@lib/hooks/useSubscriptionCapabilities'
import { HostAccessTab } from '../../../components/HostAccessTab'
import { HostAdvancedTab } from '../../../components/HostAdvancedTab'
@@ -333,8 +334,12 @@ export default function HostDetailsPage() {
// and carry the resourceVersion without exposing the context in the UI.
const [agentContext, setAgentContext] = useState<ContextResource | null>(null)
const [availableConnectorNames, setAvailableConnectorNames] = useState<string[]>([])
+ const [connectorAuthenticationByName, setConnectorAuthenticationByName] = useState<
+ Record<string, string>
+ >({})
const [connectorCatalogLoaded, setConnectorCatalogLoaded] = useState(false)
const [connectorCatalogLoading, setConnectorCatalogLoading] = useState(false)
+ const connectorCatalogAttemptedRef = useRef(false)
const [showAddConnector, setShowAddConnector] = useState(false)
const [selectedConnectorNames, setSelectedConnectorNames] = useState<string[]>([])
const [hostStatusLabel, setHostStatusLabel] = useState('Unknown')
@@ -694,26 +699,43 @@ export default function HostDetailsPage() {
void loadData()
}, [routeName])
- async function openAddConnectorDialog() {
- setSelectedConnectorNames([])
- setShowAddConnector(true)
- setError('')
- if (connectorCatalogLoaded || connectorCatalogLoading) return
-
+ const loadConnectorCatalog = useCallback(async (force = false) => {
+ if (!force && connectorCatalogAttemptedRef.current) return
+ connectorCatalogAttemptedRef.current = true
setConnectorCatalogLoading(true)
try {
const response = await getMcpServers()
- const names = (response.items || [])
- .map(item => String(item.metadata?.name || '').trim())
- .filter(Boolean)
- .sort((a, b) => a.localeCompare(b))
+ const connectors = (response.items || []).flatMap(item => {
+ const name = String(item.metadata?.name || '').trim()
+ if (!name) return []
+ const spec = item.spec || {}
+ const auth =
+ spec.auth && typeof spec.auth === 'object' ? (spec.auth as Record<string, unknown>) : {}
+ return [{ name, authentication: connectorAuthenticationLabel(auth.type) }]
+ })
+ const names = connectors.map(connector => connector.name).sort((a, b) => a.localeCompare(b))
setAvailableConnectorNames(Array.from(new Set(names)))
+ setConnectorAuthenticationByName(
+ Object.fromEntries(connectors.map(connector => [connector.name, connector.authentication]))
+ )
setConnectorCatalogLoaded(true)
} catch (e) {
setError(e instanceof Error ? e.message : 'Failed to load available connectors.')
} finally {
setConnectorCatalogLoading(false)
}
+ }, [])
+
+ useEffect(() => {
+ if (activeTab === 'connectors') void loadConnectorCatalog()
+ }, [activeTab, loadConnectorCatalog])
+
+ async function openAddConnectorDialog() {
+ setSelectedConnectorNames([])
+ setShowAddConnector(true)
+ setError('')
+ if (connectorCatalogLoaded || connectorCatalogLoading) return
+ await loadConnectorCatalog(true)
}
async function saveAgentConnectors(nextServers: string[]): Promise<boolean> {
@@ -1628,19 +1650,20 @@ export default function HostDetailsPage() {
<thead>
<tr>
<th>Connector</th>
+ <th>Authentication</th>
<th className="cu-table__col-actions">Actions</th>
</tr>
</thead>
<tbody>
{initialLoading ? (
<tr>
- <td colSpan={2} className="cu-empty">
+ <td colSpan={3} className="cu-empty">
Loading…
</td>
</tr>
) : contextMcpServers.length === 0 ? (
<tr>
- <td colSpan={2} className="cu-empty">
+ <td colSpan={3} className="cu-empty">
No connectors attached yet.
</td>
</tr>
@@ -1650,6 +1673,13 @@ export default function HostDetailsPage() {
<td>
<span className="cu-table__cell-name">{server}</span>
</td>
+ <td>
+ <span className="cu-connector-badge">
+ {connectorCatalogLoading
+ ? 'Loading…'
+ : (connectorAuthenticationByName[server] ?? 'Unknown')}
+ </span>
+ </td>
<td className="cu-table__cell-actions">
<div className="cu-table-actions">
<RowActionsMenu
diff --git a/control-ui/app/mcp-servers/page.tsx b/control-ui/app/mcp-servers/page.tsx
index cbbd481ea..efd1f4958 100644
--- a/control-ui/app/mcp-servers/page.tsx
+++ b/control-ui/app/mcp-servers/page.tsx
@@ -7,8 +7,6 @@ import { useConfirmDialog } from '../../components/ConfirmDialog'
import { DashboardLayout } from '../../components/DashboardLayout'
import { McpServerTable } from '../../components/McpServerTable'
import type {
- ConnectorAccessPrincipal,
- ConnectorAccessSummaryMap,
ConnectorAgentBinding,
ConnectorAgentTarget,
} from '../../components/McpServerTable.types'
@@ -25,16 +23,11 @@ import type { ContextResource, McpServerResource } from '../../lib/api'
import {
addConnectorToAgentContexts,
connectorAccessMutationError,
+ connectorAgentBindingsFromContexts,
+ connectorAgentTargetsFromHosts,
connectorResourceKey,
- loadConnectorAccessState,
- removeConnectorFromAgentContext,
} from '../../lib/connectorAccessManagement'
-function agentListLabel(agents: ConnectorAccessPrincipal[]): string {
- if (agents.length === 1) return agents[0].label
- return `${agents.length} agents`
-}
-
export default function McpServersPage() {
const router = useRouter()
const { showToast } = useToast()
@@ -46,8 +39,6 @@ export default function McpServersPage() {
const [bindingsByConnectorName, setBindingsByConnectorName] = useState<
Record<string, ConnectorAgentBinding[]>
>({})
- const [accessByConnectorKey, setAccessByConnectorKey] = useState<ConnectorAccessSummaryMap>({})
- const [accessWarning, setAccessWarning] = useState('')
const [deletingKey, setDeletingKey] = useState<string | null>(null)
const [updatingAgentAccessKey, setUpdatingAgentAccessKey] = useState<string | null>(null)
const { confirm, confirmDialog } = useConfirmDialog()
@@ -56,7 +47,6 @@ export default function McpServersPage() {
async function loadAll(): Promise<string> {
setLoading(true)
setError('')
- setAccessWarning('')
try {
const [serversResult, hostsResult, contextsResult] = await Promise.all([
getMcpServers(),
@@ -66,13 +56,11 @@ export default function McpServersPage() {
const connectors = (serversResult.items || []) as McpServerResource[]
const hosts = hostsResult.items || []
const nextContexts = (contextsResult.items || []) as ContextResource[]
- const accessState = await loadConnectorAccessState(connectors, nextContexts, hosts)
- setAccessWarning(accessState.warning)
+ const nextAgentTargets = connectorAgentTargetsFromHosts(hosts)
setMcpServers(connectors)
setContexts(nextContexts)
- setAgentTargets(accessState.agentTargets)
- setBindingsByConnectorName(accessState.bindingsByConnectorName)
- setAccessByConnectorKey(accessState.accessByConnectorKey)
+ setAgentTargets(nextAgentTargets)
+ setBindingsByConnectorName(connectorAgentBindingsFromContexts(nextContexts, nextAgentTargets))
return ''
} catch (e) {
if (isSilentApiError(e)) return ''
@@ -148,38 +136,6 @@ export default function McpServersPage() {
}
}
- async function removeConnectorFromAgents(
- server: { name: string; namespace: string },
- binding: ConnectorAgentBinding
- ) {
- const key = `${server.namespace}/${server.name}`
- if (binding.agents.length > 1) {
- const sharedNames = binding.agents.map(agent => agent.label).join(', ')
- const shouldRemove = await confirm({
- title: 'Remove Connector Access',
- message: `Remove connector ${server.name} from ${binding.agents.length} agents (${sharedNames})? These agents share one connector set, so the change applies to all of them.`,
- confirmLabel: 'Remove',
- tone: 'danger',
- })
- if (!shouldRemove) return
- }
-
- setUpdatingAgentAccessKey(key)
- setError('')
- try {
- await removeConnectorFromAgentContext(server.name, binding, contexts)
- await loadAll()
- showToast(`Connector ${server.name} removed from ${agentListLabel(binding.agents)}.`, {
- tone: 'success',
- })
- } catch (e) {
- if (isSilentApiError(e)) return
- setError(connectorAccessMutationError(e, `Failed to remove ${server.name} from agent access`))
- } finally {
- setUpdatingAgentAccessKey(null)
- }
- }
-
useEffect(() => {
void loadAll()
}, [])
@@ -187,18 +143,11 @@ export default function McpServersPage() {
return (
<DashboardLayout>
{error ? <div className="cu-banner cu-banner--error">{error}</div> : null}
- {accessWarning ? (
- <div className="cu-banner cu-banner--warning" role="status">
- {accessWarning}
- </div>
- ) : null}
<McpServerTable
items={mcpServers as any}
- accessByConnectorKey={accessByConnectorKey}
agentBindingsByConnectorName={bindingsByConnectorName}
agentTargets={agentTargets}
onAddToAgents={addConnectorToAgents}
- onRemoveFromAgents={removeConnectorFromAgents}
updatingAgentAccessKey={updatingAgentAccessKey}
onDelete={handleDelete}
onOpen={server => router.push(CONTROL_ROUTES.connectors.detail(server.name))}
diff --git a/control-ui/components/ConnectorDetailPage/index.tsx b/control-ui/components/ConnectorDetailPage/index.tsx
index 2fe9c7440..7ebc93ffd 100644
--- a/control-ui/components/ConnectorDetailPage/index.tsx
+++ b/control-ui/components/ConnectorDetailPage/index.tsx
@@ -21,6 +21,7 @@ import {
import type { ConnectorDetailTab } from '@constants/connectorDetail'
import { CONTROL_ROUTES } from '@constants/routes'
import type { McpServerCondition } from '@lib/api'
+import { connectorAuthenticationLabel } from '@lib/connectorAuthentication'
function text(value: unknown, fallback = '—'): string {
return typeof value === 'string' && value.trim() ? value : fallback
@@ -107,6 +108,8 @@ export function ConnectorDetailPage() {
const activeBoundary = accessBoundary(activeTab)
const spec = server?.spec ?? {}
+ const auth =
+ spec.auth && typeof spec.auth === 'object' ? (spec.auth as Record<string, unknown>) : {}
const conditions = server?.status?.conditions ?? []
const transport =
spec.transport && typeof spec.transport === 'object'
@@ -273,6 +276,10 @@ export function ConnectorDetailPage() {
value={spec.enabled === false ? 'No' : 'Yes'}
/>
<ConnectorReadOnlyField label="Transport" value={text(transport.type)} />
+ <ConnectorReadOnlyField
+ label="Authentication"
+ value={connectorAuthenticationLabel(auth.type)}
+ />
<ConnectorReadOnlyField code label="Endpoint" value={text(transport.url)} wide />
</div>
</FormSection>
diff --git a/control-ui/components/McpServerTable.tsx b/control-ui/components/McpServerTable.tsx
index 7ce14d53a..413e80696 100644
--- a/control-ui/components/McpServerTable.tsx
+++ b/control-ui/components/McpServerTable.tsx
@@ -8,6 +8,7 @@ import {
TableViewport,
TruncatedText,
} from '@clerum/frontend-components'
+import { connectorAuthenticationLabel } from '@lib/connectorAuthentication'
import { ConnectorAgentAccessDialog } from './ConnectorAgentAccessDialog'
import type {
ConnectorAgentBinding,
@@ -20,16 +21,17 @@ import { IconCable } from './Sidebar/icons'
import { TableHeaderRow } from './TableHeaderRow'
import type { TableHeaderColumn } from './TableHeaderRow/types'
import { TablePanelHeader } from './TablePanelHeader'
-import { IconRefresh } from './icons'
+import { IconChevronRight, IconRefresh } from './icons'
import { Button } from './ui'
const ENABLED_TOOLTIP = 'Enabled controls whether this server is available to agents.'
-type ConnectorSortKey = 'name' | 'description' | 'managed' | 'enabled' | 'status'
+type ConnectorSortKey = 'name' | 'description' | 'authentication' | 'managed' | 'enabled' | 'status'
type SortDirection = 'asc' | 'desc'
const CONNECTOR_COLUMNS: TableHeaderColumn[] = [
{ key: 'name', label: 'Name', width: '24%' },
{ key: 'description', label: 'Description' },
+ { key: 'authentication', label: 'Authentication', width: '10rem' },
{ key: 'managed', label: 'Managed', width: '6rem' },
{ key: 'enabled', label: 'Enabled', title: ENABLED_TOOLTIP, width: '6rem' },
{ key: 'status', label: 'Status', width: '7rem' },
@@ -86,13 +88,15 @@ function StatusBadge({ status }: { status?: McpServerStatus }) {
)
}
+function AuthenticationBadge({ authType }: { authType: unknown }) {
+ return <span className="cu-connector-badge">{connectorAuthenticationLabel(authType)}</span>
+}
+
export function McpServerTable({
items,
- accessByConnectorKey,
agentBindingsByConnectorName = {},
agentTargets = [],
onAddToAgents,
- onRemoveFromAgents,
updatingAgentAccessKey,
onDelete,
onOpen,
@@ -109,10 +113,6 @@ export function McpServerTable({
const [sortKey, setSortKey] = useState<ConnectorSortKey>('name')
const [sortDirection, setSortDirection] = useState<SortDirection>('asc')
const [serverKeyAddingAgents, setServerKeyAddingAgents] = useState<string | null>(null)
- const [serverKeyViewingAccess, setServerKeyViewingAccess] = useState<string | null>(null)
- const accessDialogRef = React.useRef<HTMLElement | null>(null)
- const accessCloseButtonRef = React.useRef<HTMLButtonElement | null>(null)
- const accessOpenerRef = React.useRef<HTMLElement | null>(null)
const rows = useMemo(
() =>
items.map(item => {
@@ -126,14 +126,10 @@ export function McpServerTable({
const filteredRows = useMemo(() => {
const matchingRows = !normalizedSearch
? rows
- : rows.filter(({ namespace, name, item, key }) => {
+ : rows.filter(({ namespace, name, item }) => {
const spec = item.spec || {}
- const access = accessByConnectorKey?.[key]
- const accessText = [
- ...(access?.agents ?? []),
- ...(access?.users ?? []),
- ...(access?.teams ?? []),
- ]
+ const accessText = (agentBindingsByConnectorName[name] ?? [])
+ .flatMap(binding => binding.agents)
.flatMap(principal => [principal.id, principal.label])
.join(' ')
const conditionText = (item.status?.conditions || [])
@@ -146,6 +142,7 @@ export function McpServerTable({
name,
spec.image,
spec.description,
+ spec.auth?.type,
spec.transport?.type,
spec.transport?.url,
accessText,
@@ -166,17 +163,23 @@ export function McpServerTable({
undefined,
{ sensitivity: 'base' }
)
- : sortKey === 'managed'
- ? Number((left.item.spec?.managed ?? true) === true) -
- Number((right.item.spec?.managed ?? true) === true)
- : sortKey === 'enabled'
- ? Number((left.item.spec?.enabled ?? true) === true) -
- Number((right.item.spec?.enabled ?? true) === true)
- : getStatusLabel(left.item.status).localeCompare(getStatusLabel(right.item.status))
+ : sortKey === 'authentication'
+ ? connectorAuthenticationLabel(left.item.spec?.auth?.type).localeCompare(
+ connectorAuthenticationLabel(right.item.spec?.auth?.type)
+ )
+ : sortKey === 'managed'
+ ? Number((left.item.spec?.managed ?? true) === true) -
+ Number((right.item.spec?.managed ?? true) === true)
+ : sortKey === 'enabled'
+ ? Number((left.item.spec?.enabled ?? true) === true) -
+ Number((right.item.spec?.enabled ?? true) === true)
+ : getStatusLabel(left.item.status).localeCompare(
+ getStatusLabel(right.item.status)
+ )
if (comparison !== 0) return comparison * direction
return left.key.localeCompare(right.key)
})
- }, [accessByConnectorKey, normalizedSearch, rows, sortDirection, sortKey])
+ }, [agentBindingsByConnectorName, normalizedSearch, rows, sortDirection, sortKey])
React.useEffect(() => {
if (!onRefresh) return
@@ -184,40 +187,6 @@ export function McpServerTable({
return () => clearInterval(id)
}, [onRefresh])
- React.useEffect(() => {
- if (!serverKeyViewingAccess) return
- accessCloseButtonRef.current?.focus()
- const onKeyDown = (event: KeyboardEvent) => {
- if (event.key === 'Escape') {
- event.preventDefault()
- setServerKeyViewingAccess(null)
- return
- }
- if (event.key !== 'Tab') return
- const focusable = Array.from(
- accessDialogRef.current?.querySelectorAll<HTMLElement>(
- 'a[href], button:not(:disabled), input:not(:disabled), [tabindex]:not([tabindex="-1"])'
- ) ?? []
- )
- const first = focusable[0]
- const last = focusable.at(-1)
- if (!first || !last) return
- if (event.shiftKey && document.activeElement === first) {
- event.preventDefault()
- last.focus()
- } else if (!event.shiftKey && document.activeElement === last) {
- event.preventDefault()
- first.focus()
- }
- }
- window.addEventListener('keydown', onKeyDown)
- const opener = accessOpenerRef.current
- return () => {
- window.removeEventListener('keydown', onKeyDown)
- opener?.focus()
- }
- }, [serverKeyViewingAccess])
-
function toggleSort(key: ConnectorSortKey) {
if (sortKey === key) {
setSortDirection(direction => (direction === 'asc' ? 'desc' : 'asc'))
@@ -247,12 +216,6 @@ export function McpServerTable({
setServerKeyAddingAgents(key)
}
- function openAccessDetails(key: string) {
- accessOpenerRef.current =
- document.activeElement instanceof HTMLElement ? document.activeElement : null
- setServerKeyViewingAccess(key)
- }
-
const isInitialLoad = loading && items.length === 0
return (
@@ -264,44 +227,49 @@ export function McpServerTable({
{isInitialLoad ? 'Connectors' : `Connectors (${filteredRows.length})`}
</>
}
- secondaryActions={
+ titleActions={
onCreate || onAddRemote ? (
- <>
- {onCreate ? (
- <Button
- size="sm"
- className="cu-btn--mcp-install"
- onClick={onCreate}
- disabled={isInitialLoad}
- >
- Create connector
- </Button>
- ) : null}
- {onAddRemote ? (
- <Button
- size="sm"
- className="cu-btn--mcp-install"
- onClick={onAddRemote}
- disabled={isInitialLoad}
- >
- Add remote server
- </Button>
- ) : null}
- </>
+ <RowActionsMenu
+ ariaLabel="Connector actions"
+ horizontalTrigger
+ actions={[
+ ...(onCreate
+ ? [
+ {
+ key: 'create-connector',
+ label: 'Create connector',
+ onClick: onCreate,
+ disabled: isInitialLoad,
+ },
+ ]
+ : []),
+ ...(onAddRemote
+ ? [
+ {
+ key: 'add-remote-server',
+ label: 'Add remote server',
+ onClick: onAddRemote,
+ disabled: isInitialLoad,
+ },
+ ]
+ : []),
+ ]}
+ />
) : undefined
}
subtitle="Browse connector deployments and agent access."
actionsClassName="cu-table-panel__actions--mcp"
primaryAction={
onInstallFromRegistry ? (
- <button
- type="button"
- className="cu-btn cu-btn--primary cu-btn--sm cu-btn--mcp-install"
+ <Button
+ size="sm"
+ variant="primary"
onClick={onInstallFromRegistry}
disabled={isInitialLoad}
>
- Install from Marketplace
- </button>
+ <IconChevronRight width={16} height={16} />
+ Marketplace
+ </Button>
) : undefined
}
refreshAction={
@@ -350,7 +318,6 @@ export function McpServerTable({
) : (
filteredRows.map(({ key, namespace, name, item }) => {
const spec = item.spec || {}
- const agentBindings = bindingsForConnector(name)
const agentAccessBusy = updatingAgentAccessKey === key
return (
<TableRow
@@ -362,6 +329,9 @@ export function McpServerTable({
<td className="cu-registry-description">
<TruncatedText value={spec.description} />
</td>
+ <td>
+ <AuthenticationBadge authType={spec.auth?.type} />
+ </td>
<td>
<BoolBadge value={spec.managed} trueLabel="Yes" falseLabel="No" />
</td>
@@ -398,23 +368,6 @@ export function McpServerTable({
},
]
: []),
- {
- key: 'view-access',
- label: 'View access details',
- onClick: () => openAccessDetails(key),
- },
- ...(onRemoveFromAgents
- ? agentBindings.map(binding => ({
- key: `remove-agents-${binding.contextRef}`,
- label:
- binding.agents.length === 1
- ? `Remove from ${binding.agents[0].label}`
- : `Remove from ${binding.agents.length} agents`,
- disabled: agentAccessBusy,
- onClick: () =>
- void onRemoveFromAgents({ name, namespace }, binding),
- }))
- : []),
...(onDelete
? [
{
@@ -456,83 +409,6 @@ export function McpServerTable({
)
})()
: null}
- {serverKeyViewingAccess
- ? (() => {
- const row = rows.find(candidate => candidate.key === serverKeyViewingAccess)
- if (!row) return null
- const access = accessByConnectorKey?.[row.key]
- const linkedAgents = bindingsForConnector(row.name).flatMap(binding => binding.agents)
- const groups = [
- {
- key: 'agents',
- label: 'Agents',
- items: linkedAgents.map(item => ({ key: item.id, label: item.label })),
- },
- {
- key: 'teams',
- label: 'Teams',
- items: (access?.teams ?? []).map(item => ({ key: item.id, label: item.label })),
- },
- {
- key: 'users',
- label: 'Users',
- items: (access?.users ?? []).map(item => ({ key: item.id, label: item.label })),
- },
- ]
- return (
- <div
- className="cu-modal-overlay"
- role="presentation"
- onMouseDown={event => {
- if (event.target === event.currentTarget) setServerKeyViewingAccess(null)
- }}
- >
- <section
- aria-labelledby="connector-access-title"
- aria-modal="true"
- className="cu-modal-panel"
- ref={accessDialogRef}
- role="dialog"
- >
- <div className="cu-modal-panel__header">
- <h3 className="cu-modal-panel__title" id="connector-access-title">
- Access for {row.name}
- </h3>
- </div>
- <div className="cu-registry-context-access cu-connector-access-grid">
- {groups.map(group => (
- <section className="cu-registry-context-access__group" key={group.key}>
- <div className="cu-registry-context-access__heading">
- <h4>{group.label}</h4>
- <span>{group.items.length}</span>
- </div>
- {group.items.length ? (
- <ul className="cu-registry-context-access__list">
- {group.items.map(item => (
- <li key={item.key}>{item.label}</li>
- ))}
- </ul>
- ) : (
- <p className="cu-muted">No {group.label.toLowerCase()} linked.</p>
- )}
- </section>
- ))}
- </div>
- <div className="cu-modal-panel__actions">
- <button
- className="cu-btn cu-btn--primary"
- onClick={() => setServerKeyViewingAccess(null)}
- ref={accessCloseButtonRef}
- type="button"
- >
- Close
- </button>
- </div>
- </section>
- </div>
- )
- })()
- : null}
</div>
)
}
diff --git a/control-ui/components/McpServerTable.types.ts b/control-ui/components/McpServerTable.types.ts
index 29bb4b7a2..5b29668b5 100644
--- a/control-ui/components/McpServerTable.types.ts
+++ b/control-ui/components/McpServerTable.types.ts
@@ -69,14 +69,12 @@ export type ConnectorAgentTarget = {
export type McpServerTableProps = {
items: McpServerItem[]
- accessByConnectorKey?: Record<string, ConnectorAccessSummary>
agentBindingsByConnectorName?: Record<string, ConnectorAgentBinding[]>
agentTargets?: ConnectorAgentTarget[]
onAddToAgents?: (
server: ServerRef,
agents: Array<{ name: string; contextRef: string }>
) => Promise<boolean>
- onRemoveFromAgents?: (server: ServerRef, binding: ConnectorAgentBinding) => Promise<void>
updatingAgentAccessKey?: string | null
onDelete?: (server: ServerRef) => Promise<void>
onOpen?: (server: ServerRef) => void
diff --git a/control-ui/components/__tests__/McpServerTable.test.tsx b/control-ui/components/__tests__/McpServerTable.test.tsx
index 67e383964..6cda11931 100644
--- a/control-ui/components/__tests__/McpServerTable.test.tsx
+++ b/control-ui/components/__tests__/McpServerTable.test.tsx
@@ -236,7 +236,7 @@ describe('McpServerTable — marketplace-aligned rows', () => {
})
})
-describe('McpServerTable — connector access summaries', () => {
+describe('McpServerTable — connector list', () => {
it('renders ordinary rows without inline detail expansion', () => {
const items = [makeItem({ name: 'airtable-server' })]
render(<McpServerTable items={items} />)
@@ -245,84 +245,25 @@ describe('McpServerTable — connector access summaries', () => {
expect(screen.queryByRole('button', { name: /Expand connector/ })).toBeNull()
})
- it('renders agents, teams, and users in marketplace-style access groups', () => {
- const items = [makeItem({ name: 'airtable-server' })]
- render(
- <McpServerTable
- items={items}
- agentBindingsByConnectorName={{
- 'airtable-server': [
- makeAgentBinding('ctx-alpha', [
- { id: 'agent-alpha', label: 'agent-alpha' },
- { id: 'bravo', label: 'bravo' },
- { id: 'charlie', label: 'charlie' },
- { id: 'delta', label: 'delta' },
- { id: 'echo', label: 'echo' },
- { id: 'foxtrot', label: 'foxtrot' },
- ]),
- ],
- }}
- accessByConnectorKey={{
- 'mcp-server/airtable-server': {
- agents: [],
- users: [{ id: 'user-1', label: 'Ada Lovelace' }],
- teams: [{ id: 'team-1', label: 'Research' }],
- },
- }}
- />
- )
-
- fireEvent.click(screen.getByRole('button', { name: 'Actions for connector airtable-server' }))
- fireEvent.click(screen.getByRole('menuitem', { name: 'View access details' }))
-
- const access = screen.getByRole('dialog', { name: 'Access for airtable-server' })
- expect(access).toHaveTextContent('Agents')
- expect(access).toHaveTextContent('Teams')
- expect(access).toHaveTextContent('Users')
-
- for (const label of [
- 'agent-alpha',
- 'bravo',
- 'charlie',
- 'delta',
- 'echo',
- 'foxtrot',
- 'Ada Lovelace',
- 'Research',
- ]) {
- expect(screen.getByText(label)).toBeInTheDocument()
- }
- })
-
- it('preserves accessible access-dialog focus behavior without context links', () => {
+ it('keeps access details and per-agent removal out of the list menu', () => {
render(
<McpServerTable
items={[makeItem({ name: 'airtable-server' })]}
agentBindingsByConnectorName={{
'airtable-server': [
- makeAgentBinding('research', [{ id: 'agent-alpha', label: 'agent-alpha' }]),
+ makeAgentBinding('research', [{ id: 'agent-alpha', label: 'Agent Alpha' }]),
],
}}
+ onOpen={vi.fn()}
+ onAddToAgents={vi.fn().mockResolvedValue(true)}
/>
)
- const trigger = screen.getByRole('button', {
- name: 'Actions for connector airtable-server',
- })
- fireEvent.click(trigger)
- fireEvent.click(screen.getByRole('menuitem', { name: 'View access details' }))
-
- const close = screen.getByRole('button', { name: 'Close' })
- const agentLabel = screen.getByText('agent-alpha')
- expect(close).toHaveFocus()
- fireEvent.keyDown(window, { key: 'Tab' })
- expect(agentLabel).toBeInTheDocument()
- fireEvent.keyDown(window, { key: 'Tab', shiftKey: true })
- expect(close).toHaveFocus()
-
- fireEvent.keyDown(window, { key: 'Escape' })
- expect(screen.queryByRole('dialog', { name: 'Access for airtable-server' })).toBeNull()
- expect(trigger).toHaveFocus()
+ fireEvent.click(screen.getByRole('button', { name: 'Actions for connector airtable-server' }))
+ expect(screen.getByRole('menuitem', { name: 'View details' })).toBeInTheDocument()
+ expect(screen.getByRole('menuitem', { name: 'Add to agents' })).toBeInTheDocument()
+ expect(screen.queryByRole('menuitem', { name: 'View access details' })).toBeNull()
+ expect(screen.queryByRole('menuitem', { name: 'Remove from Agent Alpha' })).toBeNull()
})
it('keeps connector endpoints searchable after removing the visible endpoint column', () => {
@@ -337,17 +278,6 @@ describe('McpServerTable — connector access summaries', () => {
expect(onOpen).not.toHaveBeenCalled()
})
- it('renders an empty access state when no principals are mapped', () => {
- const items = [makeItem({ name: 'unused-server' })]
- render(<McpServerTable items={items} />)
-
- fireEvent.click(screen.getByRole('button', { name: 'Actions for connector unused-server' }))
- fireEvent.click(screen.getByRole('menuitem', { name: 'View access details' }))
- expect(screen.getByText('No agents linked.')).toBeInTheDocument()
- expect(screen.getByText('No teams linked.')).toBeInTheDocument()
- expect(screen.getByText('No users linked.')).toBeInTheDocument()
- })
-
it('shows the compact connector columns and omits removed metadata columns', () => {
const image =
'us-central1-docker.pkg.dev/example-project/example/nginx-egress-proxy:sha-3cbdf33'
@@ -358,12 +288,13 @@ describe('McpServerTable — connector access summaries', () => {
expect(screen.queryByRole('columnheader', { name: /Image/i })).toBeNull()
expect(screen.queryByRole('columnheader', { name: /Transport/i })).toBeNull()
expect(screen.queryByRole('columnheader', { name: /Access/i })).toBeNull()
+ expect(screen.getByRole('columnheader', { name: /Authentication/i })).toBeInTheDocument()
expect(screen.getByRole('columnheader', { name: /Managed/i })).toBeInTheDocument()
expect(screen.queryByTitle(url)).toBeNull()
expect(screen.queryByTitle(image)).toBeNull()
})
- it('filters rows by agent, user, and team access labels', () => {
+ it('filters rows by agent access labels', () => {
const items = [
makeItem({ name: 'airtable-server' }),
makeItem({ name: 'search-server', contextRef: 'context2' }),
@@ -371,80 +302,30 @@ describe('McpServerTable — connector access summaries', () => {
render(
<McpServerTable
items={items}
- accessByConnectorKey={{
- 'mcp-server/airtable-server': {
- agents: [{ id: 'agent-alpha', label: 'agent-alpha' }],
- users: [{ id: 'user-1', label: 'Ada Lovelace' }],
- teams: [{ id: 'team-1', label: 'Research' }],
- },
- 'mcp-server/search-server': {
- agents: [{ id: 'agent-beta', label: 'agent-beta' }],
- users: [{ id: 'user-2', label: 'Grace Hopper' }],
- teams: [{ id: 'team-2', label: 'Operations' }],
- },
+ agentBindingsByConnectorName={{
+ 'airtable-server': [
+ makeAgentBinding('context1', [{ id: 'agent-alpha', label: 'Agent Alpha' }]),
+ ],
+ 'search-server': [
+ makeAgentBinding('context2', [{ id: 'agent-beta', label: 'Agent Beta' }]),
+ ],
}}
/>
)
const search = screen.getByLabelText('Search connectors') as HTMLInputElement
- fireEvent.change(search, { target: { value: 'Research' } })
+ fireEvent.change(search, { target: { value: 'Agent Alpha' } })
expect(screen.getByText('airtable-server')).toBeInTheDocument()
expect(screen.queryByText('search-server')).not.toBeInTheDocument()
- fireEvent.change(search, { target: { value: 'Grace Hopper' } })
+ fireEvent.change(search, { target: { value: 'Agent Beta' } })
expect(screen.queryByText('airtable-server')).not.toBeInTheDocument()
expect(screen.getByText('search-server')).toBeInTheDocument()
-
- fireEvent.change(search, { target: { value: 'agent-alpha' } })
- expect(screen.getByText('airtable-server')).toBeInTheDocument()
- expect(screen.queryByText('search-server')).not.toBeInTheDocument()
})
})
describe('McpServerTable — agent membership', () => {
- it('does not display a stale legacy contextRef without authoritative allowlist membership', () => {
- render(
- <McpServerTable
- items={[makeItem({ name: 'airtable-server', contextRef: 'removed-context' })]}
- accessByConnectorKey={{}}
- />
- )
-
- fireEvent.click(screen.getByRole('button', { name: 'Actions for connector airtable-server' }))
- fireEvent.click(screen.getByRole('menuitem', { name: 'View access details' }))
-
- expect(screen.queryByText('removed-context')).not.toBeInTheDocument()
- expect(screen.getByText('No agents linked.')).toBeInTheDocument()
- expect(screen.getByText('No teams linked.')).toBeInTheDocument()
- expect(screen.getByText('No users linked.')).toBeInTheDocument()
- })
-
- it('shows attached agents and lets an operator remove the connector from one binding', async () => {
- const onRemoveFromAgents = vi.fn().mockResolvedValue(undefined)
- const items = [makeItem({ name: 'airtable-server' })]
- render(
- <McpServerTable
- items={items}
- agentBindingsByConnectorName={{
- 'airtable-server': [
- makeAgentBinding('research', [{ id: 'agent-alpha', label: 'Agent Alpha' }]),
- ],
- }}
- onAddToAgents={vi.fn().mockResolvedValue(true)}
- onRemoveFromAgents={onRemoveFromAgents}
- />
- )
-
- fireEvent.click(screen.getByRole('button', { name: 'Actions for connector airtable-server' }))
- fireEvent.click(screen.getByRole('menuitem', { name: 'Remove from Agent Alpha' }))
-
- expect(onRemoveFromAgents).toHaveBeenCalledWith(
- { namespace: 'mcp-server', name: 'airtable-server' },
- makeAgentBinding('research', [{ id: 'agent-alpha', label: 'Agent Alpha' }])
- )
- })
-
it('uses the agent selection modal to add the connector to more agents', async () => {
const onAddToAgents = vi.fn().mockResolvedValue(true)
const items = [makeItem({ name: 'airtable-server' })]
@@ -461,7 +342,6 @@ describe('McpServerTable — agent membership', () => {
{ name: 'sales', label: 'Sales', contextRef: 'sales-context' },
]}
onAddToAgents={onAddToAgents}
- onRemoveFromAgents={vi.fn().mockResolvedValue(undefined)}
/>
)
@@ -560,14 +440,6 @@ describe('McpServerTable — row actions kebab', () => {
expect(editItem).not.toBeDisabled()
expect(deletingItem).toBeDisabled()
})
-
- it('retains the access-details menu when edit and delete are unavailable', () => {
- const items = [makeItem({ name: 'airtable-server' })]
- render(<McpServerTable items={items} />)
- expect(
- screen.getByRole('button', { name: 'Actions for connector airtable-server' })
- ).toBeInTheDocument()
- })
})
// ─────────────────────────────────────────────────────────────────────────────
@@ -590,41 +462,38 @@ describe('McpServerTable — header actions', () => {
return { onCreate, onAddRemote, onInstallFromRegistry }
}
- it('offers create, add remote and marketplace as header buttons, not a kebab menu', () => {
+ it('puts secondary actions in a menu and keeps Marketplace as the primary action', () => {
const { onCreate, onAddRemote, onInstallFromRegistry } = renderWithActions()
+ const trigger = screen.getByRole('button', { name: 'Connector actions' })
+ const marketplace = screen.getByRole('button', { name: 'Marketplace' })
- expect(screen.queryByRole('button', { name: 'Connector actions' })).not.toBeInTheDocument()
-
- const create = screen.getByRole('button', { name: 'Create connector' })
- const addRemote = screen.getByRole('button', { name: 'Add remote server' })
- const marketplace = screen.getByRole('button', { name: 'Install from Marketplace' })
- // One primary CTA; the other two are secondary buttons of the same size.
expect(marketplace).toHaveClass('cu-btn--primary')
- for (const secondary of [create, addRemote]) {
- expect(secondary).not.toHaveClass('cu-btn--primary')
- expect(secondary).toHaveClass('cu-btn', 'cu-btn--sm', 'cu-btn--mcp-install')
- }
+ expect(screen.queryByRole('button', { name: 'Create connector' })).not.toBeInTheDocument()
+ expect(screen.queryByRole('button', { name: 'Add remote server' })).not.toBeInTheDocument()
- fireEvent.click(create)
- fireEvent.click(addRemote)
+ fireEvent.click(trigger)
+ fireEvent.click(screen.getByRole('menuitem', { name: 'Create connector' }))
+ fireEvent.click(trigger)
+ fireEvent.click(screen.getByRole('menuitem', { name: 'Add remote server' }))
fireEvent.click(marketplace)
+
expect(onCreate).toHaveBeenCalledTimes(1)
expect(onAddRemote).toHaveBeenCalledTimes(1)
expect(onInstallFromRegistry).toHaveBeenCalledTimes(1)
})
- it('disables every header CTA during the initial load', () => {
+ it('disables every header action during the initial load', () => {
renderWithActions({ loading: true, empty: true })
- for (const name of ['Create connector', 'Add remote server', 'Install from Marketplace']) {
- expect(screen.getByRole('button', { name })).toBeDisabled()
- }
+ expect(screen.getByRole('button', { name: 'Marketplace' })).toBeDisabled()
+ expect(screen.getByRole('button', { name: 'Connector actions' })).toBeDisabled()
})
- it('omits a header button whose handler is not provided', () => {
+ it('omits a submenu item whose handler is not provided', () => {
render(<McpServerTable items={[makeItem({})]} onAddRemote={vi.fn()} />)
- expect(screen.getByRole('button', { name: 'Add remote server' })).toBeInTheDocument()
- expect(screen.queryByRole('button', { name: 'Create connector' })).not.toBeInTheDocument()
+ fireEvent.click(screen.getByRole('button', { name: 'Connector actions' }))
+ expect(screen.getByRole('menuitem', { name: 'Add remote server' })).toBeInTheDocument()
+ expect(screen.queryByRole('menuitem', { name: 'Create connector' })).not.toBeInTheDocument()
})
})
diff --git a/control-ui/components/__tests__/McpServersPage.aliases.test.tsx b/control-ui/components/__tests__/McpServersPage.aliases.test.tsx
index beacf61d1..e7f3a39b3 100644
--- a/control-ui/components/__tests__/McpServersPage.aliases.test.tsx
+++ b/control-ui/components/__tests__/McpServersPage.aliases.test.tsx
@@ -38,13 +38,6 @@ vi.mock('../McpServerTable', async () => {
server: { name: string; namespace: string },
agents: Array<{ name: string; contextRef: string }>
) => Promise<void>
- onRemoveFromAgents: (
- server: { name: string; namespace: string },
- binding: {
- agents: Array<{ id: string; label: string }>
- contextRef: string
- }
- ) => Promise<void>
}) => {
const binding = props.agentBindingsByConnectorName.search?.[0]
return React.createElement(
@@ -65,18 +58,7 @@ vi.mock('../McpServerTable', async () => {
type: 'button',
},
'add alias connector'
- ),
- binding
- ? React.createElement(
- 'button',
- {
- onClick: () =>
- props.onRemoveFromAgents({ name: 'search', namespace: 'mcp-server' }, binding),
- type: 'button',
- },
- 'remove alias connector'
- )
- : null
+ )
)
},
}
@@ -120,7 +102,7 @@ describe('Installed Connectors Context aliases', () => {
})
})
- it('shows the owner and uses the resource name for add and remove mutations', async () => {
+ it('shows the owner and uses the resource name for add mutations', async () => {
render(<McpServersPage />)
expect(await screen.findByText('owners:Agent Alpha')).toBeInTheDocument()
@@ -137,16 +119,5 @@ describe('Installed Connectors Context aliases', () => {
}),
})
)
-
- vi.mocked(api.updateContext).mockClear()
- fireEvent.click(screen.getByRole('button', { name: 'remove alias connector' }))
- await waitFor(() => expect(api.updateContext).toHaveBeenCalledTimes(1))
- expect(api.updateContext).toHaveBeenLastCalledWith(
- 'ctx-resource',
- expect.objectContaining({
- metadata: { resourceVersion: 'rv-1' },
- spec: expect.objectContaining({ contextId: 'ctx-wire', mcpServers: [] }),
- })
- )
})
})
diff --git a/control-ui/lib/connectorAuthentication.ts b/control-ui/lib/connectorAuthentication.ts
new file mode 100644
index 000000000..591bc3cd9
--- /dev/null
+++ b/control-ui/lib/connectorAuthentication.ts
@@ -0,0 +1,10 @@
+const STATIC_AUTH_TYPES = new Set(['bearer', 'basic', 'apiKey'])
+
+export function connectorAuthenticationLabel(authType: unknown): string {
+ if (authType === 'oauth') return 'OAuth'
+ if (typeof authType === 'string' && STATIC_AUTH_TYPES.has(authType)) {
+ return 'Static credentials'
+ }
+ if (authType == null || authType === 'none') return 'No authentication'
+ return 'Other'
+}
diff --git a/control-ui/package-lock.json b/control-ui/package-lock.json
index 131a17269..89df19642 100644
--- a/control-ui/package-lock.json
+++ b/control-ui/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "clerum-control-ui",
- "version": "0.1.728",
+ "version": "0.1.729",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "clerum-control-ui",
- "version": "0.1.728",
+ "version": "0.1.729",
"dependencies": {
"@clerum/display-field": "file:../packages/display-field",
"@clerum/frontend-components": "file:../packages/frontend-components",
diff --git a/control-ui/package.json b/control-ui/package.json
index 6cda74840..a23f3ab42 100644
--- a/control-ui/package.json
+++ b/control-ui/package.json
@@ -1,6 +1,6 @@
{
"name": "clerum-control-ui",
- "version": "0.1.728",
+ "version": "0.1.729",
"private": true,
"scripts": {
"dev": "NEXT_IGNORE_INCORRECT_LOCKFILE=1 next dev",