Skip to content

Conversation

@samhvw8
Copy link
Contributor

@samhvw8 samhvw8 commented May 12, 2025

Implements a new UI component and status tracking system for MCP tool executions, providing users with feedback on tool execution progress and results.

  • Add McpExecutionStatus schema with started/output/completed/error states
  • Enhance useMcpToolTool to send status updates at different execution stages
  • Create new McpExecution component with status indicators and expandable sections
  • Refactor ChatRow to use the new component for better visualization
  • Update CodeAccordian to support custom headers for arguments/response sections

This change improves the user experience by providing clear visual feedback during MCP tool execution, similar to the existing command execution experience.

Related GitHub Issue

Closes: #2145

Description

Test Procedure

Type of Change

  • 🐛 Bug Fix: Non-breaking change that fixes an issue.
  • New Feature: Non-breaking change that adds functionality.
  • 💥 Breaking Change: Fix or feature that would cause existing functionality to not work as expected.
  • ♻️ Refactor: Code change that neither fixes a bug nor adds a feature.
  • 💅 Style: Changes that do not affect the meaning of the code (white-space, formatting, etc.).
  • 📚 Documentation: Updates to documentation files.
  • ⚙️ Build/CI: Changes to the build process or CI configuration.
  • 🧹 Chore: Other changes that don't modify src or test files.

Pre-Submission Checklist

  • Issue Linked: This PR is linked to an approved GitHub Issue (see "Related GitHub Issue" above).
  • Scope: My changes are focused on the linked issue (one major feature/fix per PR).
  • Self-Review: I have performed a thorough self-review of my code.
  • Code Quality:
    • My code adheres to the project's style guidelines.
    • There are no new linting errors or warnings (npm run lint).
    • All debug code (e.g., console.log) has been removed.
  • Testing:
    • New and/or updated tests have been added to cover my changes.
    • All tests pass locally (npm test).
    • The application builds successfully with my changes.
  • Branch Hygiene: My branch is up-to-date (rebased) with the main branch.
  • Documentation Impact: I have considered if my changes require documentation updates (see "Documentation Updates" section below).
  • Changeset: A changeset has been created using npm run changeset if this PR includes user-facing changes or dependency updates.
  • Contribution Guidelines: I have read and agree to the Contributor Guidelines.

Screenshots / Videos

image image

Documentation Updates

Additional Notes


Important

Enhance MCP tool execution feedback with new UI components, status tracking, and improved message handling.

  • UI Components:
    • Add McpExecution component in McpExecution.tsx for displaying MCP tool execution status and results.
    • Refactor ChatRow in ChatRow.tsx to use McpExecution for better visualization.
  • Functionality:
    • Implement McpExecutionStatus schema in mcp.ts with states: started, output, completed, error.
    • Enhance useMcpToolTool in useMcpToolTool.ts to send execution status updates.
    • Update combineCommandSequences in combineCommandSequences.ts to combine use_mcp_server and mcp_server_response messages.
  • Testing:
    • Add tests for useMcpToolTool in useMcpToolTool.test.ts to cover parameter validation, partial requests, successful execution, and error handling.
    • Add tests for combineCommandSequences in combineCommandSequences.test.ts to handle MCP server responses.
  • Misc:
    • Update CodeAccordian in CodeAccordian.tsx to support custom headers.

This description was created by Ellipsis for a98d119c7f4ec99671109b0d9caab741e684afab. You can customize this summary. It will automatically update as commits are pushed.

@changeset-bot
Copy link

changeset-bot bot commented May 12, 2025

⚠️ No Changeset found

Latest commit: 98b091b

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@dosubot dosubot bot added size:XL This PR changes 500-999 lines, ignoring generated files. enhancement New feature or request labels May 12, 2025
Copy link
Contributor

Choose a reason for hiding this comment

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

Typo: The component name CodeAccordian is likely a misspelling. The standard spelling is CodeAccordion. Consider renaming it for consistency and clarity.

@samhvw8
Copy link
Contributor Author

samhvw8 commented May 12, 2025

@LousyBook94 just push my pr, can you check this ?

@LousyBook94
Copy link

@samhvw8 woah that looks better than i imagined :]

@LousyBook94
Copy link

@samhvw8 you should probably link this pr to the issue too

@samhvw8
Copy link
Contributor Author

samhvw8 commented May 12, 2025

@LousyBook94 already linked you can check above pr description

@samhvw8 woah that looks better than i imagined :]

thanks for your review, can you try it local ?

@cte @sachasayan if you have time can you review it for me ?

