Skip to content

MCP Tool Call UI#2322

Open
ngafar wants to merge 1 commit into
devfrom
feat/mcp-client-show-responses
Open

MCP Tool Call UI#2322
ngafar wants to merge 1 commit into
devfrom
feat/mcp-client-show-responses

Conversation

@ngafar
Copy link
Copy Markdown
Collaborator

@ngafar ngafar commented May 14, 2026

Description

Added a UI element to the Agent mode, so users can see the tool call request and response.

Testing

Trigger a tool call, look at the UI element.

Documentation

Not needed -- this should be self-explanatory. Click and see.


Note

Medium Risk
Adds new agent tool-call UI and changes how tool results are persisted/rehydrated and attached to chat history, which can affect chat rendering and ordering in the agent websocket flow.

Overview
Adds first-class support for mcp_tool_call agent responses in the frontend: a new collapsible MCPToolCallToolUI renders the MCP request args and the eventual response/error, and chat messages no longer disappear when the assistant message has no text but needs tool UI.

Updates agent execution + chat history handling to store/attach MCP tool outputs/errors to the latest MCP tool-call message (including on reload via persisted “next user message” rehydration), and updates the backend display-optimized tool-result persistence to save MCP outputs/errors for UI rehydration.

Reviewed by Cursor Bugbot for commit caa42ed. Configure here.

@vercel
Copy link
Copy Markdown

vercel Bot commented May 14, 2026

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

Project Deployment Actions Updated (UTC)
monorepo Ready Ready Preview, Comment May 14, 2026 7:04pm

Request Review

Copy link
Copy Markdown

@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.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit caa42ed. Configure here.

displayOptimizedChatItem = {
...displayOptimizedChatItem,
mcpToolResult: nextItemMessageContent
};
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Rehydration loses MCP error state, shows errors as results

Medium Severity

When rehydrating persisted chat history, the MCP tool call result is always stored as mcpToolResult, even when the backend persisted an error message. The backend's create_display_optimized_tool_result_message stores either the success output or the error_message into the same content field, but the rehydration code unconditionally assigns it to mcpToolResult and never sets mcpToolError. After a page reload, MCPToolCallToolUI won't see mcpToolError, so failed tool calls display with normal styling instead of error styling.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit caa42ed. Configure here.

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