Skip to content

Conversation

@aharvard
Copy link
Collaborator

@aharvard aharvard commented Aug 6, 2025

This PR upgrades the MCP-UI dependency to version ~5.6.2 and adapts to the internalized auto iframe resizing functionality. Also, it sprinkles in some toast notification for user feedback (even tho functionality is simply stubbed out).

goose-mcp-ui-upgrade-compressed.mov

Changes

Package Updates

  • Upgraded @mcp-ui/client from version 5.5.0 to ~5.6.2 in ui/desktop/package.json

Code Changes

  • MCPUIResourceRenderer.tsx: Added autoResizeIframe: true to the htmlProps configuration for the UIResourceRenderer component to enable automatic iframe resizing
  • ToolCallWithResponse.tsx: Updated the MCP UI resource rendering logic to properly handle the new iframe resizing behavior

Background

The MCP-UI library has internalized the auto iframe resizing functionality in version 5.6.2. Previously, this functionality may have been handled externally or through different configuration. This update ensures that MCP UI resources (like interactive forms, visualizations, etc.) automatically resize their iframes to fit their content, providing a better user experience.

MCP UI Action Handling & Debugging

This implementation includes comprehensive logging and user feedback for MCP UI interactions:

Console Logging

All MCP UI actions are logged to the browser console with detailed information about the action type and payload. This helps with debugging and understanding what interactions are occurring within MCP UI resources.

Toast Notifications

When MCP UI resources send postMessage events to the parent application, users receive toast notifications indicating:

  • The type of action that was triggered (tool, intent, prompt, notify, link)
  • A message directing users to check the console for detailed information
  • The action data is attached to the toast for programmatic access

Supported Action Types

The implementation handles all standard MCP UI action types as defined in the MCP-UI protocol:

  • tool: Tool execution requests with toolName and params
  • intent: Intent-based actions with intent and params
  • prompt: Prompt display requests with prompt text
  • notify: Notification messages with message content
  • link: Link navigation requests with url

Current Implementation Status

The current implementation provides logging and toast feedback as a foundation, with TODO comments indicating where full action handling will be implemented in the future. This approach ensures that:

  1. No MCP UI interactions are silently ignored
  2. Developers can see exactly what actions are being triggered
  3. Users get immediate feedback that their interactions were received
  4. The groundwork is laid for full MCP UI action handling

Testing

  • Verified that MCP UI resources render correctly
  • Confirmed that iframes automatically resize to fit content
  • Tested with various MCP UI resource types
  • Verified console logging works for all action types
  • Confirmed toast notifications appear for user interactions

Notes

This is a relatively straightforward dependency upgrade with minimal code changes to adapt to the new API. The main change is explicitly enabling the autoResizeIframe option in the renderer configuration, plus comprehensive action logging for debugging and user feedback.

@aharvard aharvard marked this pull request as ready for review August 6, 2025 15:37
@aharvard aharvard marked this pull request as draft August 6, 2025 15:41
Comment on lines +57 to +63
<div className="mt-3 p-4 py-3 border border-borderSubtle rounded-lg bg-background-muted flex items-center">
<FlaskConical className="mr-2" size={20} />
<div className="text-sm font-medium mono">
MCP UI is experimental and may change at any time.
</div>
</>
);
} else {
return <MCPUIResourceRenderer key={`${content.type}-${index}`} content={content} />;
}
</div>
</div>
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

decided to simplify and always show the info box

Comment on lines +68 to +71
autoResizeIframe: {
height: true,
width: false, // set to false to allow for responsive design
},
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

mcp-ui add this based on our feedback

};
};
import { useCallback } from 'react';
import { toast } from 'react-toastify';
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

popin' some toast for user feedback, as we work to make the action handling real

@aharvard aharvard marked this pull request as ready for review August 6, 2025 19:58
@aharvard
Copy link
Collaborator Author

aharvard commented Aug 6, 2025

.bundle

"@ai-sdk/ui-utils": "^1.0.2",
"@hey-api/client-fetch": "^0.8.1",
"@mcp-ui/client": "~5.3.1",
"@mcp-ui/client": "~5.6.2",
Copy link
Collaborator

Choose a reason for hiding this comment

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

if you'd like you can also move this back to "^5.6.1" -- since merging #3859 we're respecting the lock file on all platforms

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

cool, will do in the next pr related to mcp-ui

@aharvard aharvard merged commit a646c7a into main Aug 6, 2025
11 checks passed
@aharvard aharvard deleted the fix/mcp-ui-auto-iframe-resizing branch August 6, 2025 20:27
@github-actions
Copy link
Contributor

github-actions bot commented Aug 6, 2025

macOS ARM64 Desktop App (Apple Silicon)

📱 Download macOS Desktop App (arm64, signed)

Instructions:
After downloading, unzip the file and drag the Goose.app to your Applications folder. The app is signed and notarized for macOS.

This link is provided by nightly.link and will work even if you're not logged into GitHub.

katzdave added a commit that referenced this pull request Aug 6, 2025
* 'main' of github.com:block/goose:
  Upgrade to MCP-UI ~5.6.2 and handle internalized auto iframe resizing (#3889)
  docs: recipe updates (#3844)
  added notes about reducing context window by referencing external files (#3895)
michaelneale added a commit that referenced this pull request Aug 7, 2025
* main:
  Upgrade to MCP-UI ~5.6.2 and handle internalized auto iframe resizing (#3889)
  docs: recipe updates (#3844)
  added notes about reducing context window by referencing external files (#3895)
  Make the window title reflect what we are doing (#3883)
  additional metrics + Ui implementation (#3871)
  feat: Add session description editing functionality (#3819)
  Update filename in contributing docs (#3866)
  Fix voice dictation provider selection bug (#3862)
  doc: Update supported container runtimes (#3874)
  feat: add OAuth provider abstraction for CLI configuration (#3157)
  Don't ignore lockfiles on linux/windows builds (#3859)
  Use RMCP for StreamableHTTP OAuth support (#3845)
  Try to keep key order for Databricks (#3876)
  Fix OpenAI Provider with GitHub Models (#3875)
  Cmd click open finder (#3807)
  fix: recipe parameter form max height and not scrolling (#3879)
@aharvard
Copy link
Collaborator Author

aharvard commented Aug 7, 2025

posting for awareness:

📱 Download macOS Desktop App (arm64, signed) is not actially signed.

run xattr -r -d com.apple.quarantine path/to/Goose.app to remove the "quarantine" attribute.

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.

4 participants