figma-rust-mcp 3.2.5 → 3.2.7
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 +37 -5
- package/package.json +1 -1
- package/scripts/test-rust-mcp.sh +2 -2
package/README.md
CHANGED
|
@@ -28,7 +28,7 @@ Enables AI agents (Google Antigravity, Claude Code, Cursor, Windsurf, VS Code, Z
|
|
|
28
28
|
┌────────────────────────────────────────────────────────────────────────┐
|
|
29
29
|
│ Terminal / Background Service │
|
|
30
30
|
│ figma-mcp (Pure Rust Engine) │
|
|
31
|
-
│ • MCP
|
|
31
|
+
│ • MCP Streamable HTTP (/mcp) & legacy SSE (/sse, /message) │
|
|
32
32
|
│ • Dynamic Runtime Server (/plugin/code.js, /plugin/ui.html) │
|
|
33
33
|
│ • In-Memory Fast Index (<1ms Lookups & Incremental Diffs) │
|
|
34
34
|
│ • Design-to-Code Compiler (React/Tailwind, Vue, RN, SwiftUI) │
|
|
@@ -36,8 +36,8 @@ Enables AI agents (Google Antigravity, Claude Code, Cursor, Windsurf, VS Code, Z
|
|
|
36
36
|
│ • Sandboxed JS Runtime (Boa ECMAScript Engine) │
|
|
37
37
|
│ • Binary MessagePack & Progressive Subtree Chunk Receiver │
|
|
38
38
|
└───────────────▲────────────────────────────────────────▲───────────────┘
|
|
39
|
-
│ (ws://127.0.0.1:38451/ws) │ (http://127.0.0.1:38451/
|
|
40
|
-
│ (Dynamic Code Streaming & Hot-Reload) │ (JSON-RPC 2.0 /
|
|
39
|
+
│ (ws://127.0.0.1:38451/ws) │ (http://127.0.0.1:38451/mcp)
|
|
40
|
+
│ (Dynamic Code Streaming & Hot-Reload) │ (JSON-RPC 2.0 / Streamable HTTP)
|
|
41
41
|
┌─────────┴─────────┐ ┌─────────┴─────────┐
|
|
42
42
|
│ Figma Desktop │ │ AI Assistant(s) │
|
|
43
43
|
│ (Thin Loader) │ │ Google Antigravity│
|
|
@@ -122,7 +122,22 @@ cargo build --release
|
|
|
122
122
|
|
|
123
123
|
### 5. Configure Your MCP Client
|
|
124
124
|
|
|
125
|
-
####
|
|
125
|
+
#### Codex and clients using Streamable HTTP (Recommended)
|
|
126
|
+
|
|
127
|
+
Use the `/mcp` endpoint. It accepts `POST` JSON-RPC requests directly:
|
|
128
|
+
|
|
129
|
+
```toml
|
|
130
|
+
[mcp_servers.figma-mcp]
|
|
131
|
+
url = "http://127.0.0.1:38451/mcp"
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
For Codex CLI, the equivalent command is:
|
|
135
|
+
|
|
136
|
+
```bash
|
|
137
|
+
codex mcp add figma-mcp --url http://127.0.0.1:38451/mcp
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
#### Google Antigravity (SSE Transport)
|
|
126
141
|
Add to your `~/.gemini/config/mcp_config.json` or project `.agents/mcp_config.json`:
|
|
127
142
|
```json
|
|
128
143
|
{
|
|
@@ -136,7 +151,7 @@ Add to your `~/.gemini/config/mcp_config.json` or project `.agents/mcp_config.js
|
|
|
136
151
|
|
|
137
152
|
#### Claude Code / Cursor / Windsurf / VS Code / Zed
|
|
138
153
|
|
|
139
|
-
**Option A: SSE Transport (
|
|
154
|
+
**Option A: SSE Transport (for clients that require SSE)**
|
|
140
155
|
```json
|
|
141
156
|
{
|
|
142
157
|
"mcpServers": {
|
|
@@ -147,6 +162,11 @@ Add to your `~/.gemini/config/mcp_config.json` or project `.agents/mcp_config.js
|
|
|
147
162
|
}
|
|
148
163
|
```
|
|
149
164
|
|
|
165
|
+
The SSE transport uses `GET /sse` to open the event stream and `POST /message`
|
|
166
|
+
(or `/messages`) for JSON-RPC messages. Do not configure a Streamable HTTP
|
|
167
|
+
client such as Codex against `/sse`: that endpoint does not accept `POST`, so
|
|
168
|
+
the initialize request will return HTTP 405. Use `/mcp` instead.
|
|
169
|
+
|
|
150
170
|
**Option B: Stdio Subprocess (via NPX)**
|
|
151
171
|
```json
|
|
152
172
|
{
|
|
@@ -159,6 +179,18 @@ Add to your `~/.gemini/config/mcp_config.json` or project `.agents/mcp_config.js
|
|
|
159
179
|
}
|
|
160
180
|
```
|
|
161
181
|
|
|
182
|
+
### 6. Diagnose a stale Figma runtime
|
|
183
|
+
|
|
184
|
+
Check the runtime bundle currently served to Figma Desktop:
|
|
185
|
+
|
|
186
|
+
```bash
|
|
187
|
+
curl http://127.0.0.1:38451/plugin/version
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
The response includes `version` and `runtimeHash`. If the hash changes after an
|
|
191
|
+
upgrade, the dynamic plugin runtime is refreshed automatically. Restart the
|
|
192
|
+
Figma plugin only if the reported hash does not change.
|
|
193
|
+
|
|
162
194
|
---
|
|
163
195
|
|
|
164
196
|
## 🛠️ MCP Tools Reference
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "figma-rust-mcp",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.7",
|
|
4
4
|
"description": "Claude Code to Figma — Bidirectional MCP bridge. AI draws UI on Figma canvas, reads designs back. Works with Claude, Cursor, VS Code, Windsurf, Antigravity. No API key needed.",
|
|
5
5
|
"mcpName": "io.github.BuiHung1612/figma-mcp",
|
|
6
6
|
"type": "module",
|
package/scripts/test-rust-mcp.sh
CHANGED
|
@@ -26,8 +26,8 @@ OUTPUT=$(echo "$INPUT" | $BIN_PATH --port 38499 2>/dev/null)
|
|
|
26
26
|
echo "$OUTPUT" | head -n 4
|
|
27
27
|
|
|
28
28
|
# Verify tool registration in JSON-RPC output
|
|
29
|
-
echo "--- Test 3: Verify Tool Registrations (
|
|
30
|
-
for TOOL in figma_status figma_get_selection figma_inspect_node figma_to_code figma_get_tokens figma_export_asset figma_export_assets figma_index figma_read figma_write figma_rules figma_docs; do
|
|
29
|
+
echo "--- Test 3: Verify Tool Registrations (15 tools) ---"
|
|
30
|
+
for TOOL in figma_status figma_get_selection figma_inspect_node figma_to_code figma_get_tokens figma_export_asset figma_export_assets figma_index figma_read figma_write figma_rules figma_docs figma_match_components figma_prepare_design figma_verify_ui; do
|
|
31
31
|
echo "$OUTPUT" | grep -q "\"name\":\"$TOOL\"" && echo "✓ $TOOL registered"
|
|
32
32
|
done
|
|
33
33
|
|