Skip to content

Conversation

@birdayz
Copy link
Contributor

@birdayz birdayz commented Jan 30, 2026

What

Fix orphaned MCP server handling and replace the bloated card layout with a compact row-based list in AI Agent configuration.

Why

  1. Deleted MCP servers referenced by agents became invisible - users couldn't see or remove stale references
  2. The card layout wasted massive vertical space (120px min-height per server) for what's essentially a name and tool count

Implementation details

Orphaned server handling (ai-agent-configuration-tab.tsx):

  • connectedMcpServers and availableMcpServers now create placeholder objects for servers that exist in agent config but not in the system
  • Placeholders have state: UNSPECIFIED and displayName: "id (deleted)" for detection

Compact list UI (mcp-server-card.tsx):

  • Replaced cards with row-based list (~40px vs 120px per item)
  • Server name + tool count badge on each row
  • Expandable tool details via chevron click
  • Missing servers show warning icon, red styling, and "Missing" badge

References

In addition, there's a PR in internal cloud repo to lazily deal with down MCPs on start of the agent.

recording_1769782939.mp4

const missingServerIds = connectedServerIds.filter((id) => !existingIds.has(id));

// Create placeholders for missing servers
const missingServers: MCPServer[] = missingServerIds.map(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in the future we should not allow deleting MCP servers that are in use by the AI agent

<div className="flex shrink-0 items-center gap-2">
{toolNames.length > 0 && (
<Badge variant="secondary" className="text-xs">
{toolNames.length} {toolNames.length === 1 ? 'tool' : 'tools'}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: use pluralize() function

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done - using pluralizeWithNumber()

const rowContent = (
<div className="flex flex-1 items-center gap-3">
{toolNames.length > 0 && (
<button
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

consider using registry UI instead of native HTML

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done - changed to <Button size="icon" variant="ghost">

tags: {},
state: MCPServer_State.UNSPECIFIED,
url: '',
}) as MCPServer
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add generic <MCPServer> type to .map() function to get rid of MCPServer casting as MCPServer

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tried, but doesn't work - MCPServer is a protobuf Message type that requires internal properties like $typeName. Added a comment explaining why the cast is necessary.

@birdayz birdayz force-pushed the jb/ai-agent-mcp-server-ux branch 3 times, most recently from abdf015 to 8e196b0 Compare January 30, 2026 15:04
Two related fixes for MCP servers in AI Agent configuration:

1. Orphaned server references now visible and removable. When an MCP
   server is deleted, agents referencing it showed nothing - user
   couldn't see or remove the stale reference. Now creates placeholder
   objects for missing servers with clear visual indication.

2. Replace bloated card layout with compact row-based list. The old
   120px min-height cards wasted vertical space. New list shows one
   server per row with expandable tool details on demand.

Missing servers display with warning icon, red styling, and "Missing"
badge so users know to clean them up.

Also adds description text and makes title link to MCP Servers page.
@birdayz birdayz force-pushed the jb/ai-agent-mcp-server-ux branch from 8e196b0 to 3765422 Compare January 30, 2026 15:06
@birdayz birdayz merged commit df47129 into master Jan 30, 2026
13 checks passed
@birdayz birdayz deleted the jb/ai-agent-mcp-server-ux branch January 30, 2026 15:56
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.

2 participants