@samhvw8 samhvw8 force-pushed the feat/mcp-viewer branch 2 times, most recently from 6a1191e to f28846d Compare May 12, 2025 23:00
@hannesrudolph hannesrudolph moved this from New to PR [Pre Approval Review] in Roo Code Roadmap May 14, 2025
bgilbert6 pushed a commit to bgilbert6/Roo-Code that referenced this pull request May 14, 2025
* protos report bug

* changeset
@samhvw8 samhvw8 force-pushed the feat/mcp-viewer branch 2 times, most recently from 78d4ee9 to 98b091b Compare May 15, 2025 16:24
@hannesrudolph hannesrudolph moved this from New to PR [Pre Approval Review] in Roo Code Roadmap May 20, 2025
@hannesrudolph hannesrudolph moved this from PR [Needs Review] to TEMP in Roo Code Roadmap May 26, 2025
@daniel-lxs daniel-lxs moved this from TEMP to PR [Needs Review] in Roo Code Roadmap May 27, 2025
Copy link
Member

Choose a reason for hiding this comment

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

I noticed there are 4 separate for loops here. Should we consider combining these to optimize performance?

The MCP processing loops could potentially be merged, and we might be able to build the result array directly instead of creating intermediate arrays.

What do you think about refactoring this to use fewer loops?

@daniel-lxs
Copy link
Member

Hey @samhvw8 this is pretty cool, I am curious about the UI, do you think we should keep these new styles or make the styles match our current ones for consistency?

@daniel-lxs daniel-lxs moved this from PR [Needs Prelim Review] to PR [Changes Requested] in Roo Code Roadmap Jun 4, 2025
@samhvw8
Copy link
Contributor Author

samhvw8 commented Jun 4, 2025

Hey @samhvw8 this is pretty cool, I am curious about the UI, do you think we should keep these new styles or make the styles match our current ones for consistency?

Ok let me do that

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Jun 6, 2025
@daniel-lxs daniel-lxs moved this from PR [Changes Requested] to PR [Needs Review] in Roo Code Roadmap Jun 6, 2025
@samhvw8
Copy link
Contributor Author

samhvw8 commented Jun 6, 2025

This looks awesome!

yeah, thanks for help me to complete this PR <3

@daniel-lxs daniel-lxs moved this from PR [Needs Review] to PR [Changes Requested] in Roo Code Roadmap Jun 8, 2025
@daniel-lxs daniel-lxs moved this from PR [Changes Requested] to PR [Needs Review] in Roo Code Roadmap Jun 8, 2025
@samhvw8 samhvw8 force-pushed the feat/mcp-viewer branch 2 times, most recently from 9df793d to 53a90aa Compare June 9, 2025 15:46
Copy link
Member

@daniel-lxs daniel-lxs left a comment

Choose a reason for hiding this comment

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

Hey @samhvw8, Thank you for fixing the test due to the new translations keys I added.

LGTM

samhvw8 and others added 7 commits June 12, 2025 10:05
- Add McpExecutionStatus type with discriminated union for execution states
- Implement McpExecution component with live status updates and collapsible output
- Replace inline MCP UI in ChatRow with dedicated McpExecution component
- Add comprehensive test coverage for useMcpToolTool
- Enhance CodeAccordian to support custom headers
- Improve combineCommandSequences to handle MCP execution flows
- Reduced from 3 separate loops to 1 main processing loop
- Improved time complexity from O(n²) to O(n)
- Reduced total passes through array from 4 to 2
- Better memory access patterns and cache utilization
@samhvw8
Copy link
Contributor Author

samhvw8 commented Jun 12, 2025

@daniel-lxs i just sync with latest change, can you check it again
@mrubens is that this look good ?

@mrubens
Copy link
Collaborator

mrubens commented Jun 12, 2025

This one might be a particularly tough example because of the repeated long name, but it does seem like a lot of duplicated information in the new MCP execution toolbar (and it pushes the status and the caret out of the bounding box)

Screenshot 2025-06-11 at 11 40 42 PM

Copy link
Member

@daniel-lxs daniel-lxs left a comment

Choose a reason for hiding this comment

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

This looks much better, made a tweak to remove some repeated text.

image

And the text should wrap properly now.

@mrubens mrubens merged commit a9c1dad into RooCodeInc:main Jun 12, 2025
9 checks passed
@github-project-automation github-project-automation bot moved this from PR [Pre Approval Review] to Done in Roo Code Roadmap Jun 12, 2025
@github-project-automation github-project-automation bot moved this from PR [Needs Review] to Done in Roo Code Roadmap Jun 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request lgtm This PR has been approved by a maintainer PR - Needs Review size:XXL This PR changes 1000+ lines, ignoring generated files.

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Some Responses from MCP taking too much space

4 participants