Skip to content

Comments

fix: silently hide MCP UI on errors#10660

Open
RomneyDa wants to merge 1 commit intomainfrom
mcp-ui-happy
Open

fix: silently hide MCP UI on errors#10660
RomneyDa wants to merge 1 commit intomainfrom
mcp-ui-happy

Conversation

@RomneyDa
Copy link
Collaborator

@RomneyDa RomneyDa commented Feb 19, 2026

Summary

  • When an MCP UI app encounters errors (e.g. it can't handle a particular tool's data), the UI now silently hides instead of showing broken/confusing content like "Unable to parse tool results"
  • Wraps sendToolInput and sendToolResult bridge calls in try/catch so failures hide the UI gracefully
  • Listens for error/critical log messages from the MCP app via the bridge and hides UI in response

Context

MCP servers may set _meta.ui.resourceUri on tools where the UI app can't actually handle that tool's data. The detection of whether a tool has UI is correct (we trust the server's metadata), but we need to be resilient when the UI app can't render.

Test plan

  • Verify MCP tools with working UI still render correctly
  • Verify MCP tools where the UI app can't handle the data no longer show error messages — the UI simply doesn't appear
  • Verify bridge connection failures result in no UI rather than a red error box

Summary by cubic

Silently hide the MCP UI when the embedded app errors, instead of showing confusing error boxes. This makes incompatible tool UIs fail closed while keeping functional UIs unaffected.

  • Bug Fixes
    • Return null on MCP app errors or error/critical logs from the bridge.
    • Wrap sendToolInput and sendToolResult in try/catch; on failure, set error and hide UI.
    • Avoid rendering the red error box; no UI appears when the app can’t render.

Written for commit fdede37. Summary will update on new commits.

When an MCP UI app can't handle a tool's data (e.g. server tags
non-UI tools with ui/resourceUri), hide the UI rather than showing
confusing error messages. Changes:
- Return null on error instead of rendering red error box
- Wrap sendToolInput/sendToolResult in try/catch
- Hide UI when MCP app reports error/critical via bridge logging
@RomneyDa RomneyDa requested a review from a team as a code owner February 19, 2026 22:53
@RomneyDa RomneyDa requested review from sestinj and removed request for a team February 19, 2026 22:53
@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Feb 19, 2026
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 1 file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M This PR changes 30-99 lines, ignoring generated files.

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

1 participant