figmanage 0.2.0 → 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 +20 -7
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/setup.js +57 -8
- package/dist/tools/compound-manager.d.ts +2 -0
- package/dist/tools/compound-manager.js +719 -0
- package/dist/tools/compound.js +430 -0
- package/dist/tools/org.js +5 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
MCP server for managing your Figma workspace.
|
|
4
4
|
|
|
5
|
-
Manages Figma workspaces through AI assistants.
|
|
5
|
+
Manages Figma workspaces through AI assistants. 85 tools covering files, projects, teams, permissions, comments, versions, components, webhooks, org admin, and more. Works with Claude Code, Claude Desktop, ChatGPT, and any MCP-compatible client.
|
|
6
6
|
|
|
7
7
|
## quick start
|
|
8
8
|
|
|
@@ -16,19 +16,25 @@ claude mcp add figmanage -s user -e FIGMA_PAT=figd_xxx -- npx -y figmanage
|
|
|
16
16
|
|
|
17
17
|
Restart Claude Code. Gives you 30+ tools (comments, reading, export, components, versions, webhooks).
|
|
18
18
|
|
|
19
|
-
### full setup (2 minutes, all
|
|
19
|
+
### full setup (2 minutes, all 85 tools)
|
|
20
20
|
|
|
21
21
|
```bash
|
|
22
22
|
npx -y figmanage --setup
|
|
23
23
|
```
|
|
24
24
|
|
|
25
|
-
Extracts your Chrome cookie, prompts for a PAT, registers with Claude Code automatically. Unlocks all
|
|
25
|
+
Extracts your Chrome cookie, prompts for a PAT, registers with Claude Code automatically. Unlocks all 85 tools including workspace management, permissions, and org admin. Restart Claude Code.
|
|
26
26
|
|
|
27
27
|
Use `--no-prompt --pat figd_xxx` for non-interactive setup.
|
|
28
28
|
|
|
29
|
-
### Claude Desktop
|
|
29
|
+
### Claude Desktop / Cowork
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
Full setup with cookie extraction:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
npx -y figmanage --setup --desktop
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Or manually add to `~/Library/Application Support/Claude/claude_desktop_config.json`:
|
|
32
38
|
|
|
33
39
|
```json
|
|
34
40
|
{
|
|
@@ -254,7 +260,7 @@ Tools are automatically filtered at startup based on available credentials. If y
|
|
|
254
260
|
|------|------|-------------|
|
|
255
261
|
| `list_org_libraries` | cookie | All design system libraries in the org with sharing group info |
|
|
256
262
|
|
|
257
|
-
### compound (
|
|
263
|
+
### compound (12 tools)
|
|
258
264
|
|
|
259
265
|
Multi-step operations that aggregate data from several API calls.
|
|
260
266
|
|
|
@@ -266,6 +272,12 @@ Multi-step operations that aggregate data from several API calls.
|
|
|
266
272
|
| `cleanup_stale_files` | either | Find files not modified in N days, optionally trash them (dry run by default) |
|
|
267
273
|
| `organize_project` | cookie | Batch-move files into a target project |
|
|
268
274
|
| `setup_project_structure` | cookie | Create multiple projects in a team from a plan |
|
|
275
|
+
| `seat_optimization` | cookie | Identify inactive paid seats and calculate potential savings |
|
|
276
|
+
| `permission_audit` | cookie | Audit who has access to a team or project, flag oversharing |
|
|
277
|
+
| `branch_cleanup` | either | Find stale branches across a project, optionally archive (dry run by default) |
|
|
278
|
+
| `offboard_user` | cookie | Audit + execute user departure: transfer files, revoke access, downgrade seat |
|
|
279
|
+
| `onboard_user` | cookie | Batch invite to teams, share files, set seat type in one call |
|
|
280
|
+
| `quarterly_design_ops_report` | cookie | Org-wide snapshot: seat utilization, billing, teams, library adoption |
|
|
269
281
|
|
|
270
282
|
## transport modes
|
|
271
283
|
|
|
@@ -323,7 +335,8 @@ src/
|
|
|
323
335
|
org.ts Org admin, billing, seats, domains via internal API (9 tools)
|
|
324
336
|
teams.ts Team CRUD (3 tools)
|
|
325
337
|
libraries.ts Design system libraries via internal API (1 tool)
|
|
326
|
-
compound.ts Multi-step aggregation tools (
|
|
338
|
+
compound.ts Multi-step aggregation tools (9 tools)
|
|
339
|
+
compound-manager.ts Manager workflow tools (3 tools)
|
|
327
340
|
types/
|
|
328
341
|
figma.ts Shared types (Toolset, AuthConfig, etc.)
|
|
329
342
|
```
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -28,6 +28,7 @@ import './tools/org.js';
|
|
|
28
28
|
import './tools/libraries.js';
|
|
29
29
|
import './tools/teams.js';
|
|
30
30
|
import './tools/compound.js';
|
|
31
|
+
import './tools/compound-manager.js';
|
|
31
32
|
const ALL_TOOLSETS = [
|
|
32
33
|
'navigate', 'files', 'projects', 'permissions', 'org',
|
|
33
34
|
'versions', 'branching', 'comments', 'export',
|
package/dist/setup.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { execSync, execFileSync } from 'child_process';
|
|
3
3
|
import { createDecipheriv, pbkdf2Sync } from 'crypto';
|
|
4
|
-
import { copyFileSync, unlinkSync, mkdtempSync, existsSync, rmdirSync, readFileSync } from 'fs';
|
|
4
|
+
import { copyFileSync, unlinkSync, mkdtempSync, mkdirSync, existsSync, rmdirSync, readFileSync, writeFileSync } from 'fs';
|
|
5
5
|
import { join } from 'path';
|
|
6
6
|
import { tmpdir, homedir, platform } from 'os';
|
|
7
7
|
import axios from 'axios';
|
|
@@ -294,8 +294,32 @@ function registerWithClaude(envVars) {
|
|
|
294
294
|
return false;
|
|
295
295
|
}
|
|
296
296
|
}
|
|
297
|
+
function registerWithDesktop(envVars) {
|
|
298
|
+
const configPath = platform() === 'win32'
|
|
299
|
+
? join(process.env.APPDATA || join(homedir(), 'AppData/Roaming'), 'Claude/claude_desktop_config.json')
|
|
300
|
+
: join(homedir(), 'Library/Application Support/Claude/claude_desktop_config.json');
|
|
301
|
+
try {
|
|
302
|
+
let config = {};
|
|
303
|
+
if (existsSync(configPath)) {
|
|
304
|
+
config = JSON.parse(readFileSync(configPath, 'utf-8'));
|
|
305
|
+
}
|
|
306
|
+
if (!config.mcpServers)
|
|
307
|
+
config.mcpServers = {};
|
|
308
|
+
config.mcpServers.figmanage = {
|
|
309
|
+
command: 'npx',
|
|
310
|
+
args: ['-y', 'figmanage'],
|
|
311
|
+
env: envVars,
|
|
312
|
+
};
|
|
313
|
+
mkdirSync(join(configPath, '..'), { recursive: true });
|
|
314
|
+
writeFileSync(configPath, JSON.stringify(config, null, 2) + '\n');
|
|
315
|
+
return true;
|
|
316
|
+
}
|
|
317
|
+
catch {
|
|
318
|
+
return false;
|
|
319
|
+
}
|
|
320
|
+
}
|
|
297
321
|
function printManualConfig(envVars) {
|
|
298
|
-
console.log('\
|
|
322
|
+
console.log('\nConfigure your MCP client manually.\n');
|
|
299
323
|
console.log('Environment variables:');
|
|
300
324
|
for (const [k, v] of Object.entries(envVars)) {
|
|
301
325
|
const display = (k === 'FIGMA_AUTH_COOKIE' || k === 'FIGMA_PAT') ? '******' : v;
|
|
@@ -315,21 +339,25 @@ function printManualConfig(envVars) {
|
|
|
315
339
|
function parseArgs() {
|
|
316
340
|
const args = process.argv.slice(2);
|
|
317
341
|
let noPrompt = false;
|
|
342
|
+
let desktop = false;
|
|
318
343
|
let pat;
|
|
319
344
|
for (let i = 0; i < args.length; i++) {
|
|
320
345
|
if (args[i] === '--no-prompt') {
|
|
321
346
|
noPrompt = true;
|
|
322
347
|
}
|
|
348
|
+
else if (args[i] === '--desktop') {
|
|
349
|
+
desktop = true;
|
|
350
|
+
}
|
|
323
351
|
else if (args[i] === '--pat' && i + 1 < args.length) {
|
|
324
352
|
pat = args[++i];
|
|
325
353
|
}
|
|
326
354
|
}
|
|
327
|
-
return { noPrompt, pat };
|
|
355
|
+
return { noPrompt, desktop, pat };
|
|
328
356
|
}
|
|
329
357
|
// --- Main ---
|
|
330
358
|
async function setup() {
|
|
331
359
|
console.log('figmanage setup\n');
|
|
332
|
-
const { noPrompt, pat: patArg } = parseArgs();
|
|
360
|
+
const { noPrompt, desktop, pat: patArg } = parseArgs();
|
|
333
361
|
const os = platform();
|
|
334
362
|
// Build env vars to register
|
|
335
363
|
const envVars = {};
|
|
@@ -351,8 +379,18 @@ async function setup() {
|
|
|
351
379
|
process.exit(1);
|
|
352
380
|
}
|
|
353
381
|
// Register with whatever client is available
|
|
354
|
-
if (
|
|
355
|
-
console.log('\nRegistering with Claude...');
|
|
382
|
+
if (desktop) {
|
|
383
|
+
console.log('\nRegistering with Claude Desktop...');
|
|
384
|
+
if (registerWithDesktop(envVars)) {
|
|
385
|
+
console.log(' Credentials written to claude_desktop_config.json');
|
|
386
|
+
console.log(' Done. Restart Claude Desktop to use figmanage.');
|
|
387
|
+
}
|
|
388
|
+
else {
|
|
389
|
+
printManualConfig(envVars);
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
else if (claudeCliAvailable()) {
|
|
393
|
+
console.log('\nRegistering with Claude Code...');
|
|
356
394
|
if (registerWithClaude(envVars)) {
|
|
357
395
|
console.log(' PAT stored in MCP server config');
|
|
358
396
|
console.log(' Done. Restart Claude Code to use figmanage.');
|
|
@@ -542,8 +580,19 @@ async function setup() {
|
|
|
542
580
|
console.log(`FIGMA_ORG_ID=${orgId}`);
|
|
543
581
|
if (pat)
|
|
544
582
|
console.log('FIGMA_PAT=****** (stored in MCP server config)');
|
|
545
|
-
if (
|
|
546
|
-
console.log('\nRegistering with Claude...');
|
|
583
|
+
if (desktop) {
|
|
584
|
+
console.log('\nRegistering with Claude Desktop...');
|
|
585
|
+
if (registerWithDesktop(envVars)) {
|
|
586
|
+
console.log(' Credentials written to claude_desktop_config.json');
|
|
587
|
+
console.log(' Done. Restart Claude Desktop to use figmanage.');
|
|
588
|
+
}
|
|
589
|
+
else {
|
|
590
|
+
console.log(' Could not write config automatically.');
|
|
591
|
+
printManualConfig(envVars);
|
|
592
|
+
}
|
|
593
|
+
}
|
|
594
|
+
else if (claudeCliAvailable()) {
|
|
595
|
+
console.log('\nRegistering with Claude Code...');
|
|
547
596
|
if (registerWithClaude(envVars)) {
|
|
548
597
|
if (pat)
|
|
549
598
|
console.log(' PAT stored in MCP server config');
|