@neyasbltb_88/figbridge 0.0.0-stage → 0.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.
- package/LICENSE +21 -0
- package/README.md +430 -2
- package/bin/darwin-amd64/figbridge +0 -0
- package/bin/darwin-arm64/figbridge +0 -0
- package/bin/linux-amd64/figbridge +0 -0
- package/bin/linux-arm64/figbridge +0 -0
- package/bin/run.js +30 -0
- package/bin/windows-amd64/figbridge.exe +0 -0
- package/bin/windows-arm64/figbridge.exe +0 -0
- package/package.json +35 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 neyasbltb88
|
|
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,431 @@
|
|
|
1
|
-
#
|
|
1
|
+
# figbridge
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Figma MCP — Free, No Rate Limits
|
|
4
|
+
|
|
5
|
+
Open-source Figma MCP server with full read/write access via plugin — no REST API, no rate limits. Turn text into designs and designs into real code. Works with Cursor, Claude, GitHub Copilot, and any MCP-compatible AI tool.
|
|
6
|
+
|
|
7
|
+
**Highlights**
|
|
8
|
+
- No Figma API token required
|
|
9
|
+
- No rate limits — free plan friendly
|
|
10
|
+
- **Read and Write** live Figma data via plugin bridge
|
|
11
|
+
- Supports multiple AI tools simultaneously
|
|
12
|
+
- Written in Go, distributed via npm
|
|
13
|
+
|
|
14
|
+
https://github.com/user-attachments/assets/17bda971-0e83-4f18-8758-8ac2b8dcba62
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## Why this exists
|
|
19
|
+
|
|
20
|
+
Most Figma MCP servers rely on the **Figma REST API**.
|
|
21
|
+
|
|
22
|
+
That sounds fine… until you hit this:
|
|
23
|
+
|
|
24
|
+
| Plan | Limit |
|
|
25
|
+
|------|-------|
|
|
26
|
+
| Starter / View / Collab | **6 tool calls/month** |
|
|
27
|
+
| Pro / Org (Dev seat) | 200 tool calls/day |
|
|
28
|
+
| Enterprise | 600 tool calls/day |
|
|
29
|
+
|
|
30
|
+
If you're experimenting with AI tools, you'll burn through that in minutes.
|
|
31
|
+
|
|
32
|
+
I didn't have enough money to pay for higher limits.
|
|
33
|
+
So I built something that **doesn't use the API at all**.
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## Installation & Setup
|
|
38
|
+
|
|
39
|
+
Install via `npx` — no build step required. Follow the steps below.
|
|
40
|
+
|
|
41
|
+
### 1. Configure your AI tool
|
|
42
|
+
|
|
43
|
+
**Claude Code CLI**
|
|
44
|
+
```bash
|
|
45
|
+
claude mcp add -s project figbridge -- npx -y @neyasbltb_88/figbridge@latest
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
**.mcp.json** (Claude and other MCP-compatible tools)
|
|
49
|
+
```json
|
|
50
|
+
{
|
|
51
|
+
"mcpServers": {
|
|
52
|
+
"figbridge": {
|
|
53
|
+
"command": "npx",
|
|
54
|
+
"args": ["-y", "@neyasbltb_88/figbridge"]
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
**.vscode/mcp.json** (Cursor / VS Code / GitHub Copilot)
|
|
61
|
+
```json
|
|
62
|
+
{
|
|
63
|
+
"servers": {
|
|
64
|
+
"figbridge": {
|
|
65
|
+
"type": "stdio",
|
|
66
|
+
"command": "npx",
|
|
67
|
+
"args": [
|
|
68
|
+
"-y",
|
|
69
|
+
"@neyasbltb_88/figbridge"
|
|
70
|
+
]
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
**OpenCode CLI** (add `--global` to make it available in every project)
|
|
77
|
+
```bash
|
|
78
|
+
opencode mcp add figbridge -- npx -y @neyasbltb_88/figbridge@latest
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
**opencode.json** (project root, or `~/.config/opencode/opencode.json` for every project)
|
|
82
|
+
```json
|
|
83
|
+
{
|
|
84
|
+
"$schema": "https://opencode.ai/config.json",
|
|
85
|
+
"mcp": {
|
|
86
|
+
"servers": {
|
|
87
|
+
"figbridge": {
|
|
88
|
+
"type": "local",
|
|
89
|
+
"command": ["npx", "-y", "@neyasbltb_88/figbridge"]
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### 2. Install the Figma plugin
|
|
97
|
+
|
|
98
|
+
1. In Figma Desktop: **Plugins → Development → Import plugin from manifest**
|
|
99
|
+
2. Select `manifest.json` from the [plugin.zip](https://github.com/neyasbltb88/figbridge/releases)
|
|
100
|
+
3. Run the plugin inside any Figma file
|
|
101
|
+
|
|
102
|
+
The plugin window follows Figma's theme and shows the connection, the plugin's and the server's versions (a banner when they differ: update the plugin), the call that is running and the last five calls with their time and errors. Writes and scripts run one at a time: one that outlives its timeout makes the next ones fail at once as "stuck", and the window shows **Stop**, which frees the queue — the abandoned call may still change the file. One Figma file holds the connection: running the plugin in a second file takes it over, and the first shows **Reconnect** instead of reconnecting by itself.
|
|
103
|
+
|
|
104
|
+
---
|
|
105
|
+
|
|
106
|
+
## Skills
|
|
107
|
+
|
|
108
|
+
Skills teach the model how to use the tools well — above all, how to lay out a screen from a picture so that the result is editable: auto-layout instead of hand-set positions, one text node per paragraph, components and instances for everything that repeats.
|
|
109
|
+
|
|
110
|
+
| Skill | Load it |
|
|
111
|
+
|-------|---------|
|
|
112
|
+
| `figma-layout` | before laying out a screen, a section or a card from a picture or a description |
|
|
113
|
+
| `figma-components` | before building anything that repeats or has states |
|
|
114
|
+
| `figma-plugin-api` | before the first `use_figma` call that changes the file |
|
|
115
|
+
| `figma-read` | before inspecting or analysing a design |
|
|
116
|
+
|
|
117
|
+
The skills live in [`skills/`](skills/). The server also serves them itself, so every client gets them:
|
|
118
|
+
|
|
119
|
+
- **MCP resources** `skill://<name>/SKILL.md` and `skill://<name>/references/<file>`;
|
|
120
|
+
- **MCP prompts** named after the skills;
|
|
121
|
+
- the server's `instructions` (sent in `initialize`) tell the model which skill to read before which work.
|
|
122
|
+
|
|
123
|
+
### Claude Code
|
|
124
|
+
|
|
125
|
+
Install the plugin — the MCP server and the skills in one step (Claude Code 2.1.275 or later):
|
|
126
|
+
|
|
127
|
+
```
|
|
128
|
+
/plugin install figbridge --marketplace neyasbltb88/figbridge
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
Older versions: `/plugin marketplace add neyasbltb88/figbridge`, then `/plugin install figbridge@figbridge`. The plugin starts the server with `npx`; the first start downloads the package and can take longer than Claude Code's 30-second connect timeout — run `/mcp` to reconnect. If you already added the server with `claude mcp add`, remove it, or keep it and use the plugin for the skills only.
|
|
132
|
+
|
|
133
|
+
### OpenCode
|
|
134
|
+
|
|
135
|
+
OpenCode loads skills from `.claude/skills` of the project and of your home directory, and from the paths in its config. Point it at the skills of a checkout of this repository:
|
|
136
|
+
|
|
137
|
+
**opencode.json**
|
|
138
|
+
```json
|
|
139
|
+
{
|
|
140
|
+
"$schema": "https://opencode.ai/config.json",
|
|
141
|
+
"skills": { "paths": ["/absolute/path/to/figbridge/skills"] }
|
|
142
|
+
}
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
or copy the four `skills/figma-*` directories into `~/.claude/skills/`.
|
|
146
|
+
|
|
147
|
+
### Other clients
|
|
148
|
+
|
|
149
|
+
Clients without skill support read the `instructions` and fetch a skill as the resource `skill://figma-layout/SKILL.md` or the prompt `figma-layout`. Where a client shows neither, paste the skill into the conversation or the system prompt.
|
|
150
|
+
|
|
151
|
+
### Results
|
|
152
|
+
|
|
153
|
+
Three reference screens ([`benchmark/`](benchmark/)) laid out from a picture, scored by `lint_layout` (structure, out of 66):
|
|
154
|
+
|
|
155
|
+
| Model | without skills | with skills |
|
|
156
|
+
|-------|----------------|-------------|
|
|
157
|
+
| Claude Sonnet 5.5 (Claude Code) | 47–51 | 64–66 |
|
|
158
|
+
| DeepSeek V4.1 Flash (OpenCode) | 51–66 | 66 |
|
|
159
|
+
| Kimi for Coding (OpenCode) | 51 | 66 |
|
|
160
|
+
| Claude Haiku 5.5 (Claude Code subagent) | 44–51 | 62–66 |
|
|
161
|
+
|
|
162
|
+
With the skills every finished run reused components and instances throughout and, but for two Haiku runs (catalog 1282 px tall instead of 1316, landing-bank 4979 instead of 4880), matched the reference's size; without them most runs built no components at all. Details, screenshots next to the references and what the runs cost: [`benchmark/results/legacy/2026-11-25-summary.md`](benchmark/results/legacy/2026-11-25-summary.md).
|
|
163
|
+
|
|
164
|
+
---
|
|
165
|
+
|
|
166
|
+
## Running Locally (from source)
|
|
167
|
+
|
|
168
|
+
Build the server and the plugin yourself instead of using the npm package and `plugin.zip`.
|
|
169
|
+
|
|
170
|
+
### Requirements
|
|
171
|
+
|
|
172
|
+
- [Go](https://go.dev/dl/) 1.26.1 or newer
|
|
173
|
+
- [Node.js](https://nodejs.org/) 18 or newer
|
|
174
|
+
- Figma Desktop (development plugins can't be imported in the browser)
|
|
175
|
+
|
|
176
|
+
### 1. Build
|
|
177
|
+
|
|
178
|
+
From the repository root, install the plugin dependencies once:
|
|
179
|
+
|
|
180
|
+
```bash
|
|
181
|
+
npm run install:plugin
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
Then build:
|
|
185
|
+
|
|
186
|
+
```bash
|
|
187
|
+
npm run build # server + plugin
|
|
188
|
+
npm run build:server # server only → bin/figbridge (bin/figbridge.exe on Windows)
|
|
189
|
+
npm run build:plugin # plugin only → plugin/dist/ (manifest.json, code.js, index.html)
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
On Windows, `build:server` also writes two launchers next to the binary: `bin/figbridge.cmd` (cmd, PowerShell) and `bin/figbridge` (Git Bash). They hold the binary's absolute path, so you can copy them into any folder on your `PATH` and run `figbridge` from any console. Rebuilding updates the binary in place, so copied launchers keep working; copy them again only if you move the repository.
|
|
193
|
+
|
|
194
|
+
### 2. Configure your AI tool
|
|
195
|
+
|
|
196
|
+
Point it at the built binary instead of `npx`, using its absolute path.
|
|
197
|
+
|
|
198
|
+
**Claude Code CLI**
|
|
199
|
+
```bash
|
|
200
|
+
claude mcp add -s user figbridge -- /absolute/path/to/figbridge/bin/figbridge
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
**.mcp.json**
|
|
204
|
+
```json
|
|
205
|
+
{
|
|
206
|
+
"mcpServers": {
|
|
207
|
+
"figbridge": {
|
|
208
|
+
"command": "/absolute/path/to/figbridge/bin/figbridge"
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
**OpenCode CLI**
|
|
215
|
+
```bash
|
|
216
|
+
opencode mcp add --global figbridge -- /absolute/path/to/figbridge/bin/figbridge
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
**opencode.json**
|
|
220
|
+
```json
|
|
221
|
+
{
|
|
222
|
+
"$schema": "https://opencode.ai/config.json",
|
|
223
|
+
"mcp": {
|
|
224
|
+
"servers": {
|
|
225
|
+
"figbridge": {
|
|
226
|
+
"type": "local",
|
|
227
|
+
"command": ["/absolute/path/to/figbridge/bin/figbridge"]
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
On Windows, add `.exe` to the path, e.g. `C:/path/to/figbridge/bin/figbridge.exe`.
|
|
235
|
+
|
|
236
|
+
### 3. Install the Figma plugin
|
|
237
|
+
|
|
238
|
+
1. In Figma Desktop: **Plugins → Development → Import plugin from manifest**
|
|
239
|
+
2. Select `plugin/dist/manifest.json`
|
|
240
|
+
3. Run the plugin inside any Figma file and restart your AI tool
|
|
241
|
+
|
|
242
|
+
The plugin shows **Connected** once the server is running. Keep the plugin open while you work: closing it drops the connection. The server listens on port `1994`, so the port must be free.
|
|
243
|
+
|
|
244
|
+
After pulling changes, run `npm run build` again. Figma picks up the rebuilt plugin the next time you run it.
|
|
245
|
+
|
|
246
|
+
### 4. Score a screen from the command line
|
|
247
|
+
|
|
248
|
+
`figbridge score` runs `score_layout` without an AI tool — for benchmarks and calibration. Figma has to be open with the plugin running; the command talks to the server already on port `1994` or becomes it.
|
|
249
|
+
|
|
250
|
+
```bash
|
|
251
|
+
bin/figbridge score --node 92:4788 --ref benchmark/sources/catalog.png --out .claude/tmp/score
|
|
252
|
+
bin/figbridge score --page "Catalog" --ref benchmark/sources/catalog.png
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
`--node` is the root frame, or `--page` takes the largest top-level frame of that page other than `Components`. The report is printed as JSON; `--out` also saves `score.json` and `result.png` (the root rendered at the reference's width; a reference 2× or 3× wider than the root is a Retina picture and counts at 1×). Exit code 1 on an error, 2 on wrong flags.
|
|
256
|
+
|
|
257
|
+
### 5. Lay out a page from HTML
|
|
258
|
+
|
|
259
|
+
An HTML file becomes a Figma layout in one converter pass — the `html_to_tree` tool in the AI tool, or the same converter from the command line:
|
|
260
|
+
|
|
261
|
+
```bash
|
|
262
|
+
bin/figbridge html-to-tree page.html # writes page.figma/ beside the file
|
|
263
|
+
bin/figbridge html-to-tree page.html --components=false # plain frames without Components
|
|
264
|
+
bin/figbridge html-to-tree deck.html --width 1920 --height 1080 --frames 1,2
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
The converter renders the file in the installed Chrome or Edge (headless; `FIGMA_MCP_BROWSER` points at another browser) and writes `page.figma/`: `tree.json` (built in Figma with `create_tree`'s `treePath`), `reference.png` (the browser's screenshot — the reference picture `score_layout` compares against), `summary.json` and the `icons/`, `images/`, `fonts/` the tree uses. With the plugin connected `html_to_tree` also places the references on the current page itself, locked and left of the layout: one `Reference` the size of reference.png, or — for a board of slides — one `Reference / <frame>` per frame, each with its own screenshot in `frames/`; a repeated call replaces the reference it placed before (never a layer of yours with the same name), and `placeReference: false` turns the placement off. The summary lists the outline of the tree with node keys, the fonts with their status in Figma (install the TTF of every face marked missing, then restart Figma), the components built from repeated blocks — masters in a `Components` frame (with "Компоненты" and "Иконки" sections), copies as instances with text, boolean and icon-swap properties — and the repeats left as plain copies, with the reason; `components: false` skips building components and leaves plain frames.
|
|
268
|
+
|
|
269
|
+
Convert only HTML you trust — your own or generated pages, not one from an unknown source: the browser runs the page's scripts with access to the local files (`file://`) and to the network.
|
|
270
|
+
|
|
271
|
+
Supported: auto-layout from flex/grid/flow geometry (uneven gaps become spacers or nested stacks), text with mixed styling as ranges, backgrounds (including repeating gradients), borders, shadows, corner radii, icons as SVG, SVG curved text (`<textPath>`) as glyph outlines (or rotated character layers when the font file is missing), rotated graphic subtrees, pictures, a board of iframes as one frame per slide. The summary's warnings name what did not convert: rotated blocks with text are built upright, blend modes are dropped, geometry that does not line up falls back to coordinates. Copies that differ in more than texts, optional children and icons (a photo, a style) stay plain nodes.
|
|
272
|
+
|
|
273
|
+
### 6. Lay out a page from PSD
|
|
274
|
+
|
|
275
|
+
A Photoshop file (`.psd` / `.psb`) converts in one pass with `psd_to_tree` or from the command line:
|
|
276
|
+
|
|
277
|
+
```bash
|
|
278
|
+
bin/figbridge psd-to-tree design.psd # writes design.figma/ beside the file
|
|
279
|
+
bin/figbridge psd-to-tree design.psd --scale 0.5 # override 72 / dpi default scale
|
|
280
|
+
bin/figbridge psd-to-tree deck.psd --artboards 1,2 # convert selected artboards
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
The converter parses the file in headless Chrome or Edge (`psd.js`) and writes `design.figma/`: `tree.json`, `summary.json`, `reference.png` (the PSD composite, when saved with Maximize Compatibility), `frames/` (artboard crops), `images/` and `icons/`. Coordinates and node sizes are scaled by `72 / dpi` (144 dpi → `0.5`) unless `--scale` is passed, while `images/` and `reference.png` stay at full resolution.
|
|
284
|
+
|
|
285
|
+
Supported as editable Figma nodes: groups and artboards (`unwrap: true` root + `Reference / <artboard>`), text with runs/alignment/rotation, vector primitives (`rectangle`, `ellipse`) and `combine` SVG paths, solid/gradient fills and strokes, drop/inner shadows, solid glows, color/gradient overlays, clipping groups, pixel/vector masks, and Figma-compatible blend modes. Unsupported features (warped/vertical text, skewed text, boolean path operations, pattern fills, bevel/satin, unsupported blend modes, missing Maximize Compatibility composite) fall back to layer raster and appear in `warnings` with the node key.
|
|
286
|
+
|
|
287
|
+
---
|
|
288
|
+
|
|
289
|
+
## Available Tools
|
|
290
|
+
|
|
291
|
+
### Tool profiles — `--tools all`
|
|
292
|
+
|
|
293
|
+
By default the server leaves out ten single-purpose tools whose work `create_tree` and `update_node` do: `create_frame`, `create_rectangle`, `create_ellipse`, `create_text`, `set_text`, `set_fills`, `set_strokes`, `move_nodes`, `resize_nodes`, `rename_node`. The model chooses among fewer tools with no near-duplicates, and the tool list sent with every request is a quarter shorter (about 55 KB instead of 73 KB); the tool descriptions, prompts and skills never point at the ten. `--tools all` (or `FIGMA_MCP_TOOLS=all`) adds them back, for prompts and scripts written for them; `--tools core` is the default. Any other value stops the server with an error naming the allowed ones.
|
|
294
|
+
|
|
295
|
+
```json
|
|
296
|
+
"args": ["-y", "@neyasbltb_88/figbridge", "--tools", "all"]
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
### Run code — `use_figma`
|
|
300
|
+
|
|
301
|
+
| Tool | Description |
|
|
302
|
+
|------|-------------|
|
|
303
|
+
| `use_figma` | Run JavaScript against the Figma Plugin API in the open file |
|
|
304
|
+
|
|
305
|
+
`use_figma` follows the contract of Figma's own MCP tool of the same name, so scripts written by the rules of Figma's `figma-use` skills run here unchanged:
|
|
306
|
+
|
|
307
|
+
- the code is plain JS with top-level `await` and `return`; the returned value comes back as JSON, nodes as `{id, name, type}`, `console.log` output as a separate block;
|
|
308
|
+
- the runtime adds Figma's conveniences over the public Plugin API: `figma.createAutoLayout()`, `node.set()`, `node.query()` / `node.matches()` with CSS-like selectors, `node.tree()`, `await node.screenshot()` and `figma.io.write()` (images come back in the response), `node.placeholder`, `page.findPlacement()`;
|
|
309
|
+
- the `$fig` plan builder from the Cursor variant of the skills is there too: it loads fonts, applies properties in the right order and builds the whole tree in one pass;
|
|
310
|
+
- a failed call reports `safeToRetryWithoutCanvasRead` — whether the script may have changed the document before failing;
|
|
311
|
+
- one call is one undo step (Ctrl+Z).
|
|
312
|
+
|
|
313
|
+
Differences from Figma's own tool: the script runs in the file open in Figma (`fileKey` is ignored), on the page the user is on; only ids from this file are accepted — no library keys.
|
|
314
|
+
|
|
315
|
+
Turning it off: start the server with `--no-exec` (or set `FIGMA_MCP_NO_EXEC=1`) and this client is not offered the tool at all — other clients connected to the same Figma (each runs its own server process) still are; untick **Allow code execution** in the plugin window and calls from every client are refused.
|
|
316
|
+
|
|
317
|
+
Screenshots (`node.screenshot()`, `get_screenshot`, `save_screenshots`) need the Figma window on screen: while it is minimized or covered by other windows Figma does not render exports, and the call fails after 20 s with a hint.
|
|
318
|
+
|
|
319
|
+
### Write — Create
|
|
320
|
+
|
|
321
|
+
| Tool | Description |
|
|
322
|
+
|------|-------------|
|
|
323
|
+
| `create_tree` | Build a whole section or screen in one call from a JSON tree of nodes — or from `treePath`, a tree.json on disk (the HTML converter's), with a short answer and `keys` picking the ids to return; repeated items as components and instances; optional `unwrap: true` on the root promotes its children directly onto the parent; optional `lines` on text nodes checks line-wrap count (`text-wrap-mismatch` in `lint_layout`) |
|
|
324
|
+
| `create_frame` | Create a frame with optional auto-layout, fill, and parent — only with `--tools all` |
|
|
325
|
+
| `create_rectangle` | Create a rectangle with optional fill and corner radius — only with `--tools all` |
|
|
326
|
+
| `create_ellipse` | Create an ellipse or circle — only with `--tools all` |
|
|
327
|
+
| `create_text` | Create a text node (font loaded automatically) — only with `--tools all` |
|
|
328
|
+
| `import_image` | Import a PNG/JPG/GIF from disk or base64 as a rectangle or a node's fill; a picture over Figma's 4096px limit comes in as a frame of tiles (a fill is scaled down); `locked` and `replace` for reference pictures — `replace` swaps the reference placed before under the same parent, not the user's layers of that name |
|
|
329
|
+
| `import_svg` | Create vector layers from SVG markup or an `.svg` file (`filePath` or `path`) — icons, logos, simple graphics |
|
|
330
|
+
| `create_page` | Create a page, with an optional canvas `background`, and switch to it |
|
|
331
|
+
| `create_style` | Create a local paint, text or effect style, applied by name in `create_tree` and `update_node` |
|
|
332
|
+
|
|
333
|
+
### Components
|
|
334
|
+
|
|
335
|
+
| Tool | Description |
|
|
336
|
+
|------|-------------|
|
|
337
|
+
| `create_component` | Make a component from a frame (`nodeId`) or from a tree in the `create_tree` format (`tree`); `textProperties` turns text layers into text properties |
|
|
338
|
+
| `create_instance` | Place instances of a component — several in one call with `items`, each with its own `texts` and `props` |
|
|
339
|
+
| `set_instance_properties` | Set component properties (`props`: text, boolean, variant) and texts by layer name (`texts`) on one or several instances |
|
|
340
|
+
| `combine_as_variants` | Join components named `Property=Value` into a component set laid out as an auto-layout row; `variantNames` renames them in the same call |
|
|
341
|
+
|
|
342
|
+
### Write — Modify
|
|
343
|
+
|
|
344
|
+
| Tool | Description |
|
|
345
|
+
|------|-------------|
|
|
346
|
+
| `update_node` | Change existing nodes — geometry, auto-layout, sizing, fills, strokes and stroke sides, corner radius, effects, opacity, visibility, `locked`, name, text and its styling; instances also take `texts` and `props`; `nodeIds` changes several nodes the same way |
|
|
347
|
+
| `set_text` | Update text content of an existing TEXT node — only with `--tools all` |
|
|
348
|
+
| `set_fills` | Set solid fill color (hex) on a node — only with `--tools all` |
|
|
349
|
+
| `set_strokes` | Set solid stroke color and weight on a node — only with `--tools all` |
|
|
350
|
+
| `move_nodes` | Move nodes to an absolute x/y position — only with `--tools all` |
|
|
351
|
+
| `resize_nodes` | Resize nodes by width and/or height — only with `--tools all` |
|
|
352
|
+
| `rename_node` | Rename a node — only with `--tools all` |
|
|
353
|
+
| `clone_node` | Clone a node, optionally repositioning or reparenting |
|
|
354
|
+
| `reparent_nodes` | Move nodes into another parent and/or to a position among its children — also to reorder them |
|
|
355
|
+
| `wrap_in_auto_layout` | Wrap siblings placed by x/y into a new auto-layout frame in their place, the direction and gap read from how they are arranged |
|
|
356
|
+
| `set_effects` | Replace the shadows and blurs of nodes (`[]` removes them) |
|
|
357
|
+
|
|
358
|
+
### Write — Delete
|
|
359
|
+
|
|
360
|
+
| Tool | Description |
|
|
361
|
+
|------|-------------|
|
|
362
|
+
| `delete_nodes` | Delete one or more nodes permanently |
|
|
363
|
+
|
|
364
|
+
### Document & Selection
|
|
365
|
+
|
|
366
|
+
| Tool | Description |
|
|
367
|
+
|------|-------------|
|
|
368
|
+
| `get_document` | Full current page tree |
|
|
369
|
+
| `get_metadata` | File name, pages, current page; with `nodeId` — the subtree as XML (id, name, type, position, size) |
|
|
370
|
+
| `get_pages` | All pages (IDs + names) — lightweight, no tree loading |
|
|
371
|
+
| `set_current_page` | Switch the current page by id or name |
|
|
372
|
+
| `get_selection` | Currently selected nodes |
|
|
373
|
+
| `get_node` | Single node by ID |
|
|
374
|
+
| `get_nodes_info` | Multiple nodes by ID |
|
|
375
|
+
| `get_design_context` | Depth-limited tree of a node (`nodeId`), the selection or the page, with `detail` level (`minimal`/`compact`/`full`); shows auto-layout, sizing, image and gradient fills |
|
|
376
|
+
| `search_nodes` | Find nodes by name substring and/or type within a subtree |
|
|
377
|
+
| `scan_text_nodes` | All text nodes in a subtree |
|
|
378
|
+
| `scan_nodes_by_types` | Nodes matching given type list |
|
|
379
|
+
| `get_viewport` | Current viewport center, zoom, and visible bounds |
|
|
380
|
+
|
|
381
|
+
### Styles & Variables
|
|
382
|
+
|
|
383
|
+
| Tool | Description |
|
|
384
|
+
|------|-------------|
|
|
385
|
+
| `get_styles` | Paint, text, effect, and grid styles |
|
|
386
|
+
| `get_variable_defs` | Variable collections and values; with `nodeId` — the variables and styles that subtree uses |
|
|
387
|
+
| `get_local_components` | All components + component sets with variant properties |
|
|
388
|
+
| `get_annotations` | Dev-mode annotations |
|
|
389
|
+
| `get_fonts` | All fonts used on the current page, sorted by frequency |
|
|
390
|
+
| `get_reactions` | Prototype/interaction reactions on a node |
|
|
391
|
+
|
|
392
|
+
### Export
|
|
393
|
+
|
|
394
|
+
| Tool | Description |
|
|
395
|
+
|------|-------------|
|
|
396
|
+
| `get_screenshot` | Image export of a node (`nodeId`), several nodes or the selection, returned as images with a caption; without `scale` the long side is at most 1600 px (scale up to 2), a given `scale` is lowered past 7680 px and the caption says so |
|
|
397
|
+
| `save_screenshots` | Export images of nodes to files inside the working directory (server-side, the images do not pass through the model); an existing image file is replaced only with `overwrite: true` |
|
|
398
|
+
| `inspect_image` | Measure a reference picture on disk: size, section bands, palette, text lines with line height; crop a part (with boxes painted over) to look at it or to import it as a photo |
|
|
399
|
+
| `html_to_tree` | Convert an HTML file (`filePath` or `path`) into a create_tree tree on disk — tree.json, reference.png (the browser's screenshot), icons, images, fonts to install — place the references on the current page, and return the summary: outline with keys, fonts with their Figma status, components built from repeats (`components: false` skips components); only for HTML you trust — the page's scripts run with access to local files and the network |
|
|
400
|
+
| `psd_to_tree` | Convert a Photoshop `.psd`/`.psb` file (`filePath` or `path`) into a create_tree tree on disk — tree.json, reference.png (PSD composite), images, icons — place the references on the current page, and return the summary with keys, fonts, and fallback warnings |
|
|
401
|
+
|
|
402
|
+
### Check
|
|
403
|
+
|
|
404
|
+
| Tool | Description |
|
|
405
|
+
|------|-------------|
|
|
406
|
+
| `lint_layout` | Audit a layout's structure — rows placed by hand, a paragraph cut into lines, text lying on a rectangle, repeats that are not components, default names, clipped text… — each finding with its node and the tool that fixes it |
|
|
407
|
+
| `score_layout` | Score a built screen against its reference (a file or a node on the canvas): `total` 0–100 = structure (`lint_layout`, pass `components: false` when built without components) + similarity (sections, elements, sizes, colours, type, SSIM), and the differences to fix with the nodes they are in |
|
|
408
|
+
|
|
409
|
+
### MCP Prompts
|
|
410
|
+
|
|
411
|
+
| Prompt | Description |
|
|
412
|
+
|--------|-------------|
|
|
413
|
+
| `figma-layout`, `figma-components`, `figma-plugin-api`, `figma-read` | The [skills](#skills) |
|
|
414
|
+
| `text_replacement_strategy` | Chunked approach for replacing text across a design |
|
|
415
|
+
| `annotation_conversion_strategy` | Convert manual annotations to native Figma annotations |
|
|
416
|
+
| `swap_overrides_instances` | Transfer overrides between component instances |
|
|
417
|
+
| `reaction_to_connector_strategy` | Map prototype reactions into interaction flow diagrams |
|
|
418
|
+
|
|
419
|
+
---
|
|
420
|
+
|
|
421
|
+
## Related Projects
|
|
422
|
+
|
|
423
|
+
- [magic-spells/figma-mcp-bridge](https://github.com/magic-spells/figma-mcp-bridge)
|
|
424
|
+
- [grab/cursor-talk-to-figma-mcp](https://github.com/grab/cursor-talk-to-figma-mcp)
|
|
425
|
+
- [gethopp/figma-mcp-bridge](https://github.com/gethopp/figma-mcp-bridge)
|
|
426
|
+
|
|
427
|
+
---
|
|
428
|
+
|
|
429
|
+
## Contributing
|
|
430
|
+
|
|
431
|
+
Issues and PRs are welcome.
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/bin/run.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
const { spawnSync } = require('node:child_process');
|
|
5
|
+
const { existsSync } = require('node:fs');
|
|
6
|
+
const path = require('node:path');
|
|
7
|
+
|
|
8
|
+
const PLATFORM_MAP = { darwin: 'darwin', linux: 'linux', win32: 'windows' };
|
|
9
|
+
const ARCH_MAP = { x64: 'amd64', arm64: 'arm64' };
|
|
10
|
+
|
|
11
|
+
const goos = PLATFORM_MAP[process.platform];
|
|
12
|
+
const goarch = ARCH_MAP[process.arch];
|
|
13
|
+
|
|
14
|
+
if (!goos || !goarch) {
|
|
15
|
+
process.stderr.write(`[figbridge] Unsupported platform: ${process.platform}/${process.arch}\n`);
|
|
16
|
+
process.exit(1);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const binaryName = process.platform === 'win32' ? 'figbridge.exe' : 'figbridge';
|
|
20
|
+
const binaryPath = path.join(__dirname, `${goos}-${goarch}`, binaryName);
|
|
21
|
+
|
|
22
|
+
if (!existsSync(binaryPath)) {
|
|
23
|
+
process.stderr.write(
|
|
24
|
+
'[figbridge] Binary not found. Try reinstalling: npm install @neyasbltb_88/figbridge\n'
|
|
25
|
+
);
|
|
26
|
+
process.exit(1);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const result = spawnSync(binaryPath, process.argv.slice(2), { stdio: 'inherit' });
|
|
30
|
+
process.exit(result.status ?? 1);
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,37 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@neyasbltb_88/figbridge",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "A zero-cost, unlimited Figma MCP server — no API key, no rate limits",
|
|
5
|
+
"mcpName": "io.github.neyasbltb88/figbridge",
|
|
6
|
+
"bin": {
|
|
7
|
+
"figbridge": "bin/run.js"
|
|
8
|
+
},
|
|
9
|
+
"files": [
|
|
10
|
+
"bin/run.js",
|
|
11
|
+
"bin/darwin-amd64/",
|
|
12
|
+
"bin/darwin-arm64/",
|
|
13
|
+
"bin/linux-amd64/",
|
|
14
|
+
"bin/linux-arm64/",
|
|
15
|
+
"bin/windows-amd64/",
|
|
16
|
+
"bin/windows-arm64/"
|
|
17
|
+
],
|
|
18
|
+
"keywords": [
|
|
19
|
+
"figma",
|
|
20
|
+
"mcp",
|
|
21
|
+
"model-context-protocol",
|
|
22
|
+
"ai",
|
|
23
|
+
"design"
|
|
24
|
+
],
|
|
25
|
+
"license": "MIT",
|
|
26
|
+
"repository": {
|
|
27
|
+
"type": "git",
|
|
28
|
+
"url": "git+https://github.com/neyasbltb88/figbridge.git"
|
|
29
|
+
},
|
|
30
|
+
"homepage": "https://github.com/neyasbltb88/figbridge#readme",
|
|
31
|
+
"bugs": {
|
|
32
|
+
"url": "https://github.com/neyasbltb88/figbridge/issues"
|
|
33
|
+
},
|
|
34
|
+
"engines": {
|
|
35
|
+
"node": ">=18.0.0"
|
|
36
|
+
}
|
|
37
|
+
}
|