uisandbox-mcp 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -19,13 +19,17 @@ npx tsx mcp/smoke.ts fixtures/x.zip # load → set → export → verify
19
19
  | tool | input | returns |
20
20
  |---|---|---|
21
21
  | `load` | `zipUrl` or `zipPath` | project id, screens, values, the baseline (brand, fonts, families, palette, canvas, dark mode) — or a refusal with the reason |
22
+ | `open` | `id`, `screen?` | **the sandbox itself** in the user's browser — the web app ships in the package and is served from 127.0.0.1 by this process with the archive; what the user turns flows back (`state`) |
23
+ | `state` | `id` | the knobs now, including what was turned by hand in an opened sandbox |
22
24
  | `screens` | `id` | the screens |
23
25
  | `set` | `id`, `knobs` — `cPrimary`, `fontDisplay`, `fontBody`, dials (`radius`, `space`, `type`, `lineHeight`, `tracking`, `weight`, `borderWidth`, `borderTone`, `shadow`, `motion`, `hue`, `sat`, `contrast`, `gradAngle`), `cBackground`, family colours, `dark`, `reset` | what moved (count, sample) |
24
26
  | `export` | `id`, `format` — `sheet-css` · `sheet-json` · `patch` · `tokens-css` · `tokens-json` · `tailwind` · `shadcn` · `swift` · `android-xml` · `android-kotlin` | text |
25
27
  | `verify` | `id`, `screen?`, `width?` | the 1:1 check in headless Chromium (untouched vs. tokenised, computed styles per element) + reach |
26
28
  | `screenshot` | `id`, `screen?`, `width?` | PNG of the screen with the current knobs |
27
29
 
28
- `load`/`set`/`export` are pure Node. `verify`/`screenshot` drive the real app (`UISANDBOX_URL`, default `https://uisandbox.org`) with the archive served from a route inside the headless browser — the number an agent gets is the number a visitor gets.
30
+ `load`/`set`/`export`/`state` are pure Node. `open` serves the bundled app on 127.0.0.1 and opens the browser — nothing leaves the machine. `verify`/`screenshot` drive the app in headless Chromium (the bundled one on 127.0.0.1; `UISANDBOX_URL` to point elsewhere) with the archive served from a route inside the browser — the number an agent gets is the number a visitor gets.
31
+
32
+ The conversation this is built for: *"Can I look at this app in a sandbox and change the design a bit?"* → the agent builds, `load`s, `open`s; you play in the real sandbox; *"export what I did"* → `state` → `export`.
29
33
 
30
34
  ## Claude Desktop / Claude Code / Cursor
31
35
 
@@ -45,4 +49,6 @@ Claude Code: `claude mcp add uisandbox -- npx -y uisandbox-mcp`
45
49
 
46
50
  ## A prompt to paste
47
51
 
52
+ > Open this app in UISandbox so I can play with the design — build it first. (…later…) Export the patch for what I changed.
53
+
48
54
  > Test my design: load https://github.com/me/site/archive/refs/heads/gh-pages.zip in UISandbox, set the brand to #e11d48 and radius ×1.5, verify it is still 1:1, show me a screenshot, and give me the patch.
Binary file