@mandelbaum/mrcp
v0.0.1
Published
Small framework for MCP apps with Vite + React.
Readme
mrcp
Small framework for MCP apps with Vite + React.
Conventions
- Define UI resources (React components) in
resources/**.- The default export is used as the resource component.
- The resource name is derived from the file path under
resources/(for exampleresources/base-ui.tsx->"base-ui").
- Define tools (functions) in
tools/**.- Tool UI linkage is
app.resource, which is type-safe against discovered resource names.
- Tool UI linkage is
- Vite generates virtual modules:
virtual:mcp-resourcesvirtual:mcp-tools
- Resources are server-rendered and then hydrated in the frontend via
resource-hydrate.tsx. - Hydration script is injected inline in resource HTML (no external
<script src="...">). - Tailwind CSS is enabled in Vite for both dev and production builds (production output is pruned automatically by Tailwind).
Commands
npm install
npm run devDev server runs on http://localhost:3001/mcp and hot-loads resources/tools through Vite SSR.
npm run buildBuild outputs compiled server code to dist/.
In both dev and production, the full hydration JavaScript is inlined into the resource HTML.
npm run startStarts the compiled server from dist/server.js.
CLI
This package exposes two binaries:
mrcpwith commands:dev,build,start,check,generate-typescreate-mrcpto scaffold a new MRCP app
Example:
npx create-mrcp my-mcp-app
cd my-mcp-app
npm install
npm run dev