@clovis500c/figma-bridge 1.5.0 → 1.12.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
@@ -5,23 +5,52 @@
5
5
  **Let any AI agent design in the Figma desktop app, with no rate limits.**
6
6
 
7
7
  Figma Bridge is a local [MCP](https://modelcontextprotocol.io) server plus a Figma plugin. Your agent gets full read and
8
- write access to the open file through the Plugin API, not the web API: no tokens, no quotas.
8
+ write access to the open file through the Plugin API, not the web API: no tokens, no quotas. (A token is only needed
9
+ for the optional comments and version history tools.)
9
10
 
10
11
  Works with **Claude Code**, **Claude Desktop**, **Codex**, **Antigravity**, **Gemini CLI**, **Cursor**, **Windsurf**
11
12
  and any other MCP client.
12
13
 
13
14
  <p align="center"><img src="docs/plugin.jpg" alt="Figma Bridge plugin" width="620"></p>
14
15
 
16
+ <!-- Demo: record it with docs/record-demo.md, save it as docs/demo.gif, then uncomment.
17
+ <p align="center"><img src="docs/demo.gif" alt="An agent building, importing and exporting with Figma Bridge" width="720"></p>
18
+ -->
19
+
15
20
  ## Features
16
21
 
17
22
  - **Build whole layouts in one call** from a JSON spec: auto-layout and grid, rich text, icons, images, component sets with variants and properties, prototype links.
18
- - **Write the design system**: variables with Light/Dark modes and styles, from simple JSON, W3C design tokens or a Tailwind theme.
23
+ - **Import any website or HTML** as editable auto-layout frames, one per viewport ([details](docs/import-web.md)).
24
+ - **Round-trip the design system**: write variables with Light/Dark modes and styles from JSON, W3C tokens or Tailwind; export them to DTCG, CSS, Tailwind v3/v4, SCSS or TypeScript ([details](docs/design-system.md)).
25
+ - **Score and fix design system health**: token coverage, contrast, text styles, detached instances, duplicates, naming, with safe automatic fixes.
19
26
  - **Read existing designs** compactly, search every page, and reuse the file's design system.
20
27
  - **Check its own work** with screenshots, a design audit, and a pixel diff against a mockup.
21
- - **Hand off**: Dev Mode annotations and export to HTML or React (CSS or Tailwind).
28
+ - **Hand off to your codebase**: export a frame into your project with its own components, tokens and stack (React, Next, Vue, Svelte, React Native; Tailwind, CSS modules, styled-components; shadcn, MUI, Chakra) ([details](docs/export-code.md)), plus Dev Mode annotations.
29
+ - **Ship to Roblox**: turn a frame into native Roblox UI (ScreenGui, UIListLayout, UICorner, UIStroke, 9-slice panels) as an `.rbxmx` model and a Luau script for a Roblox Studio MCP, with optional asset upload ([details](docs/roblox.md)).
30
+ - **Figma Design, FigJam and Slides**: stickies, shapes, connectors, tables, Mermaid flowcharts laid out as diagrams, and slide decks; several files at once ([details](docs/figjam-slides.md)).
22
31
  - **200 000+ icons** through Iconify, checkpoints to roll back, and a library of reusable scripts.
23
32
  - **Zero-friction connection**: the plugin connects and reconnects on its own. Each AI command is one Ctrl+Z step, and you can cancel it from the plugin.
24
33
 
34
+ ## How it compares
35
+
36
+ | | Figma Bridge | [figma-console-mcp](https://github.com/southleft/figma-console-mcp) | [Figwright](https://github.com/awdr74100/figwright) | [Figma MCP server](https://help.figma.com/hc/en-us/articles/39216419318551-Get-started-with-the-Figma-MCP-server) (official) |
37
+ |---|---|---|---|---|
38
+ | Setup | `npx … setup` configures every AI client found and installs the plugin | npx, a personal access token, plugin import | Plugin zip import, MCP config | OAuth (remote) or the desktop app |
39
+ | Figma plan or seat | Any, free included | Any | Any, free included | Writing to the canvas: Full or Dev seat on a paid plan |
40
+ | API token | Not needed (only for comments and versions) | Required | Not needed | OAuth sign-in |
41
+ | Tools | 28 | 121 | 116 | 16 |
42
+ | Whole layout in one call | ✓ `build` spec (auto-layout, grid, variants, prototype) | Component sets from a variant matrix | — | — |
43
+ | Pixel diff against a mockup | ✓ `compare`, with heatmap | — | Diff against a saved baseline | — |
44
+ | Checkpoints to roll back | ✓ | — | — | — |
45
+ | Website or HTML → editable layers | ✓ any URL, HTML or file, several widths | — | — | Captures UI rendered in a browser |
46
+ | Code that uses your components and tokens | ✓ React, Next, Vue, Svelte, React Native | — | ✓ | ✓ with Code Connect |
47
+ | Token export | DTCG, CSS, Tailwind v3/v4, SCSS, TS, JSON | 10 formats | — | — |
48
+ | FigJam and Slides | ✓ boards, Mermaid diagrams, decks | ✓ | FigJam, partly | — |
49
+ | Figma → Roblox UI | ✓ native UI objects, `.rbxmx` + Luau, Open Cloud upload | — | — | — |
50
+
51
+ Based on each project's documentation in October 2026; "—" means it isn't documented there. Corrections are welcome
52
+ in an issue.
53
+
25
54
  ## Installation
26
55
 
27
56
  Requires [Node.js](https://nodejs.org) 20+ and the Figma **desktop** app.
@@ -102,9 +131,15 @@ Keep the plugin open (the **—** button collapses it to a thin bar) and ask you
102
131
 
103
132
  > Design a mobile sign-in screen from scratch on a new page: logo, email and password fields, a primary button and a "Forgot password?" link.
104
133
 
105
- > Create our design system from `tokens.json` (Light and Dark modes), then rebuild the selected screen with those variables and show it in Dark mode.
134
+ > Import https://example.com/pricing at desktop and mobile widths, then rename the layers and use our text styles.
135
+
136
+ > Export the selected card into C:\code\my-app using our existing components, then write it.
137
+
138
+ > Audit our design system, fix what can be fixed safely, and tell me the score before and after.
106
139
 
107
- > Reproduce `C:\mockups\dashboard.png` as an editable frame with auto-layout, compare it with the screenshot and fix the differences.
140
+ Clients that support MCP prompts also offer ready-made workflows: **new-screen**, **apply-design-system**,
141
+ **reproduce-screenshot**, **import-website**, **figma-to-code**, **audit-and-fix** and **figma-to-roblox**. Ready-made specs and tokens are
142
+ in [examples/](examples).
108
143
 
109
144
  When your agent needs you to point at something, the plugin shows **Your agent is waiting** until you select it.
110
145
  A running command has a **Cancel** button: `build` stops at the next layer, but a script cannot be interrupted and
@@ -116,25 +151,28 @@ To reopen the plugin later, use **Ctrl+Alt+P** or the **Figma Bridge** button in
116
151
 
117
152
  | Tool | Purpose |
118
153
  |---|---|
119
- | `build` | Create a layout from a JSON spec in one call: grid, rich text, variants, reactions |
154
+ | `build` | Create a layout in one call: grid, rich text, variants, reactions; FigJam boards and diagrams; slides |
155
+ | `import_web` | Rebuild a website or HTML as editable layers, one frame per viewport |
120
156
  | `run_script` | Run any Figma Plugin API code |
121
157
  | `describe` | Compact outline of existing layers |
122
158
  | `find` | Search layers on every page by name, text, type, style or component |
123
159
  | `get_design_system` | Local styles, variables and components |
124
- | `design_tokens` | Create or update variables (with modes) and styles from JSON, W3C tokens or Tailwind |
125
- | `audit` | Lint for contrast, overflow, fonts, spacing and naming |
160
+ | `design_tokens` | Write variables (with modes) and styles from JSON, W3C tokens or Tailwind; export them to DTCG, CSS, Tailwind, SCSS or TS |
161
+ | `audit` | Lint layers, score the design system's health, and apply safe fixes |
126
162
  | `screenshot` | Export a layer to an image (optionally shown to the agent) |
127
163
  | `compare` | Pixel-diff a layer against a reference image, with a heatmap |
128
164
  | `wait_for_selection` | Ask the user to select layers and wait for it |
129
165
  | `prototype` | Link frames (click, hover, transitions) and set flow starting points |
130
166
  | `annotate` | Add, list or clear Dev Mode annotations |
131
- | `export_code` | Export a frame to HTML or React, with CSS or Tailwind |
167
+ | `export_code` | Export a frame to code; with `projectPath`, code that uses the project's components and tokens |
168
+ | `export_roblox` | Export a frame to Roblox UI: `.rbxmx`, a Luau builder script and PNG assets, optionally uploaded |
132
169
  | `insert_icon` · `search_icons` | Iconify icons as editable vectors |
133
170
  | `place_image` · `import_svg` | Images from disk or URL, SVG as vectors |
134
171
  | `checkpoint` | Save layers and restore them later |
135
172
  | `snippets` | Reusable script functions (`lib.name()` in scripts) |
136
173
  | `get_context` · `get_css` · `list_fonts` | File info, generated CSS, installed fonts |
137
- | `list_sessions` · `select_session` | Choose a file when several are open |
174
+ | `comments` · `versions` | Optional, with a Figma token: read, post and answer comments; version history and diffs ([setup](docs/rest.md)) |
175
+ | `list_sessions` · `select_session` | Choose a file when several are open (or pass `file` to any tool) |
138
176
 
139
177
  Each tool describes its parameters to the agent, which needs no extra instructions.
140
178
 
@@ -147,6 +185,7 @@ Each tool describes its parameters to the agent, which needs no extra instructio
147
185
  | **Version mismatch** | The plugin and the server come from different releases: reopen the plugin, or update both. |
148
186
 
149
187
  Logs, screenshots, comparison heatmaps and exported code are written to `%TEMP%\figma-bridge`.
188
+ `import_web` uses your installed Chrome or Edge; set `FIGMA_BRIDGE_BROWSER` to use another Chromium-based browser.
150
189
 
151
190
  ## Development
152
191
 
@@ -154,12 +193,15 @@ Logs, screenshots, comparison heatmaps and exported code are written to `%TEMP%\
154
193
  bun install # also builds the plugin and dist/server.js
155
194
  bun run build # plugin/code.ts → plugin/code.js, src/cli.ts → dist/server.js (Node)
156
195
  bun run check # type-check server and plugin, reject syntax Figma cannot run
157
- bun test # unit tests (bridge, setup, schemas, tokens, code generation)
196
+ bun test # unit tests (bridge, setup, schemas, tokens, code generation, web import, Roblox)
158
197
  bun run test # end-to-end test against an open Figma file
159
198
  ```
160
199
 
161
- To release, change `version` in `package.json`, then run **Actions → Release → Run workflow** on `main`: it publishes to
162
- npm and creates the GitHub release.
200
+ To release, change `version` in `package.json` and `server.json`, then run **Actions → Release → Run workflow** on `main`:
201
+ it publishes to npm and creates the GitHub release. Directory listings (MCP Registry, Glama, Smithery, LobeHub) are
202
+ described in [docs/publishing.md](docs/publishing.md).
163
203
 
164
- Options: `FIGMA_BRIDGE_PORT` (default `3055`), `FIGMA_BRIDGE_CHANNEL`, `FIGMA_BRIDGE_OUT`, `FIGMA_BRIDGE_SNIPPETS`.
204
+ Options: `FIGMA_BRIDGE_PORT` (default `3055`), `FIGMA_BRIDGE_CHANNEL`, `FIGMA_BRIDGE_OUT`, `FIGMA_BRIDGE_SNIPPETS`,
205
+ `FIGMA_BRIDGE_BROWSER`, `FIGMA_TOKEN` for the optional REST tools, and `ROBLOX_API_KEY` + `ROBLOX_CREATOR_ID` for
206
+ Roblox asset upload.
165
207
  The server listens on `127.0.0.1` only, and browsers can't send it commands.