@vkhanhqui/figma-mcp-go 0.0.1 → 0.0.2-alpha

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 ADDED
@@ -0,0 +1,127 @@
1
+ # figma-mcp-go
2
+
3
+ Figma MCP Server Without API Rate Limits
4
+
5
+ A free, open-source Figma MCP server that reads Figma files directly via plugin — no REST API, no rate limits. 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
+ - Reads live Figma data via plugin bridge
11
+ - Written in Go, distributed via npm
12
+ - Supports multiple AI tools simultaneously
13
+
14
+ ---
15
+
16
+ ## Why this exists
17
+
18
+ Most Figma MCP servers rely on the **Figma REST API**.
19
+
20
+ That sounds fine… until you hit this:
21
+
22
+ | Plan | Limit |
23
+ |------|-------|
24
+ | Starter / View / Collab | **6 tool calls/month** |
25
+ | Pro / Org (Dev seat) | 200 tool calls/day |
26
+ | Enterprise | 600 tool calls/day |
27
+
28
+ If you're experimenting with AI tools, you'll burn through that in minutes.
29
+
30
+ I didn't have enough money to pay for higher limits.
31
+ So I built something that **doesn't use the API at all**.
32
+
33
+ ---
34
+
35
+ ## Installation & Setup
36
+
37
+ Install via `npx` — no build step required. Watch the setup video or follow the steps below.
38
+
39
+ [![Watch the video](https://img.youtube.com/vi/DjqyU0GKv9k/sddefault.jpg)](https://youtu.be/DjqyU0GKv9k)
40
+
41
+ ### 1. Configure your AI tool
42
+
43
+ **.vscode/mcp.json** (Cursor / VS Code / GitHub Copilot)
44
+ ```json
45
+ {
46
+ "servers": {
47
+ "figma-mcp-go": {
48
+ "type": "stdio",
49
+ "command": "npx",
50
+ "args": [
51
+ "-y",
52
+ "@vkhanhqui/figma-mcp-go"
53
+ ]
54
+ }
55
+ }
56
+ }
57
+ ```
58
+
59
+ **.mcp.json** (Claude and other MCP-compatible tools)
60
+ ```json
61
+ {
62
+ "mcpServers": {
63
+ "figma-mcp-go": {
64
+ "command": "npx",
65
+ "args": ["-y", "@vkhanhqui/figma-mcp-go"]
66
+ }
67
+ }
68
+ }
69
+ ```
70
+
71
+ ### 2. Install the Figma plugin
72
+
73
+ 1. In Figma Desktop: **Plugins → Development → Import plugin from manifest**
74
+ 2. Select `manifest.json` from the [plugin.zip](https://github.com/vkhanhqui/figma-mcp-go/releases)
75
+ 3. Run the plugin inside any Figma file
76
+
77
+ ---
78
+
79
+ ## Available Tools
80
+
81
+ ### Document & Selection
82
+
83
+ | Tool | Description |
84
+ |------|-------------|
85
+ | `get_document` | Full current page tree |
86
+ | `get_metadata` | File name, pages, current page |
87
+ | `get_pages` | All pages (IDs + names) — lightweight, no tree loading |
88
+ | `get_selection` | Currently selected nodes |
89
+ | `get_node` | Single node by ID |
90
+ | `get_nodes_info` | Multiple nodes by ID |
91
+ | `get_design_context` | Depth-limited tree with `detail` level (`minimal`/`compact`/`full`) |
92
+ | `search_nodes` | Find nodes by name substring and/or type within a subtree |
93
+ | `scan_text_nodes` | All text nodes in a subtree |
94
+ | `scan_nodes_by_types` | Nodes matching given type list |
95
+ | `get_viewport` | Current viewport center, zoom, and visible bounds |
96
+
97
+ ### Styles & Variables
98
+
99
+ | Tool | Description |
100
+ |------|-------------|
101
+ | `get_styles` | Paint, text, effect, and grid styles |
102
+ | `get_variable_defs` | Variable collections and values |
103
+ | `get_local_components` | All components + component sets with variant properties |
104
+ | `get_annotations` | Dev-mode annotations |
105
+ | `get_fonts` | All fonts used on the current page, sorted by frequency |
106
+ | `get_reactions` | Prototype/interaction reactions on a node |
107
+
108
+ ### Export
109
+
110
+ | Tool | Description |
111
+ |------|-------------|
112
+ | `get_screenshot` | Base64 image export of any node |
113
+ | `save_screenshots` | Export images to disk (server-side, no API call) |
114
+
115
+ ---
116
+
117
+ ## Related Projects
118
+
119
+ - [magic-spells/figma-mcp-bridge](https://github.com/magic-spells/figma-mcp-bridge)
120
+ - [grab/cursor-talk-to-figma-mcp](https://github.com/grab/cursor-talk-to-figma-mcp)
121
+ - [gethopp/figma-mcp-bridge](https://github.com/gethopp/figma-mcp-bridge)
122
+
123
+ ---
124
+
125
+ ## Contributing
126
+
127
+ Issues and PRs are welcome.
Binary file
Binary file
Binary file
Binary file
package/bin/run.js CHANGED
@@ -5,8 +5,19 @@ const { spawnSync } = require('node:child_process');
5
5
  const { existsSync } = require('node:fs');
6
6
  const path = require('node:path');
7
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(`[figma-mcp-go] Unsupported platform: ${process.platform}/${process.arch}\n`);
16
+ process.exit(1);
17
+ }
18
+
8
19
  const binaryName = process.platform === 'win32' ? 'figma-mcp-go.exe' : 'figma-mcp-go';
9
- const binaryPath = path.join(__dirname, binaryName);
20
+ const binaryPath = path.join(__dirname, `${goos}-${goarch}`, binaryName);
10
21
 
11
22
  if (!existsSync(binaryPath)) {
12
23
  process.stderr.write(
package/package.json CHANGED
@@ -1,17 +1,19 @@
1
1
  {
2
2
  "name": "@vkhanhqui/figma-mcp-go",
3
- "version": "0.0.1",
3
+ "version": "0.0.2-alpha",
4
4
  "description": "A zero-cost, unlimited Figma MCP server — no API key, no rate limits",
5
5
  "mcpName": "io.github.vkhanhqui/figma-mcp-go",
6
6
  "bin": {
7
7
  "figma-mcp-go": "bin/run.js"
8
8
  },
9
- "scripts": {
10
- "postinstall": "node scripts/install.js"
11
- },
12
9
  "files": [
13
10
  "bin/run.js",
14
- "scripts"
11
+ "bin/darwin-amd64/",
12
+ "bin/darwin-arm64/",
13
+ "bin/linux-amd64/",
14
+ "bin/linux-arm64/",
15
+ "bin/windows-amd64/",
16
+ "bin/windows-arm64/"
15
17
  ],
16
18
  "keywords": [
17
19
  "figma",
@@ -1,96 +0,0 @@
1
- #!/usr/bin/env node
2
- 'use strict';
3
-
4
- const https = require('node:https');
5
- const fs = require('node:fs');
6
- const path = require('node:path');
7
- const { execFileSync } = require('node:child_process');
8
- const os = require('node:os');
9
-
10
- const pkg = require('../package.json');
11
- const version = pkg.version;
12
-
13
- const PLATFORM_MAP = {
14
- darwin: 'darwin',
15
- linux: 'linux',
16
- win32: 'windows',
17
- };
18
-
19
- const ARCH_MAP = {
20
- x64: 'amd64',
21
- arm64: 'arm64',
22
- };
23
-
24
- const goos = PLATFORM_MAP[process.platform];
25
- const goarch = ARCH_MAP[process.arch];
26
-
27
- if (!goos || !goarch) {
28
- console.error(`[figma-mcp-go] Unsupported platform: ${process.platform}/${process.arch}`);
29
- process.exit(1);
30
- }
31
-
32
- const isWindows = goos === 'windows';
33
- const binaryName = isWindows ? 'figma-mcp-go.exe' : 'figma-mcp-go';
34
- const ext = isWindows ? '.zip' : '.tar.gz';
35
- const archiveName = `figma-mcp-go_${goos}_${goarch}${ext}`;
36
- const downloadUrl = `https://github.com/vkhanhqui/figma-mcp-go/releases/download/v${version}/${archiveName}`;
37
- const binDir = path.join(__dirname, '..', 'bin');
38
- const tmpFile = path.join(os.tmpdir(), archiveName);
39
-
40
- function download(url, dest) {
41
- return new Promise((resolve, reject) => {
42
- const file = fs.createWriteStream(dest);
43
- function get(u) {
44
- https.get(u, (res) => {
45
- if (res.statusCode === 301 || res.statusCode === 302) {
46
- return get(res.headers.location);
47
- }
48
- if (res.statusCode !== 200) {
49
- file.close();
50
- fs.rmSync(dest, { force: true });
51
- reject(new Error(`HTTP ${res.statusCode} downloading ${u}`));
52
- return;
53
- }
54
- res.pipe(file);
55
- file.on('finish', () => file.close(resolve));
56
- file.on('error', reject);
57
- }).on('error', reject);
58
- }
59
- get(url);
60
- });
61
- }
62
-
63
- async function main() {
64
- console.log(`[figma-mcp-go] Downloading ${archiveName}...`);
65
-
66
- try {
67
- await download(downloadUrl, tmpFile);
68
- } catch (err) {
69
- console.error(`[figma-mcp-go] Failed to download: ${err.message}`);
70
- console.error(`[figma-mcp-go] URL: ${downloadUrl}`);
71
- process.exit(1);
72
- }
73
-
74
- fs.mkdirSync(binDir, { recursive: true });
75
-
76
- try {
77
- if (isWindows) {
78
- execFileSync('powershell', [
79
- '-NoProfile', '-Command',
80
- `Expand-Archive -Force -Path "${tmpFile}" -DestinationPath "${binDir}"`,
81
- ]);
82
- } else {
83
- execFileSync('tar', ['xzf', tmpFile, '-C', binDir, binaryName]);
84
- fs.chmodSync(path.join(binDir, binaryName), 0o755);
85
- }
86
- } catch (err) {
87
- console.error(`[figma-mcp-go] Failed to extract: ${err.message}`);
88
- process.exit(1);
89
- } finally {
90
- fs.rmSync(tmpFile, { force: true });
91
- }
92
-
93
- console.log('[figma-mcp-go] Installed successfully.');
94
- }
95
-
96
- main();