Self-hosted platform for publishing static frontend prototypes by product and version.
It provides three surfaces:
/previewfor browsing published prototypes/adminfor uploading source archives, tracking build jobs, and managing versionsPOST /api/mcpfor exposing published source snapshots to MCP clients
Prototype Manage Tool is built for teams that want a lightweight way to publish internal frontend prototypes without standing up a full preview platform.
Key behaviors:
- every product, version, build job, and MCP key is owned by a user account
- previews only serve already published static output
- MCP only exposes published versions whose source snapshot status is
ready - published files and source snapshots are stored separately for serving and code inspection
Under the hood, the app stores:
- metadata in SQLite through Prisma
- published artifacts in
data/prototypes/<userId>/<productKey>/<version>/ - source snapshots in
data/source-snapshots/<userId>/<productKey>/<version>/
- Upload a
.zipfrontend project or static HTML package; build projects usepnpmornpm - Publish product versions and manage default or offline states
- Browse published versions from a dedicated preview UI
- Expose published source trees through a remote MCP endpoint
- Support
zhandenroutes withnext-intl
Note
The platform does not build previews on demand. Uploads are processed as build jobs, and preview/MCP read from already published outputs.
- Next.js App Router
- React 19
- TypeScript
- next-intl
- Prisma 7 with SQLite
- Filesystem-backed artifact storage
- Vitest
- Node.js 22+
- pnpm 10.33+
-
Install dependencies.
pnpm install
-
Create the local environment file.
cp .env.example .env
PowerShell:
Copy-Item .env.example .env -
Initialize Prisma and seed demo data.
pnpm init
-
Start the app.
pnpm dev
-
Open:
http://localhost:3000/previewhttp://localhost:3000/adminhttp://localhost:3000/en/previewhttp://localhost:3000/en/admin
Tip
Unprefixed routes default to zh. English routes live under /en/*.
| Command | Purpose |
|---|---|
pnpm dev |
Start the development server |
pnpm init |
Generate Prisma client, push schema, and seed demo data |
pnpm test |
Run the test suite |
pnpm typecheck |
Run TypeScript checks |
pnpm build |
Build the app |
-
Create the Docker env file.
cp .env.docker.example .env.docker
-
Set at least:
IMAGE_TAGto a releasedvX.Y.Ztag for productionAPP_URLto the public app URLAUTH_SECRETto a long random secretMCP_TOKEN_ENCRYPTION_KEYif you want stable MCP token encryption
-
Initialize the database.
docker compose --env-file .env.docker --profile init run --rm db-init
-
Optionally seed demo data.
docker compose --env-file .env.docker --profile seed run --rm seed-demo
-
Start the application.
docker compose --env-file .env.docker pull docker compose --env-file .env.docker up -d
Important
This project uses pnpm db:push as the schema workflow. Checked-in Prisma migrations are not the local setup source of truth.
The app exposes a remote MCP server over HTTP:
- endpoint:
POST /api/mcp - auth:
Authorization: Bearer <user-scoped MCP key> - key management: create keys from
/settingsand authorize products per key - method contract:
GET /api/mcpandDELETE /api/mcpreturn405
Example client config:
{
"mcpServers": {
"prototype-source": {
"url": "http://localhost:3000/api/mcp",
"headers": {
"Authorization": "Bearer replace-with-your-mcp-token"
}
}
}
}Available tools:
list_productslist_versionsresolve_versionget_source_treeread_source_filesearch_source_filesget_codebase_summarysearch_with_contextget_component_contextget_type_definitionsget_source_index_status
Uploads are intentionally strict:
- only
.ziparchives are accepted - an archive must contain either a
package.jsonwith abuildscript, orindex.html/one uniquely named.htmlentry - only
pnpmandnpmare supported for build projects - build-project output must come from
dist/; static HTML packages publish their detected site root - non-
index.htmlstatic entries receive anindex.htmlcopy for the fixed preview entry URL - HTML/CSS asset references must resolve as relative paths after normalization
app/ Next.js routes and API handlers
components/ Admin, preview, layout, and UI components
i18n/ Locale routing and request configuration
lib/domain/ Business rules and validation helpers
lib/server/ Build, upload, manifest, MCP, and snapshot services
lib/ui/ Client-side view helpers
prisma/ Prisma schema and configuration
scripts/ Seed and maintenance scripts
tests/ Vitest suites
data/ Runtime data directory
Run these before opening a PR:
pnpm test
pnpm typecheck
pnpm buildOn Windows, pnpm build may require Developer Mode or an elevated shell so Next.js can create symlinks for standalone output.