figma-coder-mcp 0.3.0 → 0.4.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 +3 -3
- package/dist/bin.js +3517 -146
- package/package.json +3 -1
package/README.md
CHANGED
|
@@ -80,7 +80,7 @@ one.
|
|
|
80
80
|
|
|
81
81
|
| Tool | What it does |
|
|
82
82
|
|------|--------------|
|
|
83
|
-
| `get_figma_data` | Returns a **compact, token-efficient design tree** for the agent to reason about and generate code from. Repeated styles are deduped into `globalVars.styles` (each node carries a short `style` ref), per-node position/size stays inline as `box`, and repeated subtrees are hoisted into `elements` (occurrences become `{ref}`) — typically 30–45% smaller than the raw per-node CSS. Small results come back inline; large ones are written to a
|
|
83
|
+
| `get_figma_data` | Returns a **compact, token-efficient design tree** for the agent to reason about and generate code from. Repeated styles are deduped into `globalVars.styles` (each node carries a short `style` ref), per-node position/size stays inline as `box`, and repeated subtrees are hoisted into `elements` (occurrences become `{ref}`) — typically 30–45% smaller than the raw per-node CSS. Returned as **minified JSON** (most token-efficient); pass `format:"yaml"` for a more readable (but larger) form. Small results come back inline; large ones are written to a file and summarised. |
|
|
84
84
|
| `convert_figma_to_html` | Produces finished, self-contained **HTML + Tailwind**. Asset inlining is **off by default** (placeholders shown for images/vectors); pass `assets:true` to render & inline them. The HTML is written to a file and a compact summary + path is returned to keep the agent's context small. Args: `mode` (`tailwind`/`inline`), `document`, `assets`, `assetScale`, `round`, `llm`, `outFile`. |
|
|
85
85
|
|
|
86
86
|
### Conversion fidelity
|
|
@@ -91,7 +91,7 @@ The deterministic converter preserves a lot of Figma intent automatically:
|
|
|
91
91
|
- **Images**: image fills honor `scaleMode` (FILL/FIT/TILE/STRETCH) and crop transforms. Icon/illustration groups collapse into a single SVG (fewer renders); image-filled ellipses become CSS circles.
|
|
92
92
|
- **Styles**: per-corner radius, stroke alignment (OUTSIDE/CENTER via `outline`), per-side borders, all gradient types (linear/radial/conic), blend modes, shadows, backdrop blur, opacity.
|
|
93
93
|
- **Text**: font, line-height, letter-spacing, alignment (incl. vertical), decoration/case, gradient text, and **mixed-style runs** (a bold/colored word becomes its own `<span>`).
|
|
94
|
-
- **`round`** (on by default): snaps on-grid values to idiomatic Tailwind tokens (`p-4`, `gap-6`, `rounded-lg`, `text-2xl`, `font-bold`); off-grid values stay exact, so it never silently changes real sizes. Pass `round:false` (or `--no-round` on the CLI) for exact arbitrary values everywhere.
|
|
94
|
+
- **`round`** (on by default): snaps on-grid values to idiomatic Tailwind tokens (`p-4`, `gap-6`, `rounded-lg`, `text-2xl`, `font-bold`, and exact palette colors → `bg-blue-500`); off-grid values and non-palette colors stay exact, so it never silently changes real sizes or colors. Pass `round:false` (or `--no-round` on the CLI) for exact arbitrary values everywhere.
|
|
95
95
|
|
|
96
96
|
## Configuration
|
|
97
97
|
|
|
@@ -146,7 +146,7 @@ default), `--no-round` (idiomatic Tailwind snapping is on by default), `--llm`,
|
|
|
146
146
|
|---------|--------------|
|
|
147
147
|
| `figma-coder-mcp` | Start the MCP server over stdio (the default command). |
|
|
148
148
|
| `convert <url\|key>` | One-off convert to a self-contained HTML file. |
|
|
149
|
-
| `data <url\|key>` | Print or save the compact design tree (deduped styles + repeated-subtree templates). |
|
|
149
|
+
| `data <url\|key>` | Print or save the compact design tree (deduped styles + repeated-subtree templates). `--format json` (default) or `yaml`. |
|
|
150
150
|
| `set-token <PAT>` | Store a Figma personal access token globally (local mode). |
|
|
151
151
|
| `login` | Sign in with Figma via OAuth, stored globally (remote mode). |
|
|
152
152
|
| `status` | Show how requests will be served. No secrets printed. |
|