Add MCP Apps hello world demo tool

Implements a simple MCP Apps tool that returns an interactive React UI:

- Add `mcp_apps_hello_world` tool with `_meta.ui/resourceUri` metadata
- Add resource handler for `ui://hello-world/app.html` returning HTML
- Create React app using `@modelcontextprotocol/ext-apps/react` hooks
- Add Vite build tooling to bundle React apps into single HTML files

The tool demonstrates the MCP Apps extension (SEP-1865) which allows
MCP servers to return interactive UI that runs in the client.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Jerome Swannack 2025-12-07 17:55:06 +00:00
commit c872ecd224
No known key found for this signature in database

21
vite.config.ts Normal file
View file

@ -0,0 +1,21 @@
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import { viteSingleFile } from "vite-plugin-singlefile";
import path from "path";
const input = process.env.INPUT;
if (!input) {
throw new Error("INPUT environment variable is required");
}
export default defineConfig({
plugins: [react(), viteSingleFile()],
root: path.dirname(input),
build: {
outDir: path.resolve("dist/apps"),
emptyOutDir: false,
rollupOptions: {
input: input,
},
},
});