feat(basic-host): improve host UI with collapsible panels and SDK types#244
Merged
feat(basic-host): improve host UI with collapsible panels and SDK types#244
Conversation
- Import McpUiUpdateModelContextRequest and McpUiMessageRequest from SDK - Replace custom ModelContext with McpUiUpdateModelContextRequest['params'] - Replace custom AppMessage with McpUiMessageRequest['params'] - Pass full message params instead of extracting text - Format messages by extracting text from content blocks in display
- Add formatContentBlock helper for text, image, audio, resource types - Show placeholders like <image: image/png> for non-text content - Apply to both messages and model context display
@modelcontextprotocol/ext-apps
@modelcontextprotocol/server-basic-react
@modelcontextprotocol/server-basic-vanillajs
@modelcontextprotocol/server-budget-allocator
@modelcontextprotocol/server-cohort-heatmap
@modelcontextprotocol/server-customer-segmentation
@modelcontextprotocol/server-scenario-modeler
@modelcontextprotocol/server-system-monitor
@modelcontextprotocol/server-threejs
@modelcontextprotocol/server-wiki-explorer
commit: |
jonathanhefner
approved these changes
Jan 12, 2026
Member
jonathanhefner
left a comment
There was a problem hiding this comment.
Looks nice!
Since the tool input is no longer side-by-side with the iframe, do we want to set a narrower max-width for the main element?
Contributor
Author
Thanks! (i'll tell Claude)
Good idea for a follow up, will push this first |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Improves the basic-host example with better UI organization and proper SDK type usage.
e.g. w/ upcoming transcription app:
Changes
Collapsible Panels UI
CollapsiblePanelcomponentServerName:tool_nameSDK Type Integration
ModelContextwithMcpUiUpdateModelContextRequest['params']AppMessagewithMcpUiMessageRequest['params']@modelcontextprotocol/ext-apps/app-bridgeContent Block Handling
<image: image/png>for non-text contentupdateModelContext Support
updateModelContext: { text: {} }capabilityonupdatemodelcontexthandlerOther
AppBridgeCallbacksinterface for cleaner callback handling