figma-mcp-console 0.2.1 → 0.3.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 +35 -41
- package/bin.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -32,12 +32,20 @@ No install needed — `npx` downloads and runs everything automatically.
|
|
|
32
32
|
<details>
|
|
33
33
|
<summary><b>Claude CLI</b></summary>
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
For one project — run inside that project (registers it there only):
|
|
36
36
|
|
|
37
37
|
```sh
|
|
38
38
|
claude mcp add figma-console -- npx -y figma-mcp-console@latest
|
|
39
39
|
```
|
|
40
40
|
|
|
41
|
+
For all your projects at once — add it globally instead:
|
|
42
|
+
|
|
43
|
+
```sh
|
|
44
|
+
claude mcp add --scope user figma-console -- npx -y figma-mcp-console@latest
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Both work the same at runtime: each Claude session starts its own server instance in that project's directory (so exported assets land in the right project), and all instances share one local bridge to Figma automatically.
|
|
48
|
+
|
|
41
49
|
Or add to the project's `.mcp.json`:
|
|
42
50
|
|
|
43
51
|
```json
|
|
@@ -157,55 +165,44 @@ Standard MCP stdio transport — any client works. Set the command to `npx` with
|
|
|
157
165
|
|
|
158
166
|
</details>
|
|
159
167
|
|
|
160
|
-
> 💡 **Tip:**
|
|
168
|
+
> 💡 **Tip:** exported assets are written relative to the directory the server runs in. CLI tools (Claude CLI, Codex, Cursor, …) start it in your project directory, so global registration is fine. In clients without a working directory (e.g. Claude Desktop), pass explicit export paths or prefer a project-level config where available.
|
|
161
169
|
|
|
162
170
|
### Step 2 — Install the Figma plugin
|
|
163
171
|
|
|
164
172
|
1. Download **[plugin.zip](https://github.com/hoangann2000/figma-mcp-console/releases/latest)** and unzip it
|
|
165
173
|
2. In **Figma Desktop**: **Plugins → Development → Import plugin from manifest…** → select `manifest.json` *(one-time step)*
|
|
166
174
|
3. Run it: **Plugins → Development → Figma MCP Console** — and **keep the plugin window open** while you work. 🟢 Green dot = connected
|
|
175
|
+
4. Working with several Figma files at once? Run the plugin in **each** file — every window connects to the same local bridge, and the AI picks the right file per call
|
|
167
176
|
|
|
168
177
|
### Step 3 — Try it
|
|
169
178
|
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
In Figma, right-click the page's frame → **Copy link to selection**, then paste this prompt:
|
|
173
|
-
|
|
174
|
-
> **📋 Copy-paste prompt:**
|
|
179
|
+
**Figma → code** — right-click a frame → **Copy link to selection**, then:
|
|
175
180
|
|
|
176
181
|
```text
|
|
177
|
-
Implement this Figma page in our project: <paste link
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
- Export icons from the design as SVG into public/icons and images as PNG
|
|
181
|
-
into public/images, and use those files in the code — do not create your own
|
|
182
|
-
- The design is the desktop layout (1440px); make the page responsive
|
|
183
|
-
and adapt it sensibly for tablet and mobile
|
|
184
|
-
- When done, screenshot the Figma frame, compare it with the implemented
|
|
185
|
-
page, and fix any differences before finishing
|
|
182
|
+
Implement this Figma page in our project: <paste link>. Match layout, spacing,
|
|
183
|
+
type and colors; export its icons/images into the project; screenshot the frame
|
|
184
|
+
and compare when done.
|
|
186
185
|
```
|
|
187
186
|
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
#### 🎨 Draw a Figma design from a requirement
|
|
191
|
-
|
|
192
|
-
> **📋 Copy-paste prompt:**
|
|
187
|
+
**Requirement → Figma:**
|
|
193
188
|
|
|
194
189
|
```text
|
|
195
|
-
Design a landing page (desktop, 1440px
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
- light theme, primary color #2563EB, font Inter
|
|
200
|
-
- use auto-layout for every section, 80px vertical spacing between sections
|
|
201
|
-
- when done, take a screenshot, compare it against this brief, and fix
|
|
202
|
-
anything that's off
|
|
190
|
+
Design a SaaS landing page in Figma (desktop, 1440px): hero + CTA, three feature
|
|
191
|
+
cards, pricing with three plans, footer. Light theme, use auto-layout, then
|
|
192
|
+
screenshot and fix anything off.
|
|
203
193
|
```
|
|
204
194
|
|
|
205
|
-
> 🎯
|
|
195
|
+
> 🎯 Asking the AI to **screenshot and compare** at the end makes it check its own work instead of guessing.
|
|
206
196
|
|
|
207
197
|
---
|
|
208
198
|
|
|
199
|
+
## 🗂 Multiple files, multiple projects
|
|
200
|
+
|
|
201
|
+
All AI sessions and all Figma files share **one local bridge** on port 2000 — the first MCP server to start owns it, later ones join it automatically, and if the owner exits another session takes over within a second. Nothing to configure.
|
|
202
|
+
|
|
203
|
+
- **Several Figma files**: run the plugin in each file (its window shows *Connected · \<file name\>*). With more than one file connected, every tool accepts a `file` parameter (file name, case-insensitive), and `list_files` shows what's connected — so you can say things like *"copy the primary color from **Design System** into the CTA button in **Landing Page**"* in a single session. With one file connected, nothing changes.
|
|
204
|
+
- **Several code projects**: each AI session (one per project) reaches every connected file through the shared bridge. State which file you mean in the prompt and each session works with the right one.
|
|
205
|
+
|
|
209
206
|
## 🧠 Teach your AI what to export, and where
|
|
210
207
|
|
|
211
208
|
Exports follow the file extension the AI picks (`.svg` for vector, `.png`/`.jpg` for bitmap, with an optional 0.5–4x scale). It decides based on what you ask — so put your preferences in the project rules file once, and stop repeating yourself:
|
|
@@ -218,26 +215,23 @@ Exports follow the file extension the AI picks (`.svg` for vector, `.png`/`.jpg`
|
|
|
218
215
|
| VS Code Copilot | `.github/copilot-instructions.md` |
|
|
219
216
|
| Windsurf | `.windsurfrules` |
|
|
220
217
|
|
|
221
|
-
> **📋 Copy-paste rules** (adjust paths
|
|
218
|
+
> **📋 Copy-paste rules** (adjust paths — this fits Next.js):
|
|
222
219
|
|
|
223
220
|
```markdown
|
|
224
221
|
## Figma asset rules
|
|
225
|
-
- Icons:
|
|
226
|
-
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
- File names: kebab-case, English, descriptive (arrow-left.svg, hero-banner.png).
|
|
230
|
-
Ignore the Figma layer names if they are messy.
|
|
231
|
-
- Design tokens: read them with get_variable_defs and map to our theme config.
|
|
232
|
-
- After building a screen, take a screenshot and fix issues before finishing.
|
|
222
|
+
- Icons: SVG into public/icons/. Images: PNG into public/images/.
|
|
223
|
+
- File names: kebab-case English (arrow-left.svg, hero-banner.png).
|
|
224
|
+
- Read design tokens with get_variable_defs; map them to our theme config.
|
|
225
|
+
- After building a screen, screenshot and fix issues before finishing.
|
|
233
226
|
```
|
|
234
227
|
|
|
235
228
|
## 🔧 Troubleshooting
|
|
236
229
|
|
|
237
230
|
| Problem | Fix |
|
|
238
231
|
|---|---|
|
|
239
|
-
| ❌ "Figma plugin is
|
|
240
|
-
| 🕐 Plugin says "
|
|
232
|
+
| ❌ "no Figma plugin is connected" | Open the plugin in Figma Desktop (**Plugins → Development → Figma MCP Console**) and keep its window open — in every file you want the AI to touch |
|
|
233
|
+
| 🕐 Plugin says "Searching for MCP server…" | Normal before your AI client connects — the server starts automatically with it. If it never connects, click the status line to retry, or restart your AI client |
|
|
234
|
+
| 🗂 "N Figma files are connected; pass the file parameter" | More than one plugin window is open — tell the AI which file you mean (or close the extra plugin windows) |
|
|
241
235
|
| 🚫 The MCP server doesn't appear in your AI tool | Check Node.js 18+ is installed (`node -v`); the first run also needs internet access to download the server |
|
|
242
236
|
| 📁 Exported files end up in the wrong folder | Register the server in the project-level config, not the global one (see the tip in Step 1) |
|
|
243
237
|
| 🔤 Font errors when creating text | The Figma file uses a font not installed on your machine — the error message names it |
|
package/bin.js
CHANGED
|
@@ -19,7 +19,7 @@ const REPO = "hoangann2000/figma-mcp-console"; // must match the GitHub repo
|
|
|
19
19
|
// The GitHub release tag to download the server binary from. Decoupled from
|
|
20
20
|
// pkg.version so npm-only updates (README, wrapper fixes) don't require a new
|
|
21
21
|
// GitHub release. Bump this ONLY when a new vX.Y.Z release exists on GitHub.
|
|
22
|
-
const BINARY_VERSION = "0.
|
|
22
|
+
const BINARY_VERSION = "0.3.0";
|
|
23
23
|
|
|
24
24
|
const GOOS = { darwin: "darwin", linux: "linux", win32: "windows" }[process.platform];
|
|
25
25
|
const GOARCH = { x64: "amd64", arm64: "arm64" }[process.arch];
|