Skip to content

fix: mcp page results shows non mcp tools#36688

Open
prncexe wants to merge 1 commit into
langgenius:mainfrom
prncexe:fix/mcp-page-results-include-non-mcp-tools
Open

fix: mcp page results shows non mcp tools#36688
prncexe wants to merge 1 commit into
langgenius:mainfrom
prncexe:fix/mcp-page-results-include-non-mcp-tools

Conversation

@prncexe
Copy link
Copy Markdown

@prncexe prncexe commented May 26, 2026

Important

  1. Make sure you have read our contribution guidelines
  2. Ensure there is an associated issue and you have been assigned to it
  3. Use the correct syntax to link this PR: Fixes #36647 .

Summary

Fixes #36647. The MCP page's filter logic in web/app/components/tools/mcp/index.tsx had a bug where the collection.type === 'mcp' check was only applied when searchText was empty. When a search term was entered, the filter returned any tool whose name matched, regardless of type — causing non-MCP tools (e.g., built-in tools) to appear in the MCP results. This fix extracts isMcpType into a shared variable so the type constraint is always enforced, even during search.

Screenshots

Before After
Searching shows non-MCP tools mixed in results Only MCP-type tools match when searching

Checklist

  • This change requires a documentation update, included: Dify Document
  • I understand that this PR may be closed in case there was no previous discussion or issues. (This doesn't apply to typos!)
  • I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
  • I've updated the documentation accordingly.
  • I ran make lint && make type-check (backend) and cd web && pnpm exec vp staged (frontend) to appease the lint gods

@dosubot dosubot Bot added size:S This PR changes 10-29 lines, ignoring generated files. javascript Pull requests that update javascript code labels May 26, 2026
@github-actions github-actions Bot added the web This relates to changes on the web. label May 26, 2026
@fatelei
Copy link
Copy Markdown
Contributor

fatelei commented May 27, 2026

web style check failed

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

Labels

javascript Pull requests that update javascript code size:S This PR changes 10-29 lines, ignoring generated files. web This relates to changes on the web.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

On the MCP list page, the search results include non-MCP tools.

2 participants