Skip to content

Conversation

@gabe4coding
Copy link

@gabe4coding gabe4coding commented Nov 27, 2025

Introduce functionality for requesting and handling display mode changes in the AppRenderer and McpClientApp components.

Motivation and Context

This change allows the guest UI to request different display modes (inline, fullscreen, pip, carousel) from the host, enhancing user experience and flexibility in UI presentation.
This feature is part of OpenAI Apps SDK.

How Has This Been Tested?

Tested in a development environment by simulating display mode requests and verifying the responses and state updates in the UI.

Breaking Changes

No breaking changes are introduced.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Additional context

The implementation includes a new request handler in the AppBridge for display mode changes and updates to the UI components to reflect the current display mode. Documentation for the new JSON-RPC method has also been added.

@antonpk1
Copy link
Collaborator

thanks Gabe! I think this is perfect. could you please rebase/resolve branch conflicts so we can ship this?

@gabe4coding gabe4coding force-pushed the feat/request-display-mode branch from a7e2ce2 to 40897df Compare December 12, 2025 17:28
Add ui/request-display-mode JSON-RPC method that allows apps to request
display mode changes from the host.

- Add McpUiRequestDisplayModeRequest and McpUiRequestDisplayModeResult types
- Add requestDisplayMode() method to App class for guest UI
- Add onrequestdisplaymode handler to AppBridge for host-side handling
- Update specification documentation with new JSON-RPC method
- Regenerate schemas
@gabe4coding gabe4coding force-pushed the feat/request-display-mode branch from 40897df to b51ccef Compare December 12, 2025 17:41
@gabe4coding
Copy link
Author

thanks Gabe! I think this is perfect. could you please rebase/resolve branch conflicts so we can ship this?

Hello @antonpk1, i updated the PR 👍🏻

Copy link
Collaborator

@idosal idosal left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution @gabe4coding, great work! 🙏

I left a comment on the spec. I think we should enforce the return value so app developers would be able to rely on it. Thoughts?

@pkg-pr-new
Copy link

pkg-pr-new bot commented Dec 13, 2025

Open in StackBlitz

npm i https://pkg.pr.new/modelcontextprotocol/ext-apps/@modelcontextprotocol/ext-apps@38

commit: b51ccef

@gabe4coding
Copy link
Author

Thanks for the contribution @gabe4coding, great work! 🙏

I left a comment on the spec. I think we should enforce the return value so app developers would be able to rely on it. Thoughts?

LGTM @idosal, this indeed would make the apps logic more clean and robust, relying on it

@gabe4coding gabe4coding requested a review from idosal December 15, 2025 13:04
@idosal
Copy link
Collaborator

idosal commented Dec 15, 2025

Thanks for the contribution @gabe4coding, great work! 🙏
I left a comment on the spec. I think we should enforce the return value so app developers would be able to rely on it. Thoughts?

LGTM @idosal, this indeed would make the apps logic more clean and robust, relying on it

Thanks @gabe4coding ! I see @martinalong also proposed a method to implement it in #152. I quite like the idea of simply returning the current state in the response (though I think it should be mandated as MUST, not SHOULD, for the reasons mentioned above). What do you think?

@martinalong
Copy link
Collaborator

So sorry @gabe4coding , didn't realize you already had a PR out for this when I made #152. I'm new to this whole open source thing haha. Hope ya don't mind that we merged that one to unblock some ppl! Feel free to lmk if there's any suggestions you have for it

@gabe4coding
Copy link
Author

Hello @martinalong no worry, as soon as we have the feature there, i don't mind! Great work! I will close this

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