@clovis500c/figma-bridge 1.8.0 → 1.13.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 +49 -13
- package/dist/server.js +2256 -351
- package/package.json +7 -3
- package/plugin/code.js +577 -20
- package/plugin/manifest.json +2 -1
- package/plugin/ui.html +24 -3
package/README.md
CHANGED
|
@@ -5,12 +5,17 @@
|
|
|
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
|
-
<p align="center"><img src="docs/plugin.
|
|
14
|
+
<p align="center"><img src="docs/plugin.png" alt="Figma Bridge plugin" width="620"></p>
|
|
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
|
+
-->
|
|
14
19
|
|
|
15
20
|
## Features
|
|
16
21
|
|
|
@@ -21,9 +26,31 @@ and any other MCP client.
|
|
|
21
26
|
- **Read existing designs** compactly, search every page, and reuse the file's design system.
|
|
22
27
|
- **Check its own work** with screenshots, a design audit, and a pixel diff against a mockup.
|
|
23
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)).
|
|
24
31
|
- **200 000+ icons** through Iconify, checkpoints to roll back, and a library of reusable scripts.
|
|
25
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.
|
|
26
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
|
+
|
|
27
54
|
## Installation
|
|
28
55
|
|
|
29
56
|
Requires [Node.js](https://nodejs.org) 20+ and the Figma **desktop** app.
|
|
@@ -41,7 +68,7 @@ Requires [Node.js](https://nodejs.org) 20+ and the Figma **desktop** app.
|
|
|
41
68
|
|
|
42
69
|
3. Restart your AI client, open a Figma file and run **Plugins → Development → Figma Bridge**. A green **Live** badge means it's connected.
|
|
43
70
|
|
|
44
|
-
|
|
71
|
+
**Updates are automatic:** each time your AI client starts, it runs the latest release and refreshes the plugin. Reopen the plugin in Figma when it shows **Update installed**.
|
|
45
72
|
|
|
46
73
|
<details>
|
|
47
74
|
<summary>With Bun instead of npm</summary>
|
|
@@ -104,11 +131,15 @@ Keep the plugin open (the **—** button collapses it to a thin bar) and ask you
|
|
|
104
131
|
|
|
105
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.
|
|
106
133
|
|
|
107
|
-
>
|
|
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.
|
|
108
137
|
|
|
109
|
-
>
|
|
138
|
+
> Audit our design system, fix what can be fixed safely, and tell me the score before and after.
|
|
110
139
|
|
|
111
|
-
|
|
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).
|
|
112
143
|
|
|
113
144
|
When your agent needs you to point at something, the plugin shows **Your agent is waiting** until you select it.
|
|
114
145
|
A running command has a **Cancel** button: `build` stops at the next layer, but a script cannot be interrupted and
|
|
@@ -120,7 +151,7 @@ To reopen the plugin later, use **Ctrl+Alt+P** or the **Figma Bridge** button in
|
|
|
120
151
|
|
|
121
152
|
| Tool | Purpose |
|
|
122
153
|
|---|---|
|
|
123
|
-
| `build` | Create a layout
|
|
154
|
+
| `build` | Create a layout in one call: grid, rich text, variants, reactions; FigJam boards and diagrams; slides |
|
|
124
155
|
| `import_web` | Rebuild a website or HTML as editable layers, one frame per viewport |
|
|
125
156
|
| `run_script` | Run any Figma Plugin API code |
|
|
126
157
|
| `describe` | Compact outline of existing layers |
|
|
@@ -134,12 +165,14 @@ To reopen the plugin later, use **Ctrl+Alt+P** or the **Figma Bridge** button in
|
|
|
134
165
|
| `prototype` | Link frames (click, hover, transitions) and set flow starting points |
|
|
135
166
|
| `annotate` | Add, list or clear Dev Mode annotations |
|
|
136
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 |
|
|
137
169
|
| `insert_icon` · `search_icons` | Iconify icons as editable vectors |
|
|
138
170
|
| `place_image` · `import_svg` | Images from disk or URL, SVG as vectors |
|
|
139
171
|
| `checkpoint` | Save layers and restore them later |
|
|
140
172
|
| `snippets` | Reusable script functions (`lib.name()` in scripts) |
|
|
141
173
|
| `get_context` · `get_css` · `list_fonts` | File info, generated CSS, installed fonts |
|
|
142
|
-
| `
|
|
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) |
|
|
143
176
|
|
|
144
177
|
Each tool describes its parameters to the agent, which needs no extra instructions.
|
|
145
178
|
|
|
@@ -149,7 +182,8 @@ Each tool describes its parameters to the agent, which needs no extra instructio
|
|
|
149
182
|
|---|---|
|
|
150
183
|
| **Offline** | The MCP server isn't running: start or restart your AI client and check that `FigmaBridge` is enabled. |
|
|
151
184
|
| **Port busy** | Another program uses port 3055. Close it; the plugin reconnects. |
|
|
152
|
-
| **
|
|
185
|
+
| **Update installed** | A newer version was installed: click **Reopen**, then run the plugin again (Ctrl+Alt+P). |
|
|
186
|
+
| **Older server** | Your AI client still runs an older release: restart it. |
|
|
153
187
|
|
|
154
188
|
Logs, screenshots, comparison heatmaps and exported code are written to `%TEMP%\figma-bridge`.
|
|
155
189
|
`import_web` uses your installed Chrome or Edge; set `FIGMA_BRIDGE_BROWSER` to use another Chromium-based browser.
|
|
@@ -160,13 +194,15 @@ Logs, screenshots, comparison heatmaps and exported code are written to `%TEMP%\
|
|
|
160
194
|
bun install # also builds the plugin and dist/server.js
|
|
161
195
|
bun run build # plugin/code.ts → plugin/code.js, src/cli.ts → dist/server.js (Node)
|
|
162
196
|
bun run check # type-check server and plugin, reject syntax Figma cannot run
|
|
163
|
-
bun test # unit tests (bridge, setup, schemas, tokens, code generation, web import)
|
|
197
|
+
bun test # unit tests (bridge, setup, schemas, tokens, code generation, web import, Roblox)
|
|
164
198
|
bun run test # end-to-end test against an open Figma file
|
|
165
199
|
```
|
|
166
200
|
|
|
167
|
-
To release, change `version` in `package.json`, then run **Actions → Release → Run workflow** on `main`:
|
|
168
|
-
npm and creates the GitHub release.
|
|
201
|
+
To release, change `version` in `package.json` and `server.json`, then run **Actions → Release → Run workflow** on `main`:
|
|
202
|
+
it publishes to npm and creates the GitHub release. Directory listings (MCP Registry, Glama, Smithery, LobeHub) are
|
|
203
|
+
described in [docs/publishing.md](docs/publishing.md).
|
|
169
204
|
|
|
170
205
|
Options: `FIGMA_BRIDGE_PORT` (default `3055`), `FIGMA_BRIDGE_CHANNEL`, `FIGMA_BRIDGE_OUT`, `FIGMA_BRIDGE_SNIPPETS`,
|
|
171
|
-
`FIGMA_BRIDGE_BROWSER
|
|
206
|
+
`FIGMA_BRIDGE_BROWSER`, `FIGMA_TOKEN` for the optional REST tools, and `ROBLOX_API_KEY` + `ROBLOX_CREATOR_ID` for
|
|
207
|
+
Roblox asset upload.
|
|
172
208
|
The server listens on `127.0.0.1` only, and browsers can't send it commands.
|