-
Notifications
You must be signed in to change notification settings - Fork 61
Improve consistency and organization of examples for AI learning #252
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve consistency and organization of examples for AI learning #252
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: |
|
|
||
| ## 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). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They don't need to be in a single file! If they're not, they need to define the correct _meta.ui.csp.resourceDomains
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oof, right! Updated!
ochafik
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
.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.