Improve consistency and organization of examples for AI learning#252
Merged
jonathanhefner merged 1 commit intomodelcontextprotocol:mainfrom Jan 14, 2026
Merged
Conversation
@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: |
ochafik
reviewed
Jan 14, 2026
|
|
||
| ## Build System | ||
|
|
||
| MCP Apps must be bundled into a single HTML file because the UI is served as an MCP resource, not from a web server. This example uses Vite with `vite-plugin-singlefile` to inline all assets. See [`vite.config.ts`](vite.config.ts). |
Contributor
There was a problem hiding this comment.
They don't need to be in a single file! If they're not, they need to define the correct _meta.ui.csp.resourceDomains
Member
Author
There was a problem hiding this comment.
Oof, right! Updated!
ochafik
previously approved these changes
Jan 14, 2026
Contributor
ochafik
left a comment
There was a problem hiding this comment.
LG w/ comment about single file builds to amend in a few places :-)
- Add `.gitignore` files to all 19 examples (`node_modules/`, `dist/`) - Replace custom `log` objects with standard `console` methods - Add `ontoolcancelled` handler to all `basic-server-*` examples - Add host styling integration (`applyDocumentTheme`, `applyHostFonts`, `applyHostStyleVariables`) to non-React `basic-server-*` examples - Add section headers for better code organization in feature examples - Update READMEs with Build System section explaining single-file bundling These changes make examples more consistent and easier to adapt. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
24dce11 to
4140565
Compare
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.
.gitignorefiles to all 19 examples (node_modules/,dist/)logobjects with standardconsolemethodsontoolcancelledhandler to allbasic-server-*examplesapplyDocumentTheme,applyHostFonts,applyHostStyleVariables) to non-Reactbasic-server-*examplesThese changes make examples more consistent and easier to adapt.