figma-mcp-console 0.1.0 → 0.1.2

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.
Files changed (3) hide show
  1. package/README.md +233 -4
  2. package/bin.js +8 -3
  3. package/package.json +4 -1
package/README.md CHANGED
@@ -1,8 +1,62 @@
1
- # figma-mcp-console
1
+ # Figma MCP Console
2
2
 
3
- Figma MCP server for AI coding assistants — real-time read/write access to Figma Desktop via a local plugin. No API token, no rate limits.
3
+ [![npm](https://img.shields.io/npm/v/figma-mcp-console?color=cb3837&logo=npm)](https://www.npmjs.com/package/figma-mcp-console)
4
+ [![MCP](https://img.shields.io/badge/MCP-Compatible-blue)](https://modelcontextprotocol.io/)
5
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/hoangann2000/figma-mcp-console/blob/main/LICENSE)
4
6
 
5
- This package is a thin launcher: on first run it downloads the prebuilt server binary for your platform from GitHub Releases and starts it.
7
+ > **Let your AI assistant design in Figma — no API token, no rate limits.**
8
+ > Works with Claude CLI · Claude Desktop · Codex · VS Code · Cursor · Antigravity · any MCP client.
9
+
10
+ ## ✨ What can it do?
11
+
12
+ - 🖥️ **Figma → Code** — paste a link to a Figma frame, and the AI implements that exact screen in your codebase, exporting the design's icons and images into your project instead of inventing its own
13
+ - 🎨 **Requirement → Figma** — paste a requirement, and the AI draws the screen in Figma, then screenshots its own work and fixes what's off
14
+ - 🔁 **Token sync** — pull design tokens into your theme config, or build a design system in Figma from your code
15
+ - ✏️ **Bulk editing** — rename layers, replace text across a page, reorganize frames
16
+
17
+ > 💡 **Why no token?** Most Figma MCP servers call the REST API — access token required, and free plans get only a handful of calls. This one drives a plugin **inside Figma Desktop** instead: the same unlimited API every Figma plugin uses. Everything stays on your machine.
18
+
19
+ ---
20
+
21
+ ## ⚡ Quick start
22
+
23
+ **Prerequisites**
24
+
25
+ - [ ] [Node.js](https://nodejs.org) 18+ — check with `node --version`
26
+ - [ ] **Figma Desktop** app (the web app can't run development plugins)
27
+
28
+ ### Step 1 — Add the server to your AI tool
29
+
30
+ No install needed — `npx` downloads and runs everything automatically.
31
+
32
+ <details>
33
+ <summary><b>Claude CLI</b></summary>
34
+
35
+ Run inside the project you work in:
36
+
37
+ ```sh
38
+ claude mcp add figma-console -- npx -y figma-mcp-console@latest
39
+ ```
40
+
41
+ Or add to the project's `.mcp.json`:
42
+
43
+ ```json
44
+ {
45
+ "mcpServers": {
46
+ "figma-console": {
47
+ "command": "npx",
48
+ "args": ["-y", "figma-mcp-console@latest"]
49
+ }
50
+ }
51
+ }
52
+ ```
53
+
54
+ </details>
55
+
56
+ <details>
57
+ <summary><b>Claude Desktop</b></summary>
58
+
59
+ **Settings → Developer → Edit Config** (`claude_desktop_config.json`):
6
60
 
7
61
  ```json
8
62
  {
@@ -15,4 +69,179 @@ This package is a thin launcher: on first run it downloads the prebuilt server b
15
69
  }
16
70
  ```
17
71
 
18
- Full setup guide (including the required Figma Desktop plugin): see the [project README](https://github.com/hoangann2000/figma-mcp-console).
72
+ Restart Claude Desktop. On Windows use `"command": "cmd"`, `"args": ["/c", "npx", "-y", "figma-mcp-console@latest"]`.
73
+
74
+ </details>
75
+
76
+ <details>
77
+ <summary><b>Codex CLI</b></summary>
78
+
79
+ ```sh
80
+ codex mcp add figma-console -- npx -y figma-mcp-console@latest
81
+ ```
82
+
83
+ Or in `~/.codex/config.toml`:
84
+
85
+ ```toml
86
+ [mcp_servers.figma-console]
87
+ command = "npx"
88
+ args = ["-y", "figma-mcp-console@latest"]
89
+ ```
90
+
91
+ </details>
92
+
93
+ <details>
94
+ <summary><b>VS Code (GitHub Copilot)</b></summary>
95
+
96
+ Create `.vscode/mcp.json` (or **Command Palette → "MCP: Add Server"**):
97
+
98
+ ```json
99
+ {
100
+ "servers": {
101
+ "figma-console": {
102
+ "type": "stdio",
103
+ "command": "npx",
104
+ "args": ["-y", "figma-mcp-console@latest"],
105
+ "cwd": "${workspaceFolder}"
106
+ }
107
+ }
108
+ }
109
+ ```
110
+
111
+ Use it from Copilot Chat in **Agent** mode.
112
+
113
+ </details>
114
+
115
+ <details>
116
+ <summary><b>Cursor</b></summary>
117
+
118
+ Create `.cursor/mcp.json` (or **Settings → MCP → Add new MCP server**):
119
+
120
+ ```json
121
+ {
122
+ "mcpServers": {
123
+ "figma-console": {
124
+ "command": "npx",
125
+ "args": ["-y", "figma-mcp-console@latest"]
126
+ }
127
+ }
128
+ }
129
+ ```
130
+
131
+ </details>
132
+
133
+ <details>
134
+ <summary><b>Antigravity</b></summary>
135
+
136
+ Agent panel → **MCP Servers → Manage MCP servers → View raw config** (`mcp_config.json`):
137
+
138
+ ```json
139
+ {
140
+ "mcpServers": {
141
+ "figma-console": {
142
+ "command": "npx",
143
+ "args": ["-y", "figma-mcp-console@latest"]
144
+ }
145
+ }
146
+ }
147
+ ```
148
+
149
+ Click **Refresh** after saving.
150
+
151
+ </details>
152
+
153
+ <details>
154
+ <summary><b>Other MCP clients (opencode, Windsurf, Cline, Gemini CLI, Zed, …)</b></summary>
155
+
156
+ Standard MCP stdio transport — any client works. Set the command to `npx` with args `["-y", "figma-mcp-console@latest"]`.
157
+
158
+ </details>
159
+
160
+ > 💡 **Tip:** register the server in your **project** config (not the global one) so exported files land inside that project.
161
+
162
+ ### Step 2 — Install the Figma plugin
163
+
164
+ 1. Download **[plugin.zip](https://github.com/hoangann2000/figma-mcp-console/releases/latest)** and unzip it
165
+ 2. In **Figma Desktop**: **Plugins → Development → Import plugin from manifest…** → select `manifest.json` *(one-time step)*
166
+ 3. Run it: **Plugins → Development → Figma MCP Console** — and **keep the plugin window open** while you work. 🟢 Green dot = connected
167
+
168
+ ### Step 3 — Try it
169
+
170
+ #### 🖥️ Implement a Figma design in code
171
+
172
+ In Figma, right-click the page's frame → **Copy link to selection**, then paste this prompt:
173
+
174
+ > **📋 Copy-paste prompt:**
175
+
176
+ ```text
177
+ Implement this Figma page in our project: <paste link>
178
+
179
+ - Recreate the layout, spacing, typography and colors exactly as designed
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
186
+ ```
187
+
188
+ The link contains the frame's node id, so the AI knows exactly which page to read. *(No link? Just select the frame in Figma and say "implement the frame I selected".)*
189
+
190
+ #### 🎨 Draw a Figma design from a requirement
191
+
192
+ > **📋 Copy-paste prompt:**
193
+
194
+ ```text
195
+ Design a landing page (desktop, 1440px wide) in Figma for this requirement:
196
+ "SaaS product page: hero with headline and CTA button, three feature cards,
197
+ a pricing section with three plans, and a footer."
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
203
+ ```
204
+
205
+ > 🎯 **The screenshot line matters in both workflows** — it makes the AI look at the actual result and iterate instead of guessing. The more concrete the brief, the closer the first pass lands.
206
+
207
+ ---
208
+
209
+ ## 🧠 Teach your AI what to export, and where
210
+
211
+ 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:
212
+
213
+ | AI tool | Rules file |
214
+ |---|---|
215
+ | Claude CLI / Claude Desktop | `CLAUDE.md` |
216
+ | Codex / opencode | `AGENTS.md` |
217
+ | Cursor | `.cursorrules` |
218
+ | VS Code Copilot | `.github/copilot-instructions.md` |
219
+ | Windsurf | `.windsurfrules` |
220
+
221
+ > **📋 Copy-paste rules** (adjust paths to your project — this one fits Next.js):
222
+
223
+ ```markdown
224
+ ## Figma asset rules
225
+ - Icons: always SVG, into public/icons/. Never export icons as PNG.
226
+ - Images: PNG into public/images/, exported at the size they are actually
227
+ displayed. Use 2x only for small fixed-size images that must stay sharp
228
+ on retina screens; never blanket-export everything at 2x.
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.
233
+ ```
234
+
235
+ ## 🔧 Troubleshooting
236
+
237
+ | Problem | Fix |
238
+ |---|---|
239
+ | ❌ "Figma plugin is not connected" | Open the plugin in Figma Desktop (**Plugins → Development → Figma MCP Console**) and keep its window open |
240
+ | 🕐 Plugin says "Waiting for MCP server on port 2000" | Normal before your AI client connects — the server starts automatically with it. If it never connects, restart your AI client |
241
+ | 🚫 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
+ | 📁 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
+ | 🔤 Font errors when creating text | The Figma file uses a font not installed on your machine — the error message names it |
244
+
245
+ ## 📄 License
246
+
247
+ [MIT](https://github.com/hoangann2000/figma-mcp-console/blob/main/LICENSE) — © [Hoang Le Thien An](https://github.com/hoangann2000)
package/bin.js CHANGED
@@ -16,6 +16,11 @@ const path = require("path");
16
16
  const pkg = require("./package.json");
17
17
  const REPO = "hoangann2000/figma-mcp-console"; // must match the GitHub repo
18
18
 
19
+ // The GitHub release tag to download the server binary from. Decoupled from
20
+ // pkg.version so npm-only updates (README, wrapper fixes) don't require a new
21
+ // GitHub release. Bump this ONLY when a new vX.Y.Z release exists on GitHub.
22
+ const BINARY_VERSION = "0.1.0";
23
+
19
24
  const GOOS = { darwin: "darwin", linux: "linux", win32: "windows" }[process.platform];
20
25
  const GOARCH = { x64: "amd64", arm64: "arm64" }[process.arch];
21
26
 
@@ -29,8 +34,8 @@ if (GOOS === "windows" && GOARCH === "arm64") fail("windows/arm64 builds are not
29
34
 
30
35
  const exe = GOOS === "windows" ? ".exe" : "";
31
36
  const asset = `figma-mcp_${GOOS}_${GOARCH}${exe}`;
32
- const url = `https://github.com/${REPO}/releases/download/v${pkg.version}/${asset}`;
33
- const cacheDir = path.join(os.homedir(), ".figma-mcp-console", pkg.version);
37
+ const url = `https://github.com/${REPO}/releases/download/v${BINARY_VERSION}/${asset}`;
38
+ const cacheDir = path.join(os.homedir(), ".figma-mcp-console", BINARY_VERSION);
34
39
  const binPath = path.join(cacheDir, `figma-mcp${exe}`);
35
40
 
36
41
  function download(from, dest, redirects, done) {
@@ -62,7 +67,7 @@ function run() {
62
67
  if (fs.existsSync(binPath)) {
63
68
  run();
64
69
  } else {
65
- process.stderr.write(`figma-mcp-console: downloading ${asset} v${pkg.version}...\n`);
70
+ process.stderr.write(`figma-mcp-console: downloading ${asset} v${BINARY_VERSION}...\n`);
66
71
  fs.mkdirSync(cacheDir, { recursive: true });
67
72
  // Download to a temp name, then rename, so a concurrently started client
68
73
  // never executes a half-written binary.
package/package.json CHANGED
@@ -1,6 +1,9 @@
1
1
  {
2
2
  "name": "figma-mcp-console",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
+ "scripts": {
5
+ "prepublishOnly": "cp ../README.md ./README.md"
6
+ },
4
7
  "description": "Figma MCP server for AI coding assistants — real-time read/write via a Figma Desktop plugin. No API token, no rate limits.",
5
8
  "bin": {
6
9
  "figma-mcp-console": "bin.js"