sayshape-mcp 0.1.1 → 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 +14 -4
- package/dist/server.js +1040 -104
- package/dist/ui.html +97 -91
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -36,15 +36,25 @@ When none is on, there's no toolbar at all. Whoever installs the server chooses,
|
|
|
36
36
|
|---|---|
|
|
37
37
|
| `--theme-picker` | Show the theme selector (off by default) |
|
|
38
38
|
| `--theme teal\|purple\|blue\|neutral\|studio` | The theme interfaces use (default `teal`). `studio` is the Studio look: Inter, rounder corners and an indigo-to-violet accent |
|
|
39
|
+
| `--accent "#e4572e"` | A brand color (hex, `#rrggbb` or `#rgb`) for buttons, highlights and charts' first series, laid over the theme. Text in it must stay readable (4.5:1), and no color manages that on both white and near-black, so it's darkened in light mode or lightened in dark mode where needed; the server says at startup what each mode uses |
|
|
39
40
|
| `--no-save-image` | Hide Save image (shown by default where the chat app can download) |
|
|
40
41
|
| `--no-copy-text` | Hide Copy text, and leave Ctrl+C alone (shown by default) |
|
|
41
|
-
| `--scene` | **Experimental.** Turn on scenes: pictures and animations the model paints from shapes (off by default). Leave it out to turn them off again. |
|
|
42
|
+
| `--scene` | **Experimental.** Turn on scenes: pictures and animations the model paints from shapes, with parts people can press and soft shadows, glow and shine for depth (off by default). Leave it out to turn them off again. |
|
|
43
|
+
| `--behavior` | **Experimental.** Turn on behavior: things that change by themselves on a timer (a countdown, a simulation) and, together with `--scene`, shapes people drag (off by default). Rules only change the interface's own values; they still can't run code. Chat apps that can't draw views don't get it. |
|
|
42
44
|
| `--image-hosts cdn.example.com,*.img.example.com` | Hosts `image` elements may load from, comma-separated; `*.example.com` allows its subdomains. None by default, so no images show. See [Images](#images). |
|
|
43
45
|
|
|
44
46
|
```json
|
|
45
47
|
"sayshape": { "command": "node", "args": ["/full/path/to/sayshape/mcp/dist/server.js", "--theme", "blue", "--theme-picker"] }
|
|
46
48
|
```
|
|
47
49
|
|
|
50
|
+
With both experimental features on:
|
|
51
|
+
|
|
52
|
+
```json
|
|
53
|
+
"sayshape": { "command": "npx", "args": ["-y", "sayshape-mcp", "--scene", "--behavior"] }
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Then ask for something that moves or can be pressed: *"Draw a traffic light I can press, where the active light glows"*, *"Draw a shiny ball bouncing with a shadow on the floor"* or *"A 30-second countdown I can pause"*. Both features may still change between releases.
|
|
57
|
+
|
|
48
58
|
### Images
|
|
49
59
|
|
|
50
60
|
The view has no website of its own, so an `image` only loads from a host you list with `--image-hosts`, usually your company's image CDN:
|
|
@@ -57,7 +67,7 @@ The one list does three things: the view's engine loads from those hosts and no
|
|
|
57
67
|
|
|
58
68
|
## In chat apps that can't draw interfaces
|
|
59
69
|
|
|
60
|
-
Coding agents and other text-only clients (Claude Code, Codex, Antigravity and others) call `show_interface` but can't show MCP Apps views. When a client connects without announcing MCP Apps support (the `io.modelcontextprotocol/ui` capability), and the spec has nothing to fix, `show_interface`'s text result carries a small, complete HTML page instead, with two sentences telling the model what to do with it: publish it as a page if it has a tool for that, or save it as an `.html` file and give the person its path to open in a browser. The server itself writes no files. Clients that draw views get exactly what they got before.
|
|
70
|
+
Coding agents and other text-only clients (Claude Code, Codex, Antigravity and others) call `show_interface` but can't show MCP Apps views. When a client connects without announcing MCP Apps support (the `io.modelcontextprotocol/ui` capability), and the spec has nothing to fix, `show_interface`'s text result carries a small, complete HTML page instead, with two sentences telling the model what to do with it: publish it as a page if it has a tool for that, or save it as an `.html` file and give the person its path to open in a browser. The server itself writes no files. For these clients the result is text alone, with no structured part: the structured part is for the view, and some clients (Claude Code is one) give their model the structured part in place of the text, which would lose the page. Clients that draw views get exactly what they got before.
|
|
61
71
|
|
|
62
72
|
The page is a few kilobytes plus the spec: a canvas, the engine loaded from jsDelivr (`sayshape@<version>/dist/sayshape.global.js`, and the map's own script when the spec has a map), and the spec embedded as JSON with `<` escaped, so nothing in it can end the script. It follows light and dark mode, and a `data-theme="light"` or `"dark"` on its root element; its background is the engine theme's own; and it fits a phone with no sideways scrolling.
|
|
63
73
|
|
|
@@ -198,7 +208,7 @@ cd sayshape/mcp && npm ci && npm run build
|
|
|
198
208
|
# then use "command": "node", "args": ["/full/path/to/sayshape/mcp/dist/server.js"]
|
|
199
209
|
```
|
|
200
210
|
|
|
201
|
-
Then ask for something visual: *"Show the 2022 World Cup final as a stat card"*, or *"Make me a tip calculator for $86 split three ways"*.
|
|
211
|
+
Then ask for something visual: *"Show the 2022 World Cup final as a stat card"*, or *"Make me a tip calculator for $86 split three ways"*. Charts can carry a target line, a second line and a note at one point: *"Show monthly sales as bars with last year as a line and a target at 16,000"*.
|
|
202
212
|
|
|
203
213
|
## Host it publicly
|
|
204
214
|
|
|
@@ -207,7 +217,7 @@ To give Claude, ChatGPT and other chat apps a permanent HTTPS address, run the H
|
|
|
207
217
|
Start it with an exact version, never `@latest`, so what runs is what you checked:
|
|
208
218
|
|
|
209
219
|
```bash
|
|
210
|
-
npx -y sayshape-mcp@0.
|
|
220
|
+
npx -y sayshape-mcp@0.2.0 --http --host 0.0.0.0 --trust-proxy
|
|
211
221
|
```
|
|
212
222
|
|
|
213
223
|
| | |
|