ext-apps/examples/basic-server-react
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Olivier Chafik d9006bd69a
feat: make MCP SDK a peer dependency (#168)
* feat: make MCP SDK a peer dependency

- Move @modelcontextprotocol/sdk from dependencies to peerDependencies (^1.20.0)
- Add to devDependencies for local development (^1.24.3)
- Externalize SDK from all build entry points (app, app-bridge, react, server)

Benefits:
- Consumers control their SDK version
- Deduplication when consumer already has SDK
- Follows pattern of react/zod peer deps

* fix: require SDK ^1.24.0 for Zod 4 compatibility

Earlier SDK versions have Zod type incompatibilities that cause build errors.

* chore: update examples to SDK ^1.24.0 to match peer dep
2025-12-16 22:09:59 +00:00
..
src refactor: rename request methods to remove send prefix (#161) 2025-12-16 22:07:06 +00:00
mcp-app.html Add color-scheme meta tag to all example apps 2025-12-15 11:42:18 -08:00
package.json feat: make MCP SDK a peer dependency (#168) 2025-12-16 22:09:59 +00:00
README.md refactor: rename request methods to remove send prefix (#161) 2025-12-16 22:07:06 +00:00
server.ts feat: add server helpers, make connect() to default to parent post transport (#165) 2025-12-16 21:25:26 +00: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.