Skip to content

fix: strip @sort qualifier from MCP Servers view search query#304985

Closed
yogeshwaran-c wants to merge 1 commit intomicrosoft:mainfrom
yogeshwaran-c:fix/mcp-servers-sort-query
Closed

fix: strip @sort qualifier from MCP Servers view search query#304985
yogeshwaran-c wants to merge 1 commit intomicrosoft:mainfrom
yogeshwaran-c:fix/mcp-servers-sort-query

Conversation

@yogeshwaran-c
Copy link
Copy Markdown
Contributor

What kind of change does this PR introduce?

Bug fix

What is the current behavior?

When typing @mcp @sort:name in the Extensions search box, the MCP Servers view becomes empty showing "No MCP Servers found." This happens because the query() method only strips the @mcp prefix, leaving @sort:name as literal search text passed to queryGallery(), which finds no matching results.

Closes #296801

What is the new behavior?

The @sort: qualifier is now stripped from the query text before it is passed to queryGallery(). This uses the same regex pattern (/@sort:(\w+)(-\w*)?/g) that the extensions view already uses to handle sort qualifiers.

After the fix, @mcp @sort:name correctly shows the MCP Servers list (since the gallery search text becomes empty after stripping both qualifiers).

Additional context

  • One-line change in src/vs/workbench/contrib/mcp/browser/mcpServersView.ts
  • The regex pattern is already used across extensionsViews.ts in multiple places for the same purpose
  • Note: This fix strips the sort qualifier from the search text but does not yet apply the sort order to the results. The actual sorting support could be added as a follow-up enhancement.

When the user types '@mcp @sort:name' in the Extensions search box, the
MCP Servers view only strips '@mcp' but passes '@sort:name' as literal
search text to queryGallery, which finds no results and shows an empty
list.

Strip the @sort qualifier using the same regex pattern as the extensions
view before passing the text to the gallery query.

Closes microsoft#296801
@vs-code-engineering vs-code-engineering bot added this to the 1.114.0 milestone Mar 26, 2026
@Yoyokrazy Yoyokrazy modified the milestones: 1.114.0, Backlog Mar 26, 2026
@Yoyokrazy Yoyokrazy closed this Mar 26, 2026
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.

Extensions: MCP Servers view becomes empty when applying sort

3 participants