figmanage 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.
package/README.md CHANGED
@@ -6,27 +6,43 @@ Manages Figma workspaces through AI assistants. 76 tools covering files, project
6
6
 
7
7
  ## quick start
8
8
 
9
+ ### PAT only (30 seconds)
10
+
11
+ Get a token at [figma.com/settings](https://www.figma.com/settings) > Security > Personal access tokens, then:
12
+
9
13
  ```bash
10
- npx figmanage # starts MCP server (stdio)
11
- npx figmanage --http 3333 # starts MCP server (HTTP, for ChatGPT etc.)
14
+ claude mcp add figmanage -s user -e FIGMA_PAT=figd_xxx -- npx -y figmanage
12
15
  ```
13
16
 
14
- ## setup
17
+ Restart Claude Code. Gives you 30+ tools (comments, reading, export, components, versions, webhooks).
18
+
19
+ ### full setup (2 minutes, all 76 tools)
15
20
 
16
21
  ```bash
17
- git clone https://github.com/dannykeane/figmanage.git
18
- cd figmanage
19
- npm install
20
- npm run build
21
- npm run setup # extracts Chrome cookie, configures your MCP client
22
+ npx -y figmanage --setup
22
23
  ```
23
24
 
24
- The setup script:
25
- - Reads your Figma session cookie from Chrome (macOS, Linux, Windows)
26
- - Detects your org ID via Figma's redirect behavior
27
- - Prompts for a Personal Access Token
28
- - Stores all credentials in MCP server config (env vars)
29
- - Auto-detects Claude Code, or prints config for other clients
25
+ Extracts your Chrome cookie, prompts for a PAT, registers with Claude Code automatically. Unlocks all 76 tools including workspace management, permissions, and org admin. Restart Claude Code.
26
+
27
+ Use `--no-prompt --pat figd_xxx` for non-interactive setup.
28
+
29
+ ### Claude Desktop
30
+
31
+ Add to `~/Library/Application Support/Claude/claude_desktop_config.json`:
32
+
33
+ ```json
34
+ {
35
+ "mcpServers": {
36
+ "figmanage": {
37
+ "command": "npx",
38
+ "args": ["-y", "figmanage"],
39
+ "env": {
40
+ "FIGMA_PAT": "figd_your_token_here"
41
+ }
42
+ }
43
+ }
44
+ }
45
+ ```
30
46
 
31
47
  ## configuration
32
48
 
@@ -325,6 +341,8 @@ Tools self-register via `defineTool()` side-effect imports. Each tool declares i
325
341
  ## development
326
342
 
327
343
  ```bash
344
+ git clone https://github.com/dannykeane/figmanage.git
345
+ cd figmanage
328
346
  npm install
329
347
  npm run build # compile
330
348
  npm run setup # configure auth + MCP client
package/dist/index.js CHANGED
@@ -1,4 +1,9 @@
1
1
  #!/usr/bin/env node
2
+ // Run setup if --setup flag is present
3
+ if (process.argv.includes('--setup')) {
4
+ await import('./setup.js');
5
+ process.exit(0);
6
+ }
2
7
  import { createServer } from 'node:http';
3
8
  import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
4
9
  import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
package/dist/setup.js CHANGED
@@ -283,18 +283,18 @@ function claudeCliAvailable() {
283
283
  return false;
284
284
  }
285
285
  }
286
- function registerWithClaude(envVars, serverPath) {
286
+ function registerWithClaude(envVars) {
287
287
  try {
288
288
  execSync('claude mcp remove figmanage -s user 2>/dev/null || true', { encoding: 'utf-8' });
289
289
  const envFlags = Object.entries(envVars).map(([k, v]) => `--env ${k}=${v}`).join(' ');
290
- execSync(`claude mcp add figmanage --transport stdio -s user ${envFlags} -- node ${serverPath}`, { encoding: 'utf-8' });
290
+ execSync(`claude mcp add figmanage --transport stdio -s user ${envFlags} -- npx -y figmanage`, { encoding: 'utf-8' });
291
291
  return true;
292
292
  }
293
293
  catch {
294
294
  return false;
295
295
  }
296
296
  }
297
- function printManualConfig(envVars, serverPath) {
297
+ function printManualConfig(envVars) {
298
298
  console.log('\nClaude CLI not found. Configure your MCP client manually.\n');
299
299
  console.log('Environment variables:');
300
300
  for (const [k, v] of Object.entries(envVars)) {
@@ -304,8 +304,8 @@ function printManualConfig(envVars, serverPath) {
304
304
  console.log('\nMCP server config (JSON):');
305
305
  const config = {
306
306
  figmanage: {
307
- command: 'node',
308
- args: [serverPath],
307
+ command: 'npx',
308
+ args: ['-y', 'figmanage'],
309
309
  env: Object.fromEntries(Object.entries(envVars).map(([k, v]) => [k, k === 'FIGMA_AUTH_COOKIE' || k === 'FIGMA_PAT' ? '<paste value>' : v])),
310
310
  },
311
311
  };
@@ -333,7 +333,7 @@ async function setup() {
333
333
  const os = platform();
334
334
  // Build env vars to register
335
335
  const envVars = {};
336
- const serverPath = join(import.meta.dirname, 'index.js');
336
+ // Registration uses npx -y figmanage (no local path needed)
337
337
  if (noPrompt) {
338
338
  // Non-interactive mode: skip cookie extraction, require --pat
339
339
  if (!patArg) {
@@ -353,16 +353,16 @@ async function setup() {
353
353
  // Register with whatever client is available
354
354
  if (claudeCliAvailable()) {
355
355
  console.log('\nRegistering with Claude...');
356
- if (registerWithClaude(envVars, serverPath)) {
356
+ if (registerWithClaude(envVars)) {
357
357
  console.log(' PAT stored in MCP server config');
358
358
  console.log(' Done. Restart Claude Code to use figmanage.');
359
359
  }
360
360
  else {
361
- printManualConfig(envVars, serverPath);
361
+ printManualConfig(envVars);
362
362
  }
363
363
  }
364
364
  else {
365
- printManualConfig(envVars, serverPath);
365
+ printManualConfig(envVars);
366
366
  }
367
367
  return;
368
368
  }
@@ -544,18 +544,18 @@ async function setup() {
544
544
  console.log('FIGMA_PAT=****** (stored in MCP server config)');
545
545
  if (claudeCliAvailable()) {
546
546
  console.log('\nRegistering with Claude...');
547
- if (registerWithClaude(envVars, serverPath)) {
547
+ if (registerWithClaude(envVars)) {
548
548
  if (pat)
549
549
  console.log(' PAT stored in MCP server config');
550
550
  console.log(' Done. Restart Claude Code to use figmanage.');
551
551
  }
552
552
  else {
553
553
  console.log(' Could not register automatically.');
554
- printManualConfig(envVars, serverPath);
554
+ printManualConfig(envVars);
555
555
  }
556
556
  }
557
557
  else {
558
- printManualConfig(envVars, serverPath);
558
+ printManualConfig(envVars);
559
559
  }
560
560
  }
561
561
  setup().catch((err) => {
package/package.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "figmanage",
3
- "version": "0.1.0",
3
+ "mcpName": "io.github.dannykeane/figmanage",
4
+ "version": "0.1.2",
4
5
  "description": "MCP server for managing your Figma workspace from the terminal.",
5
6
  "type": "module",
6
7
  "main": "dist/index.js",