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:
parent
d87c1262cc
commit
c872ecd224
1 changed files with 1459 additions and 83 deletions
21
vite.config.ts
Normal file
21
vite.config.ts
Normal 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,
|
||||
},
|
||||
},
|
||||
});
|
||||
Loading…
Reference in a new issue