package
Basic MCP App Server example using React
npm install @modelcontextprotocol/server-basic-reactGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.

An MCP App example with a React UI.
[!TIP] Looking for a vanilla JavaScript example? See
basic-server-vanillajs!
Add to your MCP client configuration (stdio transport):
{
"mcpServers": {
"basic-react": {
"command": "npx",
"args": [
"-y",
"--silent",
"--registry=https://registry.npmjs.org/",
"@modelcontextprotocol/server-basic-react",
"--stdio"
]
}
}
}To test local modifications, use this configuration (replace ~/code/ext-apps with your clone path):
{
"mcpServers": {
"basic-react": {
"command": "bash",
"args": [
"-c",
"cd ~/code/ext-apps/examples/basic-server-react && npm run build >&2 && node dist/index.js --stdio"
]
}
}
}useApp() hookcallServerTool, sendMessage, sendLog, server.ts - MCP server with tool and resource registrationmcp-app.html / src/mcp-app.tsx - React UI using useApp() hooknpm install
npm run devget-time tool with metadata linking it to a UI HTML resource (ui://get-time/mcp-app.html).This example bundles into a single HTML file using Vite with vite-plugin-singlefile — see vite.config.ts. This allows all UI content to be served as a single MCP resource. Alternatively, MCP apps can load external resources by defining _meta.ui.csp.resourceDomains in the UI resource metadata.
pcarleton
paul@modelcontextprotocol.io
openLinkEstimated unpacked size across 62 packages.
37.5 MB+
Includes dependencies.
2.0.0
2.4.0
2.0.2
2.0.4