Skip to content

[Enhancement]: Sort MCP servers by name in the MCP Settings panel, chat MCP menu and agent tools #16359

Description

@sisve

What features would you like to see added?

MCP servers are listed in the order the /api/mcp/servers and /api/mcp/tools responses return them. That order is neither alphabetical nor stable from the user's point of view, and with more than a handful of servers it's hard to find one. I'd like every MCP server list sorted by the name it displays, case-insensitive, with numbers compared by value (server-2 before server-10).

More details

Two places build these lists, and sorting in both covers every one of them:

  • client/src/hooks/MCP/useMCPServerManager.ts: availableMCPServers feeds the MCP Settings panel (MCPBuilderPanel → MCPServerList), the chat MCP dropdown (MCPSelect) and the MCP submenu in the tools dropdown (MCPSubMenu). Sort by config.title || serverName, which is the label MCPServerCard and MCPServerMenuItem show.
  • client/src/components/SidePanel/Agents/Tools/items/catalog.ts: buildCatalog iterates mcpServersMap in insertion order. That map is the tools response followed by configured servers without tools (AgentPanelContext.tsx), so even a sorted server response comes out unsorted here. Sorting the MCP items by name fixes both the agent's attached-tools list and the Tools marketplace dialog. deriveSelectedItems only sorts by kind, and its sort is stable, so the order carries through.

Sorting server-side isn't enough because of the tools-less servers appended in AgentPanelContext.

Which components are impacted by your request?

UI

Pictures

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions