figma-mcp-console 0.1.1 β 0.1.3
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 +212 -9
- package/package.json +4 -1
package/README.md
CHANGED
|
@@ -9,15 +9,113 @@
|
|
|
9
9
|
|
|
10
10
|
## β¨ What can it do?
|
|
11
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
|
|
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
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
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
|
|
15
16
|
|
|
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
|
+
---
|
|
17
20
|
|
|
18
21
|
## β‘ Quick start
|
|
19
22
|
|
|
20
|
-
**
|
|
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`):
|
|
60
|
+
|
|
61
|
+
```json
|
|
62
|
+
{
|
|
63
|
+
"mcpServers": {
|
|
64
|
+
"figma-console": {
|
|
65
|
+
"command": "npx",
|
|
66
|
+
"args": ["-y", "figma-mcp-console@latest"]
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
```
|
|
71
|
+
|
|
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**):
|
|
21
119
|
|
|
22
120
|
```json
|
|
23
121
|
{
|
|
@@ -30,17 +128,122 @@
|
|
|
30
128
|
}
|
|
31
129
|
```
|
|
32
130
|
|
|
33
|
-
|
|
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".)*
|
|
34
189
|
|
|
35
|
-
|
|
190
|
+
#### π¨ Draw a Figma design from a requirement
|
|
191
|
+
|
|
192
|
+
> **π Copy-paste prompt:**
|
|
36
193
|
|
|
37
194
|
```text
|
|
38
|
-
|
|
39
|
-
|
|
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.
|
|
40
233
|
```
|
|
41
234
|
|
|
42
|
-
|
|
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 |
|
|
43
244
|
|
|
44
245
|
## π License
|
|
45
246
|
|
|
46
|
-
MIT Β© [Hoang Le Thien An](https://github.com/hoangann2000)
|
|
247
|
+
[MIT](https://github.com/hoangann2000/figma-mcp-console/blob/main/LICENSE) β Β© [Hoang Le Thien An](https://github.com/hoangann2000)
|
|
248
|
+
|
|
249
|
+
> This is an independent community project, not affiliated with or endorsed by Figma, Inc. "Figma" is a trademark of Figma, Inc.
|
package/package.json
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "figma-mcp-console",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
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"
|