[PR #30955] refactor(web): MCP tool availability to context-based version gating #33034

Closed
opened 2026-02-21 20:52:32 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/langgenius/dify/pull/30955

State: closed
Merged: Yes


Background

MCP tool availability was computed in the Agent node and passed through multiple layers via canChooseMCPTool. This made the gating logic hard to trace and required frequent prop plumbing changes. We want a single source of truth that can be adjusted later without touching the entire selector tree.

Changes

  • Add MCPToolAvailabilityProvider and useMCPToolAvailability to centralize MCP availability.
  • Remove canChooseMCPTool prop drilling across tool selector / block selector / agent strategy components.
  • Default to allowing MCP tools when no provider is present; only wrap with provider where version-based gating is needed (Agent node panel).
  • Simplify MCP tooltip to a version unsupported message.
  • Update MultipleToolSelector tests to use the provider.

Testing

  • pnpm lint:fix --quiet
  • pnpm type-check:tsgo
**Original Pull Request:** https://github.com/langgenius/dify/pull/30955 **State:** closed **Merged:** Yes --- ## Background MCP tool availability was computed in the Agent node and passed through multiple layers via `canChooseMCPTool`. This made the gating logic hard to trace and required frequent prop plumbing changes. We want a single source of truth that can be adjusted later without touching the entire selector tree. ## Changes - Add `MCPToolAvailabilityProvider` and `useMCPToolAvailability` to centralize MCP availability. - Remove `canChooseMCPTool` prop drilling across tool selector / block selector / agent strategy components. - Default to allowing MCP tools when no provider is present; only wrap with provider where version-based gating is needed (Agent node panel). - Simplify MCP tooltip to a version unsupported message. - Update MultipleToolSelector tests to use the provider. ## Testing - pnpm lint:fix --quiet - pnpm type-check:tsgo
yindo added the pull-request label 2026-02-21 20:52:32 -05:00
yindo closed this issue 2026-02-21 20:52:32 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#33034