Skip to content

Commit 574a768

Browse files
authored
feat: add example gallery with auto-generated screenshots (#253)
* feat: add script to generate 300x300 grid-cell.png screenshots for examples - Add generate-grid-screenshots.spec.ts Playwright test to capture screenshots - Add npm run generate:screenshots command (Docker-based for Santa compatibility) - Add sharp dependency for image resizing with centered-fill mode - Generate grid-cell.png for 14 example servers (only React for basic-server-* series) The screenshots are 300x300 PNG images cropped with centered fill mode, suitable for use in a grid layout showcasing the examples. * docs: add example gallery grid to README Add a 3-column visual grid showcasing 14 example MCP Apps with: - Thumbnail screenshots (300x300 grid-cell.png) - Clickable links to example directories - Hover tooltips with brief descriptions Organized by visual impact: 3D/WebGL examples first, then visualizations, charts, monitoring, and starter templates. * fix: use aspect-fit instead of crop for screenshots Change from fit: 'cover' (crops) to fit: 'contain' (letterbox) so the full app content is visible without cropping. * feat: improve screenshot generation - Constrain viewport to 500px width for consistent rendering - Wait 5 seconds for full app load (tiles, animations, data) - Screenshot just the inner iframe (no extra whitespace) - Save both screenshot.png (full-size) and grid-cell.png (300x300 thumbnail) - Use contain mode to preserve aspect ratio * fix: use cover mode with top alignment for grid thumbnails No letterboxing - crops to fill 300x300, aligned to top so headers and important content are always visible. * feat: improve screenshot gallery - Remove integration-server from gallery (it's for E2E testing only) - Add 30s extra wait for Map and Video servers to load fully - Improve Three.js default scene: isometric rotation + better lighting - Update README: Starter Templates row with links to all framework variants (React, Vue, Svelte, Preact, Solid, Vanilla JS) - Regenerate all screenshots with updated settings * fix: improve README gallery layout - Fix uneven column widths by using minimal separator - Move Starter Templates to separate 2-cell table with description - Add screenshot.png to top of each example README (13 examples) - Shorten tooltips for cleaner table * revert to document.write again; cesiumjs doesn't like srcdoc, period. * fix: map-server screenshot now renders properly - Merged ochafik/post-fixes which reverts sandbox from srcdoc to document.write (CesiumJS doesn't work with srcdoc iframes) - Fixed map-server name in screenshot test ('Map Server' not 'CesiumJS Map Server') - Simplified screenshot generation script (removed complex debugging code) - Increased map-server wait time to 45s for reliable tile loading - Regenerated all 13 screenshots * fix: remove redundant screenshots from READMEs Remove the simple \![Screenshot](screenshot.png) line from READMEs that already had nicer HTML table screenshots. Keep it only for examples that didn't have existing screenshots. * docs: move gallery to Examples section - Move screenshot gallery from top of README to Examples section - Remove redundant list of basic examples (now shown visually in gallery) - Clean up duplicate run instructions * fix: remove empty header row from starter templates table * fix: remove empty header rows from both tables * fix: add prettier-ignore to prevent table header expansion * feat: use custom screenshot for video-resource-server - Use better screenshot from PR #253 comment showing actual video playback - Skip video-resource-server in screenshot generation script - Add SKIP_SERVERS set for manually maintained screenshots * fix: revert unrelated map-server name change * fix: use correct server name 'CesiumJS Map Server' in screenshot test
1 parent 8fa2961 commit 574a768

38 files changed

Lines changed: 819 additions & 44 deletions

File tree

README.md

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -56,19 +56,28 @@ Or edit your `package.json` manually:
5656

5757
## Examples
5858

59-
Start with these foundational examples to learn the SDK:
60-
61-
- [`examples/basic-server-vanillajs`](https://github.com/modelcontextprotocol/ext-apps/tree/main/examples/basic-server-vanillajs) — MCP server + MCP App using vanilla JS
62-
- [`examples/basic-server-react`](https://github.com/modelcontextprotocol/ext-apps/tree/main/examples/basic-server-react) — MCP server + MCP App using [React](https://github.com/facebook/react)
63-
- [`examples/basic-server-vue`](https://github.com/modelcontextprotocol/ext-apps/tree/main/examples/basic-server-vue) — MCP server + MCP App using [Vue](https://github.com/vuejs/vue)
64-
- [`examples/basic-server-svelte`](https://github.com/modelcontextprotocol/ext-apps/tree/main/examples/basic-server-svelte) — MCP server + MCP App using [Svelte](https://github.com/sveltejs/svelte)
65-
- [`examples/basic-server-preact`](https://github.com/modelcontextprotocol/ext-apps/tree/main/examples/basic-server-preact) — MCP server + MCP App using [Preact](https://github.com/preactjs/preact)
66-
- [`examples/basic-server-solid`](https://github.com/modelcontextprotocol/ext-apps/tree/main/examples/basic-server-solid) — MCP server + MCP App using [Solid](https://github.com/solidjs/solid)
67-
- [`examples/basic-host`](https://github.com/modelcontextprotocol/ext-apps/tree/main/examples/basic-host) — MCP host application supporting MCP Apps
59+
<!-- prettier-ignore-start -->
60+
| | | |
61+
|:---:|:---:|:---:|
62+
| [![Map](examples/map-server/grid-cell.png "Interactive 3D globe viewer using CesiumJS")](examples/map-server) | [![Three.js](examples/threejs-server/grid-cell.png "Interactive 3D scene renderer")](examples/threejs-server) | [![ShaderToy](examples/shadertoy-server/grid-cell.png "Real-time GLSL shader renderer")](examples/shadertoy-server) |
63+
| [**Map**](examples/map-server) | [**Three.js**](examples/threejs-server) | [**ShaderToy**](examples/shadertoy-server) |
64+
| [![Sheet Music](examples/sheet-music-server/grid-cell.png "ABC notation to sheet music")](examples/sheet-music-server) | [![Wiki Explorer](examples/wiki-explorer-server/grid-cell.png "Wikipedia link graph visualization")](examples/wiki-explorer-server) | [![Cohort Heatmap](examples/cohort-heatmap-server/grid-cell.png "Customer retention heatmap")](examples/cohort-heatmap-server) |
65+
| [**Sheet Music**](examples/sheet-music-server) | [**Wiki Explorer**](examples/wiki-explorer-server) | [**Cohort Heatmap**](examples/cohort-heatmap-server) |
66+
| [![Scenario Modeler](examples/scenario-modeler-server/grid-cell.png "SaaS business projections")](examples/scenario-modeler-server) | [![Budget Allocator](examples/budget-allocator-server/grid-cell.png "Interactive budget allocation")](examples/budget-allocator-server) | [![Customer Segmentation](examples/customer-segmentation-server/grid-cell.png "Scatter chart with clustering")](examples/customer-segmentation-server) |
67+
| [**Scenario Modeler**](examples/scenario-modeler-server) | [**Budget Allocator**](examples/budget-allocator-server) | [**Customer Segmentation**](examples/customer-segmentation-server) |
68+
| [![System Monitor](examples/system-monitor-server/grid-cell.png "Real-time OS metrics")](examples/system-monitor-server) | [![Transcript](examples/transcript-server/grid-cell.png "Live speech transcription")](examples/transcript-server) | [![Video Resource](examples/video-resource-server/grid-cell.png "Binary video via MCP resources")](examples/video-resource-server) |
69+
| [**System Monitor**](examples/system-monitor-server) | [**Transcript**](examples/transcript-server) | [**Video Resource**](examples/video-resource-server) |
70+
71+
### Starter Templates
72+
73+
| | |
74+
|:---:|:---|
75+
| [![Basic](examples/basic-server-react/grid-cell.png "Starter template")](examples/basic-server-react) | The same app built with different frameworks — pick your favorite!<br><br>[React](examples/basic-server-react) · [Vue](examples/basic-server-vue) · [Svelte](examples/basic-server-svelte) · [Preact](examples/basic-server-preact) · [Solid](examples/basic-server-solid) · [Vanilla JS](examples/basic-server-vanillajs) |
76+
<!-- prettier-ignore-end -->
6877

6978
The [`examples/`](https://github.com/modelcontextprotocol/ext-apps/tree/main/examples) directory contains additional demo apps showcasing real-world use cases.
7079

71-
To run all examples together:
80+
To run all examples:
7281

7382
```bash
7483
npm install

examples/basic-server-react/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Example: Basic Server (React)
22

3+
![Screenshot](screenshot.png)
4+
35
An MCP App example with a React UI.
46

57
> [!TIP]
24.9 KB
Loading
20.8 KB
Loading
32.5 KB
Loading
39.5 KB
Loading
49 KB
Loading
63.9 KB
Loading
39.1 KB
Loading
55.1 KB
Loading

0 commit comments

Comments
 (0)