ext-apps/examples/basic-server-react
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Jonathan Hefner 8bff1dff68 Add dynamic example orchestration script
Replace hardcoded port assignments and npm scripts with run-all.ts that:
- Auto-discovers example directories and assigns ports
- Passes server URLs to basic-host via SERVERS env var
- Supports start, dev, and build commands

Update basic-host to fetch server list from /api/servers endpoint
and display server names from MCP server metadata.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-08 16:34:52 -06:00
..
src Use content instead of structuredContent in examples 2025-12-05 16:35:20 -06:00
mcp-app.html Add basic-host and basic-server-react examples 2025-12-04 14:28:27 -06:00
package.json Add basic-host and basic-server-react examples 2025-12-04 14:28:27 -06:00
README.md Add basic-server-vanillajs example 2025-12-04 14:28:27 -06:00
server.ts Add dynamic example orchestration script 2025-12-08 16:34:52 -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.