8000 refactor(copilot): add MCP call detection and display component by ysfscream · Pull Request #1902 · emqx/MQTTX · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

refactor(copilot): add MCP call detection and display component #1902

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 20, 2025

Conversation

ysfscream
Copy link
Member

PR Checklist

If you have any questions, you can refer to the Contributing Guide

What is the current behavior?

Currently, the Copilot component uses vue-markdown directly to render all content. MCP calls (enclosed in <mcp-call> tags) are displayed as raw text without special handling, making it difficult for users to distinguish and interact with them.

Issue Number

N/A

What is the new behavior?

  • Added a new MessageRender component to handle message content parsing
  • Created a new MCPCallCard component with collapsible display for MCP calls
  • Modified CopilotMessages to use the new component structure
  • Enhanced MCP call display with server and tool name extraction
  • Improved the visual styling to match the existing UI theme better
  • Added collapsible functionality for MCP calls (collapsed by default)

Visual changes:

  • MCP calls are now displayed in a distinguished card
  • MCP calls show the server and tool name being called
  • Users can expand/collapse MCP call details
  • Success/failure states for MCP results have appropriate visual cues
image image

Does this PR introduce a breaking change?

  • Yes
  • No

Specific Instructions

The new implementation maintains all existing functionality while adding enhanced MCP call detection and display. The changes are non-invasive and fully backward compatible.

Other information

This refactoring improves code organization by separating concerns between message rendering and MCP call handling, making the codebase more maintainable and easier to extend with additional features in the future.

@ysfscream ysfscream added enhancement New feature or request feature This pr is a feature refactor Refactor code or architecture desktop MQTTX Desktop labels Mar 20, 2025
@ysfscream ysfscream added this to the v1.12.0 milestone Mar 20, 2025
@ysfscream ysfscream requested a review from Red-Asuka March 20, 2025 09:31
@ysfscream ysfscream self-assigned this Mar 20, 2025
@ysfscream ysfscream added this to MQTTX Mar 20, 2025
@github-project-automation github-project-automation bot moved this to In Progress in MQTTX Mar 20, 2025
@Red-Asuka Red-Asuka merged commit 0a0575d into main Mar 20, 2025
4 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in MQTTX Mar 20, 2025
@Red-Asuka Red-Asuka deleted the ysf/desktop branch March 20, 2025 09:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
desktop MQTTX Desktop enhancement New feature or request feature This pr is a feature refactor Refactor code or architecture
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants
0