m3e-canvas 0.0.0-stage → 1.1.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.
Files changed (4) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +103 -2
  3. package/dist/server.mjs +7382 -0
  4. package/package.json +36 -4
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 lnkiai
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,104 @@
1
- # Temporary Holding Version
1
+ # m3e-canvas
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ A [Model Context Protocol](https://modelcontextprotocol.io/) server for [M3E Canvas](https://lnkiai.github.io/m3e-canvas/), the browser editor for Material 3 Expressive screens.
4
+
5
+ With it connected, an AI agent can design the screens of an app and hand you a link. Opening the link adds the design to your projects in M3E Canvas, where you refine it. Give the agent the link of the finished design, and it builds the app from the prompt M3E Canvas writes for it.
6
+
7
+ The server runs on your machine and talks only to the agent that started it. It sends nothing anywhere and does not drive a browser: the link itself carries the design. While it runs, the one thing it can write is a design file, when the agent is asked for one, and the one thing it reads is a design file you point it at.
8
+
9
+ ## Set up
10
+
11
+ You need Node.js 20 or later. Run this in a terminal, on macOS, Linux or Windows:
12
+
13
+ ```sh
14
+ npx -y m3e-canvas@latest setup
15
+ ```
16
+
17
+ It finds Claude Code, Codex, Claude Desktop, Cursor and VS Code on your computer, shows which settings would change, and registers the server with the ones you pick. Your other servers and settings keep their values, and a file it cannot read whole is left alone. Restart the tools afterwards.
18
+
19
+ Run it again to renew an older setting, the ones 1.0.0 made for single folders in Claude Code among them. To take the server out again:
20
+
21
+ ```sh
22
+ npx -y m3e-canvas@latest remove
23
+ ```
24
+
25
+ Both take the names of tools (`claude-code`, `codex`, `claude-desktop`, `cursor`, `vscode`) to leave the others alone, and `--yes` to be asked nothing.
26
+
27
+ <details>
28
+ <summary>Set it up by hand</summary>
29
+
30
+ **Claude Code**
31
+
32
+ ```sh
33
+ claude mcp add --scope user m3e-canvas -- npx -y m3e-canvas
34
+ ```
35
+
36
+ **Codex**
37
+
38
+ ```sh
39
+ codex mcp add m3e-canvas -- npx -y m3e-canvas
40
+ ```
41
+
42
+ **Claude Desktop, Cursor and other clients that read `mcpServers`**
43
+
44
+ ```json
45
+ {
46
+ "mcpServers": {
47
+ "m3e-canvas": {
48
+ "command": "npx",
49
+ "args": ["-y", "m3e-canvas"]
50
+ }
51
+ }
52
+ }
53
+ ```
54
+
55
+ **VS Code** (`.vscode/mcp.json`)
56
+
57
+ ```json
58
+ {
59
+ "servers": {
60
+ "m3e-canvas": {
61
+ "command": "npx",
62
+ "args": ["-y", "m3e-canvas"]
63
+ }
64
+ }
65
+ }
66
+ ```
67
+
68
+ On Windows, a client that cannot start `npx` takes `"command": "cmd"` with `"args": ["/c", "npx", "-y", "m3e-canvas"]`.
69
+
70
+ </details>
71
+
72
+ Then ask for a design:
73
+
74
+ > In M3E Canvas, design the screens of an app for saving and searching recipes.
75
+
76
+ The agent replies with a link. Open it.
77
+
78
+ ## Tools
79
+
80
+ | Tool | What it does |
81
+ |---|---|
82
+ | `get_guide` | Returns the guide to the design format: the document's fields and every kind of part. |
83
+ | `create_design_link` | Checks a design and returns the link that opens it as a new project, or says what to fix, with the path of each field. |
84
+ | `save_design_file` | Checks a design and saves it as a `.json` file, for a design too large for a link. Never writes over an existing file. |
85
+ | `read_design` | Returns the design in a link or a saved file, so an existing design can be changed. |
86
+ | `get_build_prompt` | Returns the prompt M3E Canvas writes for a design, from its link or its saved file, so the agent can build the app that was drawn. |
87
+
88
+ To change a design you already have, press **Copy link** in the app's **Ask an AI** dialog and give the link to the agent.
89
+
90
+ To have the app built, give the agent the same link and ask for it:
91
+
92
+ > Build the app in this M3E Canvas design: https://lnkiai.github.io/m3e-canvas/#docz=...
93
+
94
+ The agent gets the prompt the app itself writes for that design (the screens part by part, the color scheme, the theme, and how the screens connect) and builds from it. The prompt is in English unless you ask for Japanese, Chinese or Korean.
95
+
96
+ A saved file opens from the projects page: **Open from file**, or drop it on the page.
97
+
98
+ ## Options
99
+
100
+ `M3E_CANVAS_URL` sets the address the links open, for a copy of the app hosted somewhere else. It defaults to `https://lnkiai.github.io/m3e-canvas/`. Set while `setup` runs, it is written into the settings.
101
+
102
+ ## License
103
+
104
+ MIT. The source is in [`packages/mcp`](https://github.com/lnkiai/m3e-canvas/tree/main/packages/mcp) of the M3E Canvas repository.