Skip to content

improvement(mcp): add all MCP server tools individually instead of as single server entry#3376

Merged
waleedlatif1 merged 2 commits intostagingfrom
waleedlatif1/sofia-v1
Feb 27, 2026
Merged

improvement(mcp): add all MCP server tools individually instead of as single server entry#3376
waleedlatif1 merged 2 commits intostagingfrom
waleedlatif1/sofia-v1

Conversation

@waleedlatif1
Copy link
Collaborator

Summary

  • "Use all tools" now adds each MCP tool individually as mcp StoredTools instead of one mcp-server entry
  • Users can configure params per-tool and remove individual tools after bulk-adding
  • Right-click X on MCP tools shows "Remove all from [server]" option
  • Removed mcp-server StoredTool type and all backend expansion logic
  • Drill-down navigation (server folders → tools) stays

Type of Change

  • New feature / Enhancement

Testing

Tested manually. 44 agent-handler tests + 39 tool-validation tests pass.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel
Copy link

vercel bot commented Feb 27, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Feb 27, 2026 9:31pm

Request Review

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 27, 2026

Greptile Summary

Replaces server-level MCP tool selection with individual tool entries. Previously, selecting "all tools" from an MCP server stored a single mcp-server entry that the backend expanded at execution time. Now the frontend immediately adds each tool as a separate mcp StoredTool, enabling per-tool configuration and selective removal.

Key changes:

  • Frontend now stores individual mcp tool entries instead of single mcp-server entry
  • Added right-click context menu on MCP tool X buttons to "Remove all from [server]"
  • Backend removed all mcp-server expansion logic (processMcpServerSelections, createMcpToolFromDiscoveredServerTool)
  • Removed isMcpServerAlreadySelected helper and getMcpServerIssue validation

Already flagged in previous review:

  • tool-input.tsx:1298 - "Use all tools" overwrites existing tool configurations
  • tool-input.tsx:1821 - O(n²) filter performance issue

Confidence Score: 3/5

  • Safe to merge with two known issues already flagged in previous review that should be addressed
  • Core logic is sound and backend changes are clean, but has performance concerns and UX issues in the frontend that were already identified
  • Pay attention to tool-input.tsx lines 1298-1322 (config overwrite) and 1821-1824 (performance)

Important Files Changed

Filename Overview
apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/tool-input/tool-input.tsx Removed mcp-server type handling and added right-click context menu for MCP tools, but has performance issue and overwrites existing tool configurations
apps/sim/executor/handlers/agent/agent-handler.ts Removed mcp-server type checks and backend expansion logic cleanly

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    subgraph Before ["Before: Server-Level Selection"]
        A1[User clicks 'Use all tools'] --> A2[Frontend stores single mcp-server entry]
        A2 --> A3[Agent execution starts]
        A3 --> A4[Backend processMcpServerSelections]
        A4 --> A5[Backend discovers all tools from server]
        A5 --> A6[Backend expands to individual tools]
        A6 --> A7[LLM receives all tools]
    end
    
    subgraph After ["After: Individual Tool Selection"]
        B1[User clicks 'Use all tools'] --> B2[Frontend immediately creates individual mcp entries]
        B2 --> B3[User can configure each tool]
        B3 --> B4[Agent execution starts]
        B4 --> B5[Backend receives individual tools]
        B5 --> B6[LLM receives configured tools]
    end
    
    style Before fill:#fee,stroke:#c88,stroke-width:2px
    style After fill:#efe,stroke:#8c8,stroke-width:2px
Loading

Last reviewed commit: fb3fd2d

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

5 files reviewed, 2 comments

Edit Code Review Agent Settings | Greptile

@waleedlatif1
Copy link
Collaborator Author

@greptile

@waleedlatif1
Copy link
Collaborator Author

@cursor review

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

@waleedlatif1 waleedlatif1 merged commit 38ac86c into staging Feb 27, 2026
12 checks passed
@waleedlatif1 waleedlatif1 deleted the waleedlatif1/sofia-v1 branch February 27, 2026 22:02
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.

1 participant