Play with your app's design in the browser: load a build, turn the knobs, export the code.
npx uisandbox-mcp open # run inside your project: it finds the build and opens the sandbox — no agent needed
Or drop a zip on uisandbox.org — no build at hand? Try a sample under the drop zone (the Bootstrap docs, a VitePress site, an admin dashboard). Or, in Claude Code: /plugin marketplace add Ideelab/uisandbox → /plugin install uisandbox@uisandbox and say "open this app in UISandbox".
dist/, build/, out/ (or a whole repo with the build inside); a folder (a build renders, a source folder is read for the knob stand); a public GitHub or GitLab repo URL (fetched as a zip through a same-origin route — the one thing that leaves the tab, see notes/security.md). While it works, the door shows the stages with their numbers. Otherwise your files never leave your browser: files are read in the page and served to the frame by a service worker on this origin.style="" set by JS, <style> your framework appends, insertRule/replaceSync from styled-components, Emotion, Lit, Ant's cssinjs; CDN stylesheets through a same-origin proxy; nested same-origin frames such as Storybook's).--k-* tokens for web (CSS, Tailwind, shadcn), Swift constants + an asset catalog for iOS, colors.xml + Kotlin for Android.uisandbox.org/?load= followed by a public GitHub or GitLab repository URL, or a
direct link to a .zip that allows CORS, opens straight into the sandbox. The
samples on the site load this way, and it is how you show somebody a build
without asking them to find it:
https://uisandbox.org/?load=https://github.com/edwardtufte/tufte-css
https://uisandbox.org/?load=https://example.com/dist.zip
A repository URL goes through this site's repo route (GitHub and GitLab do not
send CORS on archives); a .zip URL is fetched by the browser itself. Either
way the archive is read in the tab, exactly as a dropped one is.
notes/security.md; deploy on an origin of its own.pnpm install
pnpm dev # http://localhost:5190
pnpm test # vitest + node:test (audit engine)
pnpm build # dist/ — static; public/_headers rides along
pnpm holdouts # every fixture zip through the real app in headless Chromium (see below)
http://localhost:5190/?load=<zip-url> loads a zip by URL (same-origin or CORS) — the door an agent uses.
pnpm holdouts runs every archive in fixtures/ (real builds from public repos — gitignored, notes/decisions.md says where each came from) through the app: load, Check 1:1, reach, and a host check (same origin, one worker). Verdicts are held against scripts/holdouts.expect.json; a fixture expected ok that is not fails the run. --only <name>, --record, --base <url> --fixtures <url> for a production build or the live site.
src/
sandbox/
rewrite.ts their CSS/HTML → literals replaced by var(--us-vN); byte-preserving
table.ts the substitution sheet: one entry per (kind, value), with sites
mapping.ts knob → their values, RELATIVE to the baseline (identity at rest); families
baseline.ts the knobs on the stand of THEIR code (audit + the sheet + the rendered page)
project.ts root and deploy-base detection · screens · raw + rewritten files · guard + hook
host.ts owns the sandboxes, answers the service worker; live vars injected into HTML
verify.ts the 1:1 check: raw vs identity, computed styles per element
coverage.ts the reach meter
live.ts MutationObserver: runtime style="" and <style> get the same rewrite
scheme.ts their dark mode: hooks found in their CSS, switched
public/sw.js serves a sandbox document's URLs from the page; /__ext/ proxies CDN CSS
tokens/ panel/ state/ export/ audit/ the knob engine, panel, undo/hash, exporters, source audit
notes/ decisions (numbered), traps, lessons, security, roadmap
npx -y uisandbox-mcp (npm) — or pnpm mcp from a clone — runs the same engine as an MCP server (stdio): load a zip by URL or path, set knobs, export any format, verify the 1:1 check and screenshot in headless Chromium against the real app. See mcp/README.md for the tool list and the Claude/Cursor config. Claude Code plugin (skill + server in one): /plugin marketplace add Ideelab/uisandbox then /plugin install uisandbox@uisandbox — gives /uisandbox ("open this app in a sandbox", "try brand #e11d48") and the uisandbox MCP server. The skill alone is skills/uisandbox/SKILL.md (copy into .claude/skills/). Codex / Cursor / others: add the MCP server (npx -y uisandbox-mcp); the server sends its own instructions and prompts.
One origin, one Cloudflare Worker (worker/index.mjs, wrangler.jsonc): static assets from dist/, the SPA fallback for ?load=, http→https and www→apex redirects, and the /__repo/ route that fetches a public GitHub zip for "Connect a repo" (nothing stored; same-origin callers only; a rate-limit rule in the zone). public/_headers keeps sw.js uncached and sets the security headers. Put nothing else on the origin — the sandboxed frames are same-origin by design (notes/security.md).
The most useful thing you can send is a build that does not work. See CONTRIBUTING.md for the 1:1 gate a change to the rewriter is held to, and how to run it against the three real builds that ship in this repo.
I'm Alexander Kaan, and I build open-source tooling for user interfaces. UISandbox came out of the design system generator I made before it: I could hand somebody a finished kit, but I could not show them what their own app would look like in it. This does that other half.
I won't pretend I knew what I was doing at the start. Every decision, and every
trap I fell into on the way, is in notes/decisions.md —
including the ones I had to undo. Issues and pull requests are welcome.
notes/roadmap.md: ship (uisandbox.org) · the intake as a front door · being found (SEO, llms.txt, analytics) · the MCP server · after launch.
Made with ♥ by Alexander Kaan at Ideelab · MIT · the decisions that shaped it, numbered: notes/decisions.md
Source-derived launch command. Check the maintainer’s required arguments and credentials before running:
npx -y uisandbox-mcpMerge this template into ~/Library/Application Support/Claude/claude_desktop_config.json. Keep existing servers. Add any arguments, credentials, and permissions required by the maintainer; this template has not been install-tested.
{
"mcpServers": {
"io-github-ideelab-uisandbox": {
"command": "npx",
"args": [
"-y",
"uisandbox-mcp"
]
}
}
}Restart Claude Desktop completely for changes to take effect. Confirm the server appears connected in the client’s tool list, then try a read-only example from its documentation.
Claude Desktop setup referenceuisandbox-mcpnpmUISandbox works with any MCP-compatible client. Copy the config snippet from the Configuration section above and add it to the file shown for your client, then restart the application.
~/Library/Application Support/Claude/claude_desktop_config.jsonRestart Claude Desktop completely for changes to take effect.~/.cursor/mcp.jsonRestart Cursor for changes to take effect..vscode/mcp.jsonReload VS Code window for changes to take effect.~/.codeium/windsurf/mcp_config.jsonRestart Windsurf for changes to take effect..mcp.jsonSave at the project root, then start Claude Code in that project and review the MCP server approval prompt. Keep real credentials out of shared files.