ext-apps/examples/basic-server-react
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Jonathan Hefner 94bc708963 Replace deprecated RESOURCE_URI_META_KEY with _meta.ui.resourceUri
Update all example servers to use the new recommended metadata format
for associating UI resources with tools. The old `RESOURCE_URI_META_KEY`
constant is deprecated in favor of the nested `_meta.ui.resourceUri`
structure.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-12 13:00:11 -06:00
..
src feat: publish example servers to npm (#184) 2026-01-08 20:08:50 +00:00
mcp-app.html Add color-scheme meta tag to all example apps 2025-12-15 11:42:18 -08:00
package.json chore: release 0.3.1 (#224) 2026-01-09 18:22:27 +00:00
README.md refactor: rename request methods to remove send prefix (#161) 2025-12-16 22:07:06 +00:00
server-utils.ts fix: add error handling for server startup failures (#236) 2026-01-11 16:52:55 +00:00
server.ts Replace deprecated RESOURCE_URI_META_KEY with _meta.ui.resourceUri 2026-01-12 13:00:11 -06:00
tsconfig.json Add basic-host and basic-server-react examples 2025-12-04 14:28:27 -06:00
vite.config.ts Add basic-host and basic-server-react examples 2025-12-04 14:28:27 -06:00

Example: Basic Server (React)

An MCP App example with a React UI.

Tip

Looking for a vanilla JavaScript example? See basic-server-vanillajs!

Overview

Key Files

Getting Started

npm install
npm run dev

How It Works

  1. The server registers a get-time tool with metadata linking it to a UI HTML resource (ui://get-time/mcp-app.html).
  2. When the tool is invoked, the Host renders the UI from the resource.
  3. The UI uses the MCP App SDK API to communicate with the host and call server tools.