Minimal reference implementation for building MCP apps with UIs. Python server (FastMCP) + React UI (Synapse SDK).
View on mpak registry | Built by NimbleBrain
# Install server deps
uv sync
# Install UI deps + build
cd ui && npm install && npm run build && cd ..
# Preview (standalone — no NimbleBrain needed)
npx @nimblebrain/synapse preview \
--server "uv run uvicorn mcp_hello.server:app --port 8001" \
--ui ./ui
# Open http://localhost:5180npx @nimblebrain/synapse preview \
--server "uv run uvicorn mcp_hello.server:app --port 8001" \
--ui ./uiThis starts three things:
- :8001 — MCP server (uvicorn, your Python tools)
- :5173 — Vite dev server (React UI with HMR)
- :5180 — Preview harness (minimal bridge host)
Edit ui/src/App.tsx — changes appear instantly at localhost:5180.
cd products/nimblebrain/code
bun run dev --app /path/to/mcp-servers/hello/uiFull platform with Synapse runtime injection, data sync, and all host features.
# stdio mode (Claude Desktop, any MCP client)
uv run python -m mcp_hello.server
# HTTP mode (direct API testing)
uv run uvicorn mcp_hello.server:app --port 8001hello/
├── manifest.json MCPB bundle manifest
├── pyproject.toml Python project config
├── src/mcp_hello/
│ ├── server.py MCP server: tools + UI resource
│ └── ui.py Loads built HTML or inline fallback
└── ui/ Vite + React project
├── package.json
├── vite.config.ts
├── index.html Entry point
└── src/
├── main.tsx React mount
└── App.tsx Components with Synapse hooks
server.pydefines MCP tools (get_greeting,get_greet_count) and a UI resource (ui://hello/main)ui.pyloadsui/dist/index.html(the built single-file React bundle) and serves it as the resource- The UI uses Synapse hooks (
useCallTool,useDataSync,useTheme) for tool calls and host integration - Vite +
vite-plugin-singlefilebundles everything into one HTML file — no external assets
| Host | Tools | UI | Synapse Features |
|---|---|---|---|
| NimbleBrain | Full | Full (React + Synapse) | Data sync, theme, keyboard forwarding |
| Synapse Preview | Full | Full (React + Synapse) | Tool calls, theme toggle |
| Claude Desktop | Full | Not yet | N/A |
| Any MCP client | Full | Depends on host | Graceful degradation |