IgnorantesNaturales commited on
Commit
c789d21
·
1 Parent(s): 77322c0

Add feature for write coments

Browse files
Files changed (15) hide show
  1. .env.example +7 -0
  2. .npmignore +33 -0
  3. CHANGELOG.md +43 -0
  4. FEATURES.md +182 -0
  5. LICENSE +21 -0
  6. PUBLISHING_GUIDE.md +293 -0
  7. QUICKSTART.md +25 -1
  8. README.backup.md +229 -0
  9. README.huggingface.md +171 -0
  10. README.md +251 -120
  11. README.npm.md +232 -0
  12. START_HERE.md +97 -0
  13. index.js +200 -1
  14. package.json +25 -4
  15. package.json.backup +30 -0
.env.example CHANGED
@@ -1,3 +1,10 @@
1
  # Figma Personal Access Token
2
  # Get yours at: https://www.figma.com/developers/api#access-tokens
 
 
 
 
 
 
 
3
  FIGMA_ACCESS_TOKEN=your_figma_token_here
 
1
  # Figma Personal Access Token
2
  # Get yours at: https://www.figma.com/developers/api#access-tokens
3
+ #
4
+ # This token enables:
5
+ # - Reading comments from Figma files
6
+ # - Creating new comments
7
+ # - Replying to existing comments
8
+ #
9
+ # Personal access tokens have read and write permissions by default
10
  FIGMA_ACCESS_TOKEN=your_figma_token_here
.npmignore ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Development files
2
+ .env
3
+ .env.local
4
+ .env.*.local
5
+ node_modules/
6
+ npm-debug.log*
7
+ yarn-debug.log*
8
+ yarn-error.log*
9
+
10
+ # IDE
11
+ .vscode/
12
+ .idea/
13
+ *.swp
14
+ *.swo
15
+ *.code-workspace
16
+ .claude/
17
+
18
+ # Git
19
+ .git/
20
+ .gitignore
21
+
22
+ # Tests
23
+ test/
24
+ tests/
25
+ *.test.js
26
+ *.spec.js
27
+
28
+ # Documentation
29
+ QUICKSTART.md
30
+ docs/
31
+
32
+ # Config files
33
+ claude_desktop_config.json
CHANGELOG.md ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [1.1.0] - 2025-10-26
9
+
10
+ ### Added
11
+ - ✨ **Write capabilities**: Create new comments in Figma files
12
+ - ✨ **Reply to comments**: Respond to existing comments maintaining conversation threads
13
+ - 📝 New tool: `post_figma_comment` - Create comments with optional location (node_id, coordinates)
14
+ - 📝 New tool: `reply_to_figma_comment` - Reply to existing comments by ID
15
+ - 📚 FEATURES.md - Complete documentation of read and write capabilities
16
+ - 🔒 Permission documentation in README and QUICKSTART
17
+ - 📊 Visual table showing all 4 available tools (2 read, 2 write)
18
+
19
+ ### Changed
20
+ - 📖 Updated README with comprehensive examples for write operations
21
+ - 📖 Enhanced QUICKSTART with examples of creating and replying to comments
22
+ - 📖 Improved troubleshooting section with write permission requirements
23
+ - 🏷️ Updated package description to reflect read/write capabilities
24
+
25
+ ### Documentation
26
+ - Added clear distinction between read and write operations
27
+ - Added permission requirements for each operation type
28
+ - Added AI-powered workflow examples
29
+ - Added combined read/write use cases
30
+
31
+ ## [1.0.0] - 2025-10-25
32
+
33
+ ### Added
34
+ - 🎉 Initial release
35
+ - 📖 Read comments from Figma files
36
+ - 📊 Generate comment summaries and statistics
37
+ - 🔧 Two tools: `get_figma_comments` and `summarize_figma_comments`
38
+ - 📚 Complete documentation (README, QUICKSTART)
39
+ - 🔐 Environment-based authentication
40
+ - 🏗️ MCP SDK integration
41
+
42
+ [1.1.0]: https://github.com/cloudframework-io/mcp-figma-comment-summary/compare/v1.0.0...v1.1.0
43
+ [1.0.0]: https://github.com/cloudframework-io/mcp-figma-comment-summary/releases/tag/v1.0.0
FEATURES.md ADDED
@@ -0,0 +1,182 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Funcionalidades Completas
2
+
3
+ Este servidor MCP proporciona **lectura y escritura completa** de comentarios en Figma.
4
+
5
+ ## Operaciones de Lectura
6
+
7
+ ### 1. Obtener Comentarios (`get_figma_comments`)
8
+
9
+ Lee todos los comentarios de un archivo de Figma con información completa:
10
+
11
+ - ✅ Texto del comentario
12
+ - ✅ Información del autor (nombre, avatar)
13
+ - ✅ Fecha y hora de creación
14
+ - ✅ Ubicación en el diseño (coordenadas y nodo)
15
+ - ✅ Estado de resolución
16
+ - ✅ Hilos completos de respuestas
17
+
18
+ **Ejemplo de uso:**
19
+ ```
20
+ "Muéstrame todos los comentarios del archivo ABC123"
21
+ "¿Cuántos comentarios sin resolver hay en el archivo XYZ?"
22
+ ```
23
+
24
+ ### 2. Resumir Comentarios (`summarize_figma_comments`)
25
+
26
+ Genera estadísticas y análisis automático:
27
+
28
+ - ✅ Total de comentarios y respuestas
29
+ - ✅ Comentarios resueltos vs sin resolver
30
+ - ✅ Agrupación por autor
31
+ - ✅ Agrupación por ubicación (elementos del diseño)
32
+ - ✅ Vista previa de cada comentario
33
+
34
+ **Ejemplo de uso:**
35
+ ```
36
+ "Dame un resumen de la actividad de comentarios en ABC123"
37
+ "¿Quién ha comentado más en este archivo?"
38
+ ```
39
+
40
+ ## Operaciones de Escritura
41
+
42
+ ### 3. Crear Comentarios (`post_figma_comment`)
43
+
44
+ Crea nuevos comentarios en archivos de Figma con opciones avanzadas:
45
+
46
+ - ✅ Comentarios generales en el archivo
47
+ - ✅ Comentarios en elementos específicos (usando node_id)
48
+ - ✅ Comentarios en coordenadas exactas (x, y)
49
+ - ✅ Comentarios con ubicación combinada (nodo + coordenadas)
50
+
51
+ **Ejemplos de uso:**
52
+
53
+ **Comentario general:**
54
+ ```
55
+ "Añade un comentario en ABC123 diciendo 'Diseño aprobado para producción'"
56
+ ```
57
+
58
+ **Comentario en un elemento específico:**
59
+ ```
60
+ "Comenta en el nodo 123:456 del archivo ABC: 'Este botón necesita más contraste'"
61
+ ```
62
+
63
+ **Comentario en coordenadas:**
64
+ ```
65
+ "Añade un comentario en la posición x:100, y:200 del archivo ABC: 'Revisar espaciado aquí'"
66
+ ```
67
+
68
+ ### 4. Responder a Comentarios (`reply_to_figma_comment`)
69
+
70
+ Responde a comentarios existentes manteniendo los hilos organizados:
71
+
72
+ - ✅ Responder a cualquier comentario por su ID
73
+ - ✅ Mantener conversaciones en hilos
74
+ - ✅ Respuestas múltiples coordinadas por IA
75
+
76
+ **Ejemplos de uso:**
77
+
78
+ **Respuesta simple:**
79
+ ```
80
+ "Responde al comentario 789 en ABC123: 'Buen punto, lo cambiaré'"
81
+ ```
82
+
83
+ **Respuestas en lote:**
84
+ ```
85
+ "Responde a todos los comentarios sin resolver en ABC123 diciendo que estás trabajando en ello"
86
+ ```
87
+
88
+ **Respuestas inteligentes:**
89
+ ```
90
+ "Revisa los comentarios de 'usuario123' y responde apropiadamente a cada uno"
91
+ ```
92
+
93
+ ## Casos de Uso Combinados
94
+
95
+ ### Análisis y Respuesta Automática
96
+
97
+ ```
98
+ "Obtén todos los comentarios de ABC123, identifica los que requieren acción inmediata, y responde confirmando que los revisarás"
99
+ ```
100
+
101
+ ### Revisión Asistida por IA
102
+
103
+ ```
104
+ "Analiza el diseño y los comentarios existentes en ABC123, luego añade comentarios constructivos adicionales"
105
+ ```
106
+
107
+ ### Gestión de Comentarios
108
+
109
+ ```
110
+ "Encuentra todos los comentarios de hace más de una semana en ABC123 y añade un comentario general resumiendo el progreso"
111
+ ```
112
+
113
+ ### Coordinación de Equipo
114
+
115
+ ```
116
+ "Responde a los comentarios de 'juan' en ABC123 confirmando los cambios, y añade un comentario general notificando que está listo para review"
117
+ ```
118
+
119
+ ## Permisos Requeridos
120
+
121
+ ### Para Lectura
122
+ - Acceso de **lectura** al archivo de Figma
123
+ - Token con permisos básicos
124
+
125
+ ### Para Escritura
126
+ - Acceso de **edición** al archivo de Figma
127
+ - Token con permisos de escritura (incluido por defecto en tokens personales)
128
+ - Ser miembro del equipo o tener acceso explícito al archivo
129
+
130
+ ## Limitaciones
131
+
132
+ - No se pueden eliminar comentarios (limitación de la API de Figma)
133
+ - No se pueden marcar comentarios como resueltos directamente (limitación de la API)
134
+ - Los comentarios deben tener al menos 1 carácter
135
+ - Los node_id deben existir en el archivo
136
+
137
+ ## Seguridad
138
+
139
+ - Cada usuario usa su propio token de Figma
140
+ - Los comentarios se crean con tu identidad de usuario
141
+ - Todos los comentarios quedan registrados en el historial de Figma
142
+ - No se comparten tokens entre usuarios
143
+
144
+ ## Ejemplos Avanzados
145
+
146
+ ### Workflow de Revisión Completa
147
+
148
+ 1. **Análisis inicial:**
149
+ ```
150
+ "Dame un resumen completo de los comentarios en ABC123"
151
+ ```
152
+
153
+ 2. **Identificar problemas:**
154
+ ```
155
+ "¿Qué comentarios mencionan problemas de accesibilidad?"
156
+ ```
157
+
158
+ 3. **Responder coordinadamente:**
159
+ ```
160
+ "Responde a esos comentarios diciendo que se implementarán en el siguiente sprint"
161
+ ```
162
+
163
+ 4. **Documentar decisiones:**
164
+ ```
165
+ "Añade un comentario general resumiendo las decisiones tomadas hoy"
166
+ ```
167
+
168
+ ### Colaboración con IA
169
+
170
+ ```
171
+ "Revisa los comentarios en ABC123, extrae action items, créame un resumen, y añade un comentario en Figma con ese resumen"
172
+ ```
173
+
174
+ ### Automatización de Feedback
175
+
176
+ ```
177
+ "Cada vez que encuentres comentarios sobre accesibilidad en ABC123, responde con las guías de WCAG relevantes"
178
+ ```
179
+
180
+ ---
181
+
182
+ **Nota:** Este MCP es especialmente potente cuando se combina con las capacidades de análisis de Claude, permitiendo workflows de diseño más eficientes y colaborativos.
LICENSE ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ MIT License
2
+
3
+ Copyright (c) 2025 CloudFramework
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
PUBLISHING_GUIDE.md ADDED
@@ -0,0 +1,293 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # 📦 Guía de Publicación - mcp-figma-comment-summary
2
+
3
+ Esta guía te llevará paso a paso por el proceso de publicar tu MCP en npm y documentarlo en Hugging Face.
4
+
5
+ ## ✅ Pre-requisitos
6
+
7
+ Antes de publicar, asegúrate de tener:
8
+
9
+ - [ ] Cuenta en [npmjs.com](https://www.npmjs.com/)
10
+ - [ ] Cuenta en [huggingface.co](https://huggingface.co/) (opcional)
11
+ - [ ] Git configurado con tu repositorio (opcional pero recomendado)
12
+ - [ ] Node.js 18+ instalado
13
+
14
+ ## 📋 Checklist de Archivos
15
+
16
+ Verifica que tienes estos archivos:
17
+
18
+ - [ ] `package.json.new` - Nueva versión del package.json
19
+ - [ ] `README.npm.md` - README optimizado para npm
20
+ - [ ] `README.huggingface.md` - README para Hugging Face
21
+ - [ ] `.npmignore` - Archivos a excluir de npm
22
+ - [ ] `index.js` - Tu código principal
23
+ - [ ] `.env.example` - Ejemplo de variables de entorno
24
+ - [ ] `LICENSE` - Licencia MIT
25
+
26
+ ## 🚀 Paso 1: Preparar el Repositorio Git (Opcional)
27
+
28
+ ### 1.1 Crear repositorio en GitHub
29
+
30
+ Si aún no tienes un repositorio:
31
+
32
+ 1. Ve a https://github.com/new
33
+ 2. Nombre: `mcp-figma-comment-summary`
34
+ 3. Descripción: "MCP server to retrieve and summarize Figma file comments"
35
+ 4. Público
36
+ 5. **No** inicialices con README (ya lo tienes)
37
+
38
+ ### 1.2 Conectar tu proyecto local
39
+
40
+ ```bash
41
+ cd /Users/fran/Documents/IN/Labs/mcp-figma-comment-summary
42
+
43
+ # Si no tienes git inicializado
44
+ git init
45
+
46
+ # Añade el remote (reemplaza con tu usuario/organización)
47
+ git remote add origin https://github.com/cloudframework-io/mcp-figma-comment-summary.git
48
+
49
+ # O si usas otro usuario:
50
+ # git remote add origin https://github.com/TU-USUARIO/mcp-figma-comment-summary.git
51
+ ```
52
+
53
+ ### 1.3 Commit y push
54
+
55
+ ```bash
56
+ # Añade todos los archivos
57
+ git add .
58
+
59
+ # Commit
60
+ git commit -m "Initial release v1.0.0"
61
+
62
+ # Push
63
+ git branch -M main
64
+ git push -u origin main
65
+ ```
66
+
67
+ ## 📦 Paso 2: Publicar en npm
68
+
69
+ ### 2.1 Actualizar package.json
70
+
71
+ ```bash
72
+ cd /Users/fran/Documents/IN/Labs/mcp-figma-comment-summary
73
+
74
+ # Backup del original
75
+ cp package.json package.json.backup
76
+
77
+ # Usar el nuevo
78
+ cp package.json.new package.json
79
+
80
+ # O si prefieres renombrar:
81
+ # mv package.json package.json.backup
82
+ # mv package.json.new package.json
83
+ ```
84
+
85
+ **IMPORTANTE**: Si usas un repositorio diferente a `cloudframework-io`, edita `package.json` y actualiza la URL del repositorio antes de publicar.
86
+
87
+ ### 2.2 Preparar README para npm
88
+
89
+ ```bash
90
+ # Copia el README optimizado para npm
91
+ cp README.npm.md README.md
92
+ ```
93
+
94
+ ### 2.3 Login en npm
95
+
96
+ ```bash
97
+ npm login
98
+ ```
99
+
100
+ Te pedirá:
101
+ - Username
102
+ - Password
103
+ - Email
104
+ - OTP (si tienes 2FA activado)
105
+
106
+ ### 2.4 Verificar antes de publicar
107
+
108
+ ```bash
109
+ # Dry run para ver qué se publicará
110
+ npm publish --dry-run
111
+ ```
112
+
113
+ Revisa la salida para asegurarte de que:
114
+ - Solo se incluyen los archivos necesarios
115
+ - No se incluyen archivos sensibles (.env)
116
+ - El tamaño del paquete es razonable
117
+
118
+ ### 2.5 Publicar
119
+
120
+ ```bash
121
+ # Publica en npm
122
+ npm publish --access public
123
+ ```
124
+
125
+ Si todo va bien, verás un mensaje como:
126
+ ```
127
128
+ ```
129
+
130
+ ### 2.6 Verificar publicación
131
+
132
+ 1. Ve a https://www.npmjs.com/package/mcp-figma-comment-summary
133
+ 2. Verifica que aparece tu paquete
134
+ 3. Revisa que el README se ve correctamente
135
+ 4. Comprueba que la versión es la correcta
136
+
137
+ ## 🤗 Paso 3: Documentar en Hugging Face (Opcional)
138
+
139
+ ### 3.1 Crear un nuevo Model
140
+
141
+ 1. Ve a https://huggingface.co/new
142
+ 2. Selecciona "Model" (no Space ni Dataset)
143
+ 3. Owner: Tu usuario o organización
144
+ 4. Model name: `mcp-figma-comment-summary`
145
+ 5. License: MIT
146
+ 6. Haz clic en "Create model"
147
+
148
+ ### 3.2 Subir el README
149
+
150
+ **Opción A: Desde la web**
151
+ 1. En tu nuevo modelo, haz clic en "Files and versions"
152
+ 2. Haz clic en "Add file" → "Create a new file"
153
+ 3. Nombre: `README.md`
154
+ 4. Copia el contenido de `README.huggingface.md`
155
+ 5. Pega el contenido
156
+ 6. Haz clic en "Commit new file"
157
+
158
+ **Opción B: Desde Git**
159
+ ```bash
160
+ # En tu proyecto
161
+ cd /Users/fran/Documents/IN/Labs/mcp-figma-comment-summary
162
+
163
+ # Clone el repo de HF
164
+ git clone https://huggingface.co/TU-USUARIO/mcp-figma-comment-summary hf-model
165
+
166
+ cd hf-model
167
+
168
+ # Copia el README
169
+ cp ../README.huggingface.md README.md
170
+
171
+ # Commit y push
172
+ git add README.md
173
+ git commit -m "Add model card"
174
+ git push
175
+ ```
176
+
177
+ ### 3.3 Verificar Model Card
178
+
179
+ Ve a tu modelo en Hugging Face y verifica que:
180
+ - El README se muestra correctamente
181
+ - Los tags aparecen (mcp, model-context-protocol, figma, etc.)
182
+ - El emoji y colores se ven bien
183
+
184
+ ## 🎉 Paso 4: Verificar que Todo Funciona
185
+
186
+ ### 4.1 Probar instalación con npx
187
+
188
+ ```bash
189
+ # En un directorio temporal
190
+ cd /tmp
191
+ npx -y mcp-figma-comment-summary
192
+ ```
193
+
194
+ Deberías ver un mensaje indicando que el servidor MCP está corriendo.
195
+
196
+ ### 4.2 Probar en Claude Desktop
197
+
198
+ 1. Actualiza tu `claude_desktop_config.json`:
199
+ ```json
200
+ {
201
+ "mcpServers": {
202
+ "figma-comments": {
203
+ "command": "npx",
204
+ "args": ["-y", "mcp-figma-comment-summary"],
205
+ "env": {
206
+ "FIGMA_ACCESS_TOKEN": "tu_token_aqui"
207
+ }
208
+ }
209
+ }
210
+ }
211
+ ```
212
+
213
+ 2. Reinicia Claude Desktop completamente
214
+ 3. Verifica que aparece el servidor
215
+ 4. Prueba las herramientas con un file ID real
216
+
217
+ ## 📢 Paso 5: Promoción (Opcional)
218
+
219
+ ### 5.1 Añadir a colecciones de MCP
220
+
221
+ Considera enviar un PR a estas listas:
222
+ - [Awesome MCP Servers](https://github.com/punkpeye/awesome-mcp-servers)
223
+ - [MCP Directory](https://github.com/modelcontextprotocol/servers)
224
+
225
+ ### 5.2 Compartir en redes
226
+
227
+ Ejemplo de post:
228
+
229
+ ```
230
+ 🎉 Just published mcp-figma-comment-summary!
231
+
232
+ A Model Context Protocol server that lets Claude Desktop analyze Figma comments:
233
+ - Retrieve all comments from any Figma file
234
+ - Generate smart summaries by author & location
235
+ - Track resolution status
236
+
237
+ Install with: npx -y mcp-figma-comment-summary
238
+
239
+ 📦 npm: https://www.npmjs.com/package/mcp-figma-comment-summary
240
+ 🤗 HF: https://huggingface.co/TU-USUARIO/mcp-figma-comment-summary
241
+
242
+ #MCP #Claude #Figma #AI
243
+ ```
244
+
245
+ ## 🔄 Actualizaciones Futuras
246
+
247
+ Cuando hagas cambios:
248
+
249
+ ```bash
250
+ # 1. Actualiza la versión en package.json
251
+ npm version patch # para bug fixes (1.0.0 → 1.0.1)
252
+ npm version minor # para nuevas features (1.0.0 → 1.1.0)
253
+ npm version major # para breaking changes (1.0.0 → 2.0.0)
254
+
255
+ # 2. Commit y push (si usas git)
256
+ git push && git push --tags
257
+
258
+ # 3. Publica en npm
259
+ npm publish
260
+
261
+ # 4. Actualiza el README en HF si es necesario
262
+ ```
263
+
264
+ ## ❓ Solución de Problemas
265
+
266
+ ### Error: "You need to authorize this machine"
267
+ ```bash
268
+ npm login
269
+ ```
270
+
271
+ ### Error: "Package name already exists"
272
+ El nombre está tomado. Elige otro en package.json.
273
+
274
+ ### Error: "Failed to publish"
275
+ - Verifica que no estés publicando archivos sensibles (.env)
276
+ - Revisa tu .npmignore
277
+ - Asegúrate de estar logueado: `npm whoami`
278
+
279
+ ### El README no se ve bien en npm
280
+ - Asegúrate de que README.md existe antes de publicar
281
+ - npm solo lee README.md, no README.npm.md
282
+
283
+ ### "FIGMA_ACCESS_TOKEN environment variable is required"
284
+ Este error es normal si ejecutas el servidor sin el token. Los usuarios necesitarán configurar su propio token.
285
+
286
+ ## 📝 Notas Finales
287
+
288
+ - **Versión inicial**: 1.0.0
289
+ - **Próximas versiones**: Usa `npm version` para actualizar
290
+ - **License**: MIT (ya configurada)
291
+ - **Repositorio**: Actualiza la URL en package.json si usas uno diferente
292
+
293
+ ¡Éxito con tu publicación! 🚀
QUICKSTART.md CHANGED
@@ -6,6 +6,8 @@
6
  2. Haz clic en "Get personal access token"
7
  3. Copia el token generado
8
 
 
 
9
  ## Paso 2: Crear archivo .env
10
 
11
  ```bash
@@ -66,10 +68,16 @@ En Claude Desktop, escribe:
66
  ¿Qué herramientas tienes disponibles?
67
  ```
68
 
69
- Deberías ver `get_figma_comments` y `summarize_figma_comments` en la lista.
 
 
 
 
70
 
71
  ## Uso básico
72
 
 
 
73
  Para obtener comentarios de un archivo de Figma:
74
 
75
  ```
@@ -78,6 +86,22 @@ Obtén los comentarios del archivo de Figma: ABC123XYZ
78
 
79
  Donde `ABC123XYZ` es el ID del archivo (sacado de la URL de Figma).
80
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
81
  ## ¿Problemas?
82
 
83
  Revisa el archivo `README.md` para solución de problemas detallada.
 
6
  2. Haz clic en "Get personal access token"
7
  3. Copia el token generado
8
 
9
+ **Nota:** Los tokens personales de Figma tienen permisos de lectura y escritura por defecto, lo que te permite tanto leer como crear comentarios.
10
+
11
  ## Paso 2: Crear archivo .env
12
 
13
  ```bash
 
68
  ¿Qué herramientas tienes disponibles?
69
  ```
70
 
71
+ Deberías ver estas herramientas en la lista:
72
+ - `get_figma_comments`
73
+ - `summarize_figma_comments`
74
+ - `post_figma_comment`
75
+ - `reply_to_figma_comment`
76
 
77
  ## Uso básico
78
 
79
+ ### Leer comentarios
80
+
81
  Para obtener comentarios de un archivo de Figma:
82
 
83
  ```
 
86
 
87
  Donde `ABC123XYZ` es el ID del archivo (sacado de la URL de Figma).
88
 
89
+ ### Crear comentarios
90
+
91
+ Para crear un nuevo comentario:
92
+
93
+ ```
94
+ Crea un comentario en el archivo ABC123XYZ diciendo "Esto se ve genial!"
95
+ ```
96
+
97
+ ### Responder a comentarios
98
+
99
+ Para responder a un comentario existente:
100
+
101
+ ```
102
+ Responde al comentario 789 en el archivo ABC123XYZ: "Estoy de acuerdo"
103
+ ```
104
+
105
  ## ¿Problemas?
106
 
107
  Revisa el archivo `README.md` para solución de problemas detallada.
README.backup.md ADDED
@@ -0,0 +1,229 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Figma Comment Summary MCP Server
2
+
3
+ Un servidor MCP (Model Context Protocol) que permite a Claude Desktop recuperar y analizar comentarios de archivos de Figma.
4
+
5
+ ## Características
6
+
7
+ - Recupera todos los comentarios de un archivo de Figma específico
8
+ - Extrae información completa: texto, autor, timestamp, ubicación y hilos de respuestas
9
+ - Genera resúmenes automáticos con estadísticas por autor, ubicación y estado de resolución
10
+ - Compatible con Claude Desktop y cualquier cliente MCP
11
+
12
+ ## Herramientas Disponibles
13
+
14
+ ### 1. `get_figma_comments`
15
+ Recupera todos los comentarios de un archivo de Figma con información detallada.
16
+
17
+ **Parámetros:**
18
+ - `file_id` (string, requerido): El ID del archivo de Figma
19
+
20
+ **Retorna:**
21
+ ```json
22
+ [
23
+ {
24
+ "id": "comment_id",
25
+ "message": "Texto del comentario",
26
+ "author": {
27
+ "id": "user_id",
28
+ "handle": "username",
29
+ "img_url": "avatar_url"
30
+ },
31
+ "timestamp": "2024-01-01T00:00:00Z",
32
+ "resolvedAt": null,
33
+ "location": {
34
+ "node_id": "node_id",
35
+ "node_offset": {"x": 0, "y": 0},
36
+ "x": 100,
37
+ "y": 200
38
+ },
39
+ "replies": [
40
+ {
41
+ "id": "reply_id",
42
+ "message": "Respuesta al comentario",
43
+ "author": {...},
44
+ "timestamp": "2024-01-01T01:00:00Z"
45
+ }
46
+ ]
47
+ }
48
+ ]
49
+ ```
50
+
51
+ ### 2. `summarize_figma_comments`
52
+ Genera un resumen y análisis de todos los comentarios del archivo.
53
+
54
+ **Parámetros:**
55
+ - `file_id` (string, requerido): El ID del archivo de Figma
56
+
57
+ **Retorna:**
58
+ ```json
59
+ {
60
+ "summary": {
61
+ "total_comments": 10,
62
+ "total_replies": 5,
63
+ "resolved": 3,
64
+ "unresolved": 7
65
+ },
66
+ "by_author": {
67
+ "username1": {"comments": 5, "replies": 2},
68
+ "username2": {"comments": 5, "replies": 3}
69
+ },
70
+ "by_location": {
71
+ "node_id_1": 3,
72
+ "node_id_2": 7
73
+ },
74
+ "comments": [...]
75
+ }
76
+ ```
77
+
78
+ ## Instalación
79
+
80
+ ### 1. Clonar o copiar este proyecto
81
+
82
+ ```bash
83
+ cd /Users/fran/Documents/IN/Labs/mcp-figma-comment-summary
84
+ ```
85
+
86
+ ### 2. Instalar dependencias
87
+
88
+ ```bash
89
+ npm install
90
+ ```
91
+
92
+ ### 3. Configurar el token de Figma
93
+
94
+ 1. Obtén tu Personal Access Token de Figma:
95
+ - Ve a https://www.figma.com/developers/api#access-tokens
96
+ - Haz clic en "Get personal access token"
97
+ - Copia el token generado
98
+
99
+ 2. Crea un archivo `.env` en la raíz del proyecto:
100
+
101
+ ```bash
102
+ cp .env.example .env
103
+ ```
104
+
105
+ 3. Edita `.env` y añade tu token:
106
+
107
+ ```
108
+ FIGMA_ACCESS_TOKEN=tu_token_aqui
109
+ ```
110
+
111
+ ### 4. Configurar Claude Desktop
112
+
113
+ Edita el archivo de configuración de Claude Desktop:
114
+
115
+ **En macOS:** `~/Library/Application Support/Claude/claude_desktop_config.json`
116
+
117
+ **En Windows:** `%APPDATA%/Claude/claude_desktop_config.json`
118
+
119
+ Añade la siguiente configuración:
120
+
121
+ ```json
122
+ {
123
+ "mcpServers": {
124
+ "figma-comments": {
125
+ "command": "node",
126
+ "args": ["/Users/fran/Documents/IN/Labs/mcp-figma-comment-summary/index.js"],
127
+ "env": {
128
+ "FIGMA_ACCESS_TOKEN": "tu_token_de_figma_aqui"
129
+ }
130
+ }
131
+ }
132
+ }
133
+ ```
134
+
135
+ **Importante:** Reemplaza `/Users/fran/Documents/IN/Labs/mcp-figma-comment-summary` con la ruta absoluta a este proyecto en tu sistema.
136
+
137
+ ### 5. Reiniciar Claude Desktop
138
+
139
+ Cierra completamente Claude Desktop y vuelve a abrirlo para que cargue el nuevo servidor MCP.
140
+
141
+ ## Uso
142
+
143
+ Una vez configurado, puedes usar las herramientas en Claude Desktop:
144
+
145
+ ### Ejemplo 1: Obtener todos los comentarios
146
+
147
+ ```
148
+ Por favor, obtén todos los comentarios del archivo de Figma con ID: ABC123XYZ
149
+ ```
150
+
151
+ Claude usará automáticamente la herramienta `get_figma_comments` y te mostrará todos los comentarios.
152
+
153
+ ### Ejemplo 2: Obtener resumen
154
+
155
+ ```
156
+ Dame un resumen de los comentarios del archivo ABC123XYZ
157
+ ```
158
+
159
+ Claude usará `summarize_figma_comments` y te mostrará estadísticas y un análisis.
160
+
161
+ ### Ejemplo 3: Análisis con IA
162
+
163
+ ```
164
+ Analiza los comentarios del archivo ABC123XYZ y dime cuáles son los problemas más comunes mencionados
165
+ ```
166
+
167
+ Claude obtendrá los comentarios y realizará un análisis inteligente del contenido.
168
+
169
+ ## Cómo obtener el File ID de Figma
170
+
171
+ El File ID se encuentra en la URL del archivo de Figma:
172
+
173
+ ```
174
+ https://www.figma.com/file/ABC123XYZ/nombre-del-archivo
175
+
176
+ Este es el File ID
177
+ ```
178
+
179
+ ## Verificar instalación
180
+
181
+ Para verificar que el servidor está correctamente instalado:
182
+
183
+ 1. Abre Claude Desktop
184
+ 2. Busca el ícono de herramientas (🔧) en la interfaz
185
+ 3. Deberías ver "figma-comments" listado como servidor disponible
186
+ 4. Las herramientas `get_figma_comments` y `summarize_figma_comments` deberían aparecer
187
+
188
+ ## Desarrollo
189
+
190
+ ### Ejecutar en modo desarrollo
191
+
192
+ ```bash
193
+ npm run dev
194
+ ```
195
+
196
+ Esto ejecutará el servidor con auto-reload cuando hagas cambios.
197
+
198
+ ### Ejecutar directamente
199
+
200
+ ```bash
201
+ npm start
202
+ ```
203
+
204
+ ## Solución de problemas
205
+
206
+ ### Error: "FIGMA_ACCESS_TOKEN environment variable is required"
207
+
208
+ - Asegúrate de haber configurado el token en el archivo `.env` o en la configuración de Claude Desktop
209
+ - Verifica que el token sea válido en https://www.figma.com/developers/api
210
+
211
+ ### El servidor no aparece en Claude Desktop
212
+
213
+ - Verifica que la ruta en `claude_desktop_config.json` sea correcta y absoluta
214
+ - Asegúrate de haber reiniciado Claude Desktop completamente
215
+ - Revisa los logs de Claude Desktop para errores
216
+
217
+ ### Error al obtener comentarios
218
+
219
+ - Verifica que el File ID sea correcto
220
+ - Asegúrate de tener permisos de acceso al archivo de Figma
221
+ - El token debe tener permisos de lectura en el archivo
222
+
223
+ ## Licencia
224
+
225
+ MIT
226
+
227
+ ## Contribuciones
228
+
229
+ Las contribuciones son bienvenidas. Por favor, abre un issue o pull request.
README.huggingface.md ADDED
@@ -0,0 +1,171 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ title: Figma Comment Summary MCP
3
+ emoji: 💬
4
+ colorFrom: purple
5
+ colorTo: blue
6
+ sdk: static
7
+ pinned: false
8
+ tags:
9
+ - mcp
10
+ - model-context-protocol
11
+ - figma
12
+ - comments
13
+ - design
14
+ - collaboration
15
+ - claude
16
+ license: mit
17
+ ---
18
+
19
+ # 💬 Figma Comment Summary MCP Server
20
+
21
+ A [Model Context Protocol](https://modelcontextprotocol.io/) server that enables LLMs like Claude to **read, write, and analyze** comments in Figma files. Perfect for design review workflows, team collaboration analysis, and automated comment management.
22
+
23
+ ## 🎯 Capabilities
24
+
25
+ **📖 Read Operations:**
26
+ - Retrieve all comments with full details (text, author, timestamp, location)
27
+ - Generate automatic summaries and statistics
28
+
29
+ **✍️ Write Operations:**
30
+ - Create new comments anywhere in Figma files
31
+ - Post comments on specific design elements
32
+ - Reply to existing comment threads
33
+
34
+ **🤖 AI-Powered Workflows:**
35
+ - Auto-respond to design feedback
36
+ - Analyze and summarize design discussions
37
+ - Coordinate team reviews efficiently
38
+
39
+ ## 🚀 Quick Start
40
+
41
+ This MCP server is published on npm and can be used directly with Claude Desktop or any MCP-compatible client using `npx`.
42
+
43
+ ### Installation
44
+
45
+ Add this configuration to your Claude Desktop config file:
46
+
47
+ **macOS:** `~/Library/Application Support/Claude/claude_desktop_config.json`
48
+ **Windows:** `%APPDATA%/Claude/claude_desktop_config.json`
49
+
50
+ ```json
51
+ {
52
+ "mcpServers": {
53
+ "figma-comments": {
54
+ "command": "npx",
55
+ "args": ["-y", "mcp-figma-comment-summary"],
56
+ "env": {
57
+ "FIGMA_ACCESS_TOKEN": "your_figma_token_here"
58
+ }
59
+ }
60
+ }
61
+ }
62
+ ```
63
+
64
+ **Important:**
65
+ - Replace `your_figma_token_here` with your [Figma Personal Access Token](https://developers.figma.com/docs/rest-api/authentication/#access-tokens)
66
+ - Each user needs their own token (secure and private)
67
+ - Restart Claude Desktop after updating the configuration
68
+
69
+ ## ✨ Features
70
+
71
+ - 📝 **Retrieve Comments**: Get all comments from any Figma file with full details
72
+ - 👥 **Author Information**: Extract author data, timestamps, and reply threads
73
+ - 📊 **Smart Summaries**: Generate statistics by author, location, and resolution status
74
+ - 🔧 **Easy Integration**: Works with Claude Desktop and any MCP client
75
+ - 🔒 **Secure**: Each user uses their own Figma token
76
+
77
+ ## 🛠️ Available Tools
78
+
79
+ ### `get_figma_comments`
80
+
81
+ Retrieve all comments from a Figma file with complete information including text, authors, timestamps, locations, and reply threads.
82
+
83
+ **Parameters:**
84
+ - `file_id` (string): The Figma file ID from the URL
85
+
86
+ **Example:**
87
+ ```
88
+ Get all comments from Figma file ABC123XYZ
89
+ ```
90
+
91
+ ### `summarize_figma_comments`
92
+
93
+ Generate a comprehensive summary and analysis of all comments in a Figma file.
94
+
95
+ **Parameters:**
96
+ - `file_id` (string): The Figma file ID from the URL
97
+
98
+ **Example:**
99
+ ```
100
+ Summarize the comments from Figma file ABC123XYZ
101
+ ```
102
+
103
+ ## 📖 Use Cases
104
+
105
+ - **Design Reviews**: Quickly gather all feedback from stakeholders
106
+ - **Team Collaboration**: Analyze comment patterns and identify bottlenecks
107
+ - **Comment Management**: Track unresolved comments and resolution status
108
+ - **Reporting**: Generate summaries for design sprint retrospectives
109
+ - **AI Analysis**: Let Claude analyze sentiment and extract action items
110
+
111
+ ## 💡 Example Conversations
112
+
113
+ Once installed, you can ask Claude:
114
+
115
+ ```
116
+ "Get all comments from Figma file ABC123 and tell me which ones are unresolved"
117
+
118
+ "Summarize the feedback on file XYZ123 and identify common themes"
119
+
120
+ "Show me all comments by username 'john' in file ABC123"
121
+
122
+ "Which design elements in file XYZ have the most comments?"
123
+ ```
124
+
125
+ ## 🔍 Finding Your Figma File ID
126
+
127
+ The File ID is in your Figma file URL:
128
+
129
+ ```
130
+ https://www.figma.com/file/ABC123XYZ/file-name
131
+
132
+ This is the File ID
133
+ ```
134
+
135
+ ## 📦 Installation from npm
136
+
137
+ ```bash
138
+ npm install -g mcp-figma-comment-summary
139
+ ```
140
+
141
+ Or use directly with `npx` (recommended):
142
+
143
+ ```bash
144
+ npx -y mcp-figma-comment-summary
145
+ ```
146
+
147
+ ## 🔗 Links
148
+
149
+ - **npm Package**: [mcp-figma-comment-summary](https://www.npmjs.com/package/mcp-figma-comment-summary)
150
+ - **GitHub Repository**: [IgnorantesNaturales/mcp-figma-comment-summary](https://github.com/IgnorantesNaturales/mcp-figma-comment-summary)
151
+ - **Model Context Protocol**: [modelcontextprotocol.io](https://modelcontextprotocol.io/)
152
+ - **Figma API**: [Figma Developers](https://www.figma.com/developers/api)
153
+
154
+ ## 🤝 Contributing
155
+
156
+ Contributions are welcome! Please visit the [GitHub repository](https://github.com/IgnorantesNaturales/mcp-figma-comment-summary) to contribute.
157
+
158
+ ## 📄 License
159
+
160
+ MIT License - see the [LICENSE](https://github.com/IgnorantesNaturales/mcp-figma-comment-summary/blob/main/LICENSE) file for details.
161
+
162
+ ## 🙋 Support
163
+
164
+ If you encounter issues:
165
+ - Check the [Troubleshooting Guide](https://github.com/IgnorantesNaturales/mcp-figma-comment-summary#troubleshooting)
166
+ - Open an issue on [GitHub](https://github.com/IgnorantesNaturales/mcp-figma-comment-summary/issues)
167
+ - Review the [Figma API documentation](https://www.figma.com/developers/api)
168
+
169
+ ---
170
+
171
+ Made with ❤️ for the MCP community
README.md CHANGED
@@ -1,28 +1,117 @@
1
- # Figma Comment Summary MCP Server
2
 
3
- Un servidor MCP (Model Context Protocol) que permite a Claude Desktop recuperar y analizar comentarios de archivos de Figma.
4
 
5
- ## Características
 
6
 
7
- - Recupera todos los comentarios de un archivo de Figma específico
8
- - Extrae información completa: texto, autor, timestamp, ubicación y hilos de respuestas
9
- - Genera resúmenes automáticos con estadísticas por autor, ubicación y estado de resolución
10
- - Compatible con Claude Desktop y cualquier cliente MCP
11
 
12
- ## Herramientas Disponibles
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13
 
14
  ### 1. `get_figma_comments`
15
- Recupera todos los comentarios de un archivo de Figma con información detallada.
16
 
17
- **Parámetros:**
18
- - `file_id` (string, requerido): El ID del archivo de Figma
 
 
 
 
 
 
 
19
 
20
- **Retorna:**
21
  ```json
22
  [
23
  {
24
  "id": "comment_id",
25
- "message": "Texto del comentario",
26
  "author": {
27
  "id": "user_id",
28
  "handle": "username",
@@ -32,29 +121,27 @@ Recupera todos los comentarios de un archivo de Figma con información detallada
32
  "resolvedAt": null,
33
  "location": {
34
  "node_id": "node_id",
35
- "node_offset": {"x": 0, "y": 0},
36
  "x": 100,
37
  "y": 200
38
  },
39
- "replies": [
40
- {
41
- "id": "reply_id",
42
- "message": "Respuesta al comentario",
43
- "author": {...},
44
- "timestamp": "2024-01-01T01:00:00Z"
45
- }
46
- ]
47
  }
48
  ]
49
  ```
50
 
51
  ### 2. `summarize_figma_comments`
52
- Genera un resumen y análisis de todos los comentarios del archivo.
53
 
54
- **Parámetros:**
55
- - `file_id` (string, requerido): El ID del archivo de Figma
56
 
57
- **Retorna:**
 
 
 
 
 
 
 
 
58
  ```json
59
  {
60
  "summary": {
@@ -64,166 +151,210 @@ Genera un resumen y análisis de todos los comentarios del archivo.
64
  "unresolved": 7
65
  },
66
  "by_author": {
67
- "username1": {"comments": 5, "replies": 2},
68
- "username2": {"comments": 5, "replies": 3}
69
  },
70
  "by_location": {
71
- "node_id_1": 3,
72
- "node_id_2": 7
73
  },
74
  "comments": [...]
75
  }
76
  ```
77
 
78
- ## Instalación
79
 
80
- ### 1. Clonar o copiar este proyecto
81
 
82
- ```bash
83
- cd /Users/fran/Documents/IN/Labs/mcp-figma-comment-summary
84
- ```
 
 
 
85
 
86
- ### 2. Instalar dependencias
87
-
88
- ```bash
89
- npm install
90
  ```
 
91
 
92
- ### 3. Configurar el token de Figma
93
-
94
- 1. Obtén tu Personal Access Token de Figma:
95
- - Ve a https://www.figma.com/developers/api#access-tokens
96
- - Haz clic en "Get personal access token"
97
- - Copia el token generado
98
-
99
- 2. Crea un archivo `.env` en la raíz del proyecto:
100
-
101
- ```bash
102
- cp .env.example .env
103
  ```
104
 
105
- 3. Edita `.env` y añade tu token:
106
-
107
- ```
108
- FIGMA_ACCESS_TOKEN=tu_token_aqui
 
 
 
 
 
109
  ```
110
 
111
- ### 4. Configurar Claude Desktop
112
 
113
- Edita el archivo de configuración de Claude Desktop:
114
 
115
- **En macOS:** `~/Library/Application Support/Claude/claude_desktop_config.json`
 
 
 
116
 
117
- **En Windows:** `%APPDATA%/Claude/claude_desktop_config.json`
118
-
119
- Añade la siguiente configuración:
 
120
 
 
121
  ```json
122
  {
123
- "mcpServers": {
124
- "figma-comments": {
125
- "command": "node",
126
- "args": ["/Users/fran/Documents/IN/Labs/mcp-figma-comment-summary/index.js"],
127
- "env": {
128
- "FIGMA_ACCESS_TOKEN": "tu_token_de_figma_aqui"
129
- }
130
- }
131
  }
132
  }
133
  ```
134
 
135
- **Importante:** Reemplaza `/Users/fran/Documents/IN/Labs/mcp-figma-comment-summary` con la ruta absoluta a este proyecto en tu sistema.
 
 
136
 
137
- ### 5. Reiniciar Claude Desktop
 
 
 
 
138
 
139
- Cierra completamente Claude Desktop y vuelve a abrirlo para que cargue el nuevo servidor MCP.
140
 
141
- ## Uso
 
 
 
 
 
 
 
142
 
143
- Una vez configurado, puedes usar las herramientas en Claude Desktop:
144
 
145
- ### Ejemplo 1: Obtener todos los comentarios
146
 
 
147
  ```
148
- Por favor, obtén todos los comentarios del archivo de Figma con ID: ABC123XYZ
149
- ```
150
 
151
- Claude usará automáticamente la herramienta `get_figma_comments` y te mostrará todos los comentarios.
152
 
153
- ### Ejemplo 2: Obtener resumen
154
 
 
155
  ```
156
- Dame un resumen de los comentarios del archivo ABC123XYZ
 
157
  ```
 
158
 
159
- Claude usará `summarize_figma_comments` y te mostrará estadísticas y un análisis.
160
 
161
- ### Ejemplo 3: Análisis con IA
162
 
 
163
  ```
164
- Analiza los comentarios del archivo ABC123XYZ y dime cuáles son los problemas más comunes mencionados
 
165
  ```
 
166
 
167
- Claude obtendrá los comentarios y realizará un análisis inteligente del contenido.
 
168
 
169
- ## Cómo obtener el File ID de Figma
170
 
171
- El File ID se encuentra en la URL del archivo de Figma:
172
 
173
- ```
174
- https://www.figma.com/file/ABC123XYZ/nombre-del-archivo
175
-
176
- Este es el File ID
177
- ```
 
 
 
178
 
179
- ## Verificar instalación
180
 
181
- Para verificar que el servidor está correctamente instalado:
182
 
183
- 1. Abre Claude Desktop
184
- 2. Busca el ícono de herramientas (🔧) en la interfaz
185
- 3. Deberías ver "figma-comments" listado como servidor disponible
186
- 4. Las herramientas `get_figma_comments` y `summarize_figma_comments` deberían aparecer
187
 
188
- ## Desarrollo
189
 
190
- ### Ejecutar en modo desarrollo
 
 
191
 
192
- ```bash
193
- npm run dev
194
- ```
195
 
196
- Esto ejecutará el servidor con auto-reload cuando hagas cambios.
 
 
197
 
198
- ### Ejecutar directamente
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
199
 
200
  ```bash
201
- npm start
 
 
 
202
  ```
203
 
204
- ## Solución de problemas
205
 
206
- ### Error: "FIGMA_ACCESS_TOKEN environment variable is required"
 
207
 
208
- - Asegúrate de haber configurado el token en el archivo `.env` o en la configuración de Claude Desktop
209
- - Verifica que el token sea válido en https://www.figma.com/developers/api
210
 
211
- ### El servidor no aparece en Claude Desktop
 
 
212
 
213
- - Verifica que la ruta en `claude_desktop_config.json` sea correcta y absoluta
214
- - Asegúrate de haber reiniciado Claude Desktop completamente
215
- - Revisa los logs de Claude Desktop para errores
216
 
217
- ### Error al obtener comentarios
218
 
219
- - Verifica que el File ID sea correcto
220
- - Asegúrate de tener permisos de acceso al archivo de Figma
221
- - El token debe tener permisos de lectura en el archivo
222
 
223
- ## Licencia
224
 
225
- MIT
 
 
 
 
226
 
227
- ## Contribuciones
228
 
229
- Las contribuciones son bienvenidas. Por favor, abre un issue o pull request.
 
1
+ # mcp-figma-comment-summary
2
 
3
+ > MCP server to retrieve, analyze, and create Figma file comments with Claude Desktop
4
 
5
+ [![npm version](https://img.shields.io/npm/v/mcp-figma-comment-summary.svg)](https://www.npmjs.com/package/mcp-figma-comment-summary)
6
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
7
 
8
+ A [Model Context Protocol](https://modelcontextprotocol.io/) server that enables Claude Desktop to retrieve, analyze, and create comments in Figma files. Perfect for design review workflows, team collaboration analysis, and comment management.
 
 
 
9
 
10
+ ## 🎯 What Can This Do?
11
+
12
+ This MCP gives Claude **full read and write access** to Figma comments:
13
+
14
+ **📖 Reading:**
15
+ - Get all comments from any Figma file
16
+ - View authors, timestamps, locations, and reply threads
17
+ - Generate automatic summaries and statistics
18
+
19
+ **✍️ Writing:**
20
+ - Create new comments anywhere in a Figma file
21
+ - Post comments on specific design elements (nodes)
22
+ - Reply to existing comments to maintain conversations
23
+ - Let Claude intelligently respond to feedback
24
+
25
+ **🤖 AI-Powered Workflows:**
26
+ - Analyze designs and post constructive feedback
27
+ - Automatically respond to comment threads
28
+ - Summarize feedback for team meetings
29
+ - Coordinate reviews across multiple stakeholders
30
+
31
+ ## Features
32
+
33
+ - 📝 Retrieve all comments from any Figma file with full details
34
+ - ✍️ Create new comments and reply to existing ones
35
+ - 👥 Extract author information, timestamps, and reply threads
36
+ - 📊 Generate automatic summaries with statistics by author, location, and resolution status
37
+ - 📍 Post comments to specific locations (nodes or coordinates)
38
+ - 🔧 Easy integration with Claude Desktop and any MCP client
39
+ - 🔒 Each user uses their own Figma token (secure and private)
40
+
41
+ ## Quick Start
42
+
43
+ ### Prerequisites
44
+
45
+ - Node.js 18 or higher
46
+ - A [Figma Personal Access Token](https://www.figma.com/developers/api#access-tokens)
47
+ - Claude Desktop or any MCP-compatible client
48
+
49
+ ### Installation
50
+
51
+ Add this to your Claude Desktop configuration file:
52
+
53
+ **macOS:** `~/Library/Application Support/Claude/claude_desktop_config.json`
54
+ **Windows:** `%APPDATA%/Claude/claude_desktop_config.json`
55
+
56
+ ```json
57
+ {
58
+ "mcpServers": {
59
+ "figma-comments": {
60
+ "command": "npx",
61
+ "args": ["-y", "mcp-figma-comment-summary"],
62
+ "env": {
63
+ "FIGMA_ACCESS_TOKEN": "your_figma_token_here"
64
+ }
65
+ }
66
+ }
67
+ }
68
+ ```
69
+
70
+ **Important:** Replace `your_figma_token_here` with your actual Figma Personal Access Token.
71
+
72
+ ### Getting Your Figma Token
73
+
74
+ 1. Go to [Figma Settings → Account](https://www.figma.com/settings)
75
+ 2. Scroll to "Personal access tokens"
76
+ 3. Click "Generate new token"
77
+ 4. Give it a name and copy the token
78
+ 5. Paste it in the configuration above
79
+
80
+ ### Restart Claude Desktop
81
+
82
+ After updating the configuration, completely quit and restart Claude Desktop to load the MCP server.
83
+
84
+ ## Available Tools
85
+
86
+ This MCP provides **4 tools** split into **read** and **write** operations:
87
+
88
+ | Tool | Type | Description |
89
+ |------|------|-------------|
90
+ | `get_figma_comments` | 📖 Read | Retrieve all comments with full details |
91
+ | `summarize_figma_comments` | 📖 Read | Generate statistics and analysis |
92
+ | `post_figma_comment` | ✍️ Write | Create new comments (general or on specific elements) |
93
+ | `reply_to_figma_comment` | ✍️ Write | Reply to existing comments |
94
+
95
+ ---
96
 
97
  ### 1. `get_figma_comments`
 
98
 
99
+ Retrieve all comments from a Figma file with complete information.
100
+
101
+ **Parameters:**
102
+ - `file_id` (string, required): The Figma file ID from the URL
103
+
104
+ **Example usage in Claude:**
105
+ ```
106
+ Get all comments from Figma file ABC123XYZ
107
+ ```
108
 
109
+ **Returns:**
110
  ```json
111
  [
112
  {
113
  "id": "comment_id",
114
+ "message": "Comment text",
115
  "author": {
116
  "id": "user_id",
117
  "handle": "username",
 
121
  "resolvedAt": null,
122
  "location": {
123
  "node_id": "node_id",
 
124
  "x": 100,
125
  "y": 200
126
  },
127
+ "replies": [...]
 
 
 
 
 
 
 
128
  }
129
  ]
130
  ```
131
 
132
  ### 2. `summarize_figma_comments`
 
133
 
134
+ Generate a summary and analysis of all comments in a Figma file.
 
135
 
136
+ **Parameters:**
137
+ - `file_id` (string, required): The Figma file ID from the URL
138
+
139
+ **Example usage in Claude:**
140
+ ```
141
+ Summarize the comments from Figma file ABC123XYZ
142
+ ```
143
+
144
+ **Returns:**
145
  ```json
146
  {
147
  "summary": {
 
151
  "unresolved": 7
152
  },
153
  "by_author": {
154
+ "username1": {"comments": 5, "replies": 2}
 
155
  },
156
  "by_location": {
157
+ "node_id_1": 3
 
158
  },
159
  "comments": [...]
160
  }
161
  ```
162
 
163
+ ### 3. `post_figma_comment`
164
 
165
+ Create a new comment on a Figma file. Optionally specify a location where the comment should be placed.
166
 
167
+ **Parameters:**
168
+ - `file_id` (string, required): The Figma file ID from the URL
169
+ - `message` (string, required): The text content of the comment
170
+ - `node_id` (string, optional): The ID of the node/element to attach the comment to
171
+ - `x` (number, optional): X coordinate for the comment position
172
+ - `y` (number, optional): Y coordinate for the comment position
173
 
174
+ **Example usage in Claude:**
 
 
 
175
  ```
176
+ Post a comment on Figma file ABC123XYZ saying "This looks great!"
177
 
178
+ Add a comment to node 123:456 in file ABC123XYZ: "Please review this button"
 
 
 
 
 
 
 
 
 
 
179
  ```
180
 
181
+ **Returns:**
182
+ ```json
183
+ {
184
+ "comment": {
185
+ "id": "new_comment_id",
186
+ "message": "This looks great!",
187
+ "created_at": "2024-01-01T00:00:00Z"
188
+ }
189
+ }
190
  ```
191
 
192
+ ### 4. `reply_to_figma_comment`
193
 
194
+ Reply to an existing comment in a Figma file.
195
 
196
+ **Parameters:**
197
+ - `file_id` (string, required): The Figma file ID from the URL
198
+ - `comment_id` (string, required): The ID of the comment to reply to
199
+ - `message` (string, required): The text content of the reply
200
 
201
+ **Example usage in Claude:**
202
+ ```
203
+ Reply to comment 789 in file ABC123XYZ: "I agree with this feedback"
204
+ ```
205
 
206
+ **Returns:**
207
  ```json
208
  {
209
+ "comment": {
210
+ "id": "new_reply_id",
211
+ "message": "I agree with this feedback",
212
+ "parent_id": "789",
213
+ "created_at": "2024-01-01T00:00:00Z"
 
 
 
214
  }
215
  }
216
  ```
217
 
218
+ ## Finding the Figma File ID
219
+
220
+ The File ID is in your Figma file URL:
221
 
222
+ ```
223
+ https://www.figma.com/file/ABC123XYZ/file-name
224
+
225
+ This is the File ID
226
+ ```
227
 
228
+ ## Use Cases
229
 
230
+ - **Design Reviews:** Quickly gather all feedback and comments from stakeholders
231
+ - **Automated Feedback:** Let Claude post comments based on design analysis
232
+ - **Team Collaboration:** Analyze comment patterns and identify bottlenecks
233
+ - **Comment Management:** Find unresolved comments and track resolution status
234
+ - **Batch Responses:** Reply to multiple comments efficiently with AI assistance
235
+ - **Reporting:** Generate summaries for design sprint retrospectives
236
+ - **AI Analysis:** Let Claude analyze comment sentiment and extract action items
237
+ - **Proactive Commenting:** Claude can suggest and post improvement suggestions
238
 
239
+ ## Example Conversations with Claude
240
 
241
+ Once installed, you can ask Claude:
242
 
243
+ **Reading comments:**
244
  ```
245
+ "Get all comments from Figma file ABC123 and tell me which ones are unresolved"
 
246
 
247
+ "Summarize the feedback on file XYZ123 and identify common themes"
248
 
249
+ "Show me all comments by username 'john' in file ABC123"
250
 
251
+ "Which design elements in file XYZ have the most comments?"
252
  ```
253
+
254
+ **Writing comments:**
255
  ```
256
+ "Post a comment on Figma file ABC123 saying 'Approved for development'"
257
 
258
+ "Reply to all unresolved comments in file XYZ123 asking for clarification"
259
 
260
+ "Add a comment to node 123:456 in file ABC: 'This button needs better contrast'"
261
 
262
+ "Review all comments in file ABC123 and respond to the ones that need attention"
263
  ```
264
+
265
+ **Combined workflows:**
266
  ```
267
+ "Get all unresolved comments from file ABC123, analyze them, and post a summary comment"
268
 
269
+ "Find comments mentioning 'urgent' and reply with 'Working on this today'"
270
+ ```
271
 
272
+ ## Verification
273
 
274
+ To verify the installation:
275
 
276
+ 1. Open Claude Desktop
277
+ 2. Look for the tools icon (🔧) in the interface
278
+ 3. You should see "figma-comments" listed as an available server
279
+ 4. The following tools should appear:
280
+ - `get_figma_comments`
281
+ - `summarize_figma_comments`
282
+ - `post_figma_comment`
283
+ - `reply_to_figma_comment`
284
 
285
+ ## Troubleshooting
286
 
287
+ ### "FIGMA_ACCESS_TOKEN environment variable is required"
288
 
289
+ - Ensure your token is correctly set in `claude_desktop_config.json`
290
+ - Verify the token is valid at [Figma Settings](https://www.figma.com/settings)
 
 
291
 
292
+ ### Server doesn't appear in Claude Desktop
293
 
294
+ - Check that the configuration file path is correct
295
+ - Ensure you completely quit and restarted Claude Desktop (not just closed the window)
296
+ - Check Claude Desktop logs for errors
297
 
298
+ ### Error fetching comments
 
 
299
 
300
+ - Verify the File ID is correct
301
+ - Ensure you have access permissions to the Figma file
302
+ - Your token must have read permissions for the file
303
 
304
+ ### Error posting or replying to comments
305
+
306
+ - Ensure your token has **write permissions** (personal access tokens usually have both read and write by default)
307
+ - Verify you have edit access to the Figma file
308
+ - Check that the `node_id` exists if you're posting to a specific node
309
+ - When replying, verify the `comment_id` is correct and exists
310
+
311
+ ### Permission requirements
312
+
313
+ **Read operations** (`get_figma_comments`, `summarize_figma_comments`):
314
+ - Requires read access to the Figma file
315
+ - Token needs basic read permissions
316
+
317
+ **Write operations** (`post_figma_comment`, `reply_to_figma_comment`):
318
+ - Requires edit access to the Figma file
319
+ - Token needs write permissions (usually enabled by default on personal access tokens)
320
+ - You must be a member of the team or have been granted edit access to the file
321
+
322
+ ## Development
323
+
324
+ To run the server locally for development:
325
 
326
  ```bash
327
+ git clone https://github.com/cloudframework-io/mcp-figma-comment-summary.git
328
+ cd mcp-figma-comment-summary
329
+ npm install
330
+ npm run dev
331
  ```
332
 
333
+ ## Documentation
334
 
335
+ - [FEATURES.md](FEATURES.md) - Complete guide to all read and write capabilities
336
+ - [QUICKSTART.md](QUICKSTART.md) - Quick installation guide in Spanish
337
 
338
+ ## Related Resources
 
339
 
340
+ - [Model Context Protocol Documentation](https://modelcontextprotocol.io/)
341
+ - [Figma API Documentation](https://www.figma.com/developers/api)
342
+ - [Claude Desktop](https://claude.ai/download)
343
 
344
+ ## License
 
 
345
 
346
+ MIT
347
 
348
+ ## Contributing
 
 
349
 
350
+ Contributions are welcome! Please feel free to submit a Pull Request.
351
 
352
+ ## Support
353
+
354
+ If you encounter any issues or have questions:
355
+ - Open an issue on [GitHub](https://github.com/cloudframework-io/mcp-figma-comment-summary/issues)
356
+ - Check the [Figma API documentation](https://www.figma.com/developers/api)
357
 
358
+ ---
359
 
360
+ Made with ❤️ for the MCP community
README.npm.md ADDED
@@ -0,0 +1,232 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # mcp-figma-comment-summary
2
+
3
+ > MCP server to retrieve, analyze, and create Figma file comments with Claude Desktop
4
+
5
+ [![npm version](https://img.shields.io/npm/v/mcp-figma-comment-summary.svg)](https://www.npmjs.com/package/mcp-figma-comment-summary)
6
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
7
+
8
+ A [Model Context Protocol](https://modelcontextprotocol.io/) server that enables Claude Desktop to retrieve, analyze, and create comments in Figma files. Perfect for design review workflows, team collaboration analysis, and comment management.
9
+
10
+ ## 🎯 What Can This Do?
11
+
12
+ This MCP gives Claude **full read and write access** to Figma comments:
13
+
14
+ **📖 Reading:** Get comments, view authors/timestamps/locations, generate summaries
15
+ **✍️ Writing:** Create new comments, reply to threads, post on specific elements
16
+ **🤖 AI Workflows:** Auto-respond to feedback, analyze designs, coordinate reviews
17
+
18
+ ## Features
19
+
20
+ - 📝 Retrieve all comments from any Figma file with full details
21
+ - ✍️ Create new comments and reply to existing ones
22
+ - 👥 Extract author information, timestamps, and reply threads
23
+ - 📊 Generate automatic summaries with statistics by author, location, and resolution status
24
+ - 📍 Post comments to specific locations (nodes or coordinates)
25
+ - 🔧 Easy integration with Claude Desktop and any MCP client
26
+ - 🔒 Each user uses their own Figma token (secure and private)
27
+
28
+ ## Quick Start
29
+
30
+ ### Prerequisites
31
+
32
+ - Node.js 18 or higher
33
+ - A [Figma Personal Access Token](https://www.figma.com/developers/api#access-tokens)
34
+ - Claude Desktop or any MCP-compatible client
35
+
36
+ ### Installation
37
+
38
+ Add this to your Claude Desktop configuration file:
39
+
40
+ **macOS:** `~/Library/Application Support/Claude/claude_desktop_config.json`
41
+ **Windows:** `%APPDATA%/Claude/claude_desktop_config.json`
42
+
43
+ ```json
44
+ {
45
+ "mcpServers": {
46
+ "figma-comments": {
47
+ "command": "npx",
48
+ "args": ["-y", "mcp-figma-comment-summary"],
49
+ "env": {
50
+ "FIGMA_ACCESS_TOKEN": "your_figma_token_here"
51
+ }
52
+ }
53
+ }
54
+ }
55
+ ```
56
+
57
+ **Important:** Replace `your_figma_token_here` with your actual Figma Personal Access Token.
58
+
59
+ ### Getting Your Figma Token
60
+
61
+ 1. Go to [Figma Settings → Account](https://www.figma.com/settings)
62
+ 2. Scroll to "Personal access tokens"
63
+ 3. Click "Generate new token"
64
+ 4. Give it a name and copy the token
65
+ 5. Paste it in the configuration above
66
+
67
+ ### Restart Claude Desktop
68
+
69
+ After updating the configuration, completely quit and restart Claude Desktop to load the MCP server.
70
+
71
+ ## Available Tools
72
+
73
+ ### 1. `get_figma_comments`
74
+
75
+ Retrieve all comments from a Figma file with complete information.
76
+
77
+ **Parameters:**
78
+ - `file_id` (string, required): The Figma file ID from the URL
79
+
80
+ **Example usage in Claude:**
81
+ ```
82
+ Get all comments from Figma file ABC123XYZ
83
+ ```
84
+
85
+ **Returns:**
86
+ ```json
87
+ [
88
+ {
89
+ "id": "comment_id",
90
+ "message": "Comment text",
91
+ "author": {
92
+ "id": "user_id",
93
+ "handle": "username",
94
+ "img_url": "avatar_url"
95
+ },
96
+ "timestamp": "2024-01-01T00:00:00Z",
97
+ "resolvedAt": null,
98
+ "location": {
99
+ "node_id": "node_id",
100
+ "x": 100,
101
+ "y": 200
102
+ },
103
+ "replies": [...]
104
+ }
105
+ ]
106
+ ```
107
+
108
+ ### 2. `summarize_figma_comments`
109
+
110
+ Generate a summary and analysis of all comments in a Figma file.
111
+
112
+ **Parameters:**
113
+ - `file_id` (string, required): The Figma file ID from the URL
114
+
115
+ **Example usage in Claude:**
116
+ ```
117
+ Summarize the comments from Figma file ABC123XYZ
118
+ ```
119
+
120
+ **Returns:**
121
+ ```json
122
+ {
123
+ "summary": {
124
+ "total_comments": 10,
125
+ "total_replies": 5,
126
+ "resolved": 3,
127
+ "unresolved": 7
128
+ },
129
+ "by_author": {
130
+ "username1": {"comments": 5, "replies": 2}
131
+ },
132
+ "by_location": {
133
+ "node_id_1": 3
134
+ },
135
+ "comments": [...]
136
+ }
137
+ ```
138
+
139
+ ## Finding the Figma File ID
140
+
141
+ The File ID is in your Figma file URL:
142
+
143
+ ```
144
+ https://www.figma.com/file/ABC123XYZ/file-name
145
+
146
+ This is the File ID
147
+ ```
148
+
149
+ ## Use Cases
150
+
151
+ - **Design Reviews:** Quickly gather all feedback and comments from stakeholders
152
+ - **Team Collaboration:** Analyze comment patterns and identify bottlenecks
153
+ - **Comment Management:** Find unresolved comments and track resolution status
154
+ - **Reporting:** Generate summaries for design sprint retrospectives
155
+ - **AI Analysis:** Let Claude analyze comment sentiment and extract action items
156
+
157
+ ## Example Conversations with Claude
158
+
159
+ Once installed, you can ask Claude:
160
+
161
+ ```
162
+ "Get all comments from Figma file ABC123 and tell me which ones are unresolved"
163
+
164
+ "Summarize the feedback on file XYZ123 and identify common themes"
165
+
166
+ "Show me all comments by username 'john' in file ABC123"
167
+
168
+ "Which design elements in file XYZ have the most comments?"
169
+ ```
170
+
171
+ ## Verification
172
+
173
+ To verify the installation:
174
+
175
+ 1. Open Claude Desktop
176
+ 2. Look for the tools icon (🔧) in the interface
177
+ 3. You should see "figma-comments" listed as an available server
178
+ 4. The tools `get_figma_comments` and `summarize_figma_comments` should appear
179
+
180
+ ## Troubleshooting
181
+
182
+ ### "FIGMA_ACCESS_TOKEN environment variable is required"
183
+
184
+ - Ensure your token is correctly set in `claude_desktop_config.json`
185
+ - Verify the token is valid at [Figma Settings](https://www.figma.com/settings)
186
+
187
+ ### Server doesn't appear in Claude Desktop
188
+
189
+ - Check that the configuration file path is correct
190
+ - Ensure you completely quit and restarted Claude Desktop (not just closed the window)
191
+ - Check Claude Desktop logs for errors
192
+
193
+ ### Error fetching comments
194
+
195
+ - Verify the File ID is correct
196
+ - Ensure you have access permissions to the Figma file
197
+ - Your token must have read permissions for the file
198
+
199
+ ## Development
200
+
201
+ To run the server locally for development:
202
+
203
+ ```bash
204
+ git clone https://github.com/cloudframework-io/mcp-figma-comment-summary.git
205
+ cd mcp-figma-comment-summary
206
+ npm install
207
+ npm run dev
208
+ ```
209
+
210
+ ## Related Resources
211
+
212
+ - [Model Context Protocol Documentation](https://modelcontextprotocol.io/)
213
+ - [Figma API Documentation](https://www.figma.com/developers/api)
214
+ - [Claude Desktop](https://claude.ai/download)
215
+
216
+ ## License
217
+
218
+ MIT
219
+
220
+ ## Contributing
221
+
222
+ Contributions are welcome! Please feel free to submit a Pull Request.
223
+
224
+ ## Support
225
+
226
+ If you encounter any issues or have questions:
227
+ - Open an issue on [GitHub](https://github.com/cloudframework-io/mcp-figma-comment-summary/issues)
228
+ - Check the [Figma API documentation](https://www.figma.com/developers/api)
229
+
230
+ ---
231
+
232
+ Made with ❤️ for the MCP community
START_HERE.md ADDED
@@ -0,0 +1,97 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # 🎉 ¡Todo Listo para Publicar!
2
+
3
+ He creado todos los archivos necesarios para publicar tu MCP en npm siguiendo la **Opción 3** (Stdio MCP vía npm).
4
+
5
+ ## ✅ Archivos Creados
6
+
7
+ En tu proyecto `/Users/fran/Documents/IN/Labs/mcp-figma-comment-summary/` ahora tienes:
8
+
9
+ ### Configuración
10
+ - ✅ **package.json.new** - package.json actualizado con toda la metadata
11
+ - ✅ **.npmignore** - Excluye archivos innecesarios
12
+ - ✅ **LICENSE** - Licencia MIT
13
+
14
+ ### Documentación
15
+ - ✅ **README.npm.md** - README optimizado para npm
16
+ - ✅ **README.huggingface.md** - Model Card para Hugging Face
17
+ - ✅ **PUBLISHING_GUIDE.md** - Guía completa paso a paso
18
+
19
+ ## 🚀 Pasos para Publicar
20
+
21
+ ### 1. Actualizar package.json
22
+
23
+ ```bash
24
+ cd /Users/fran/Documents/IN/Labs/mcp-figma-comment-summary
25
+
26
+ # Backup
27
+ cp package.json package.json.backup
28
+
29
+ # Usar el nuevo
30
+ cp package.json.new package.json
31
+ ```
32
+
33
+ ### 2. Preparar README
34
+
35
+ ```bash
36
+ # Copiar el README para npm
37
+ cp README.npm.md README.md
38
+ ```
39
+
40
+ ### 3. Login en npm
41
+
42
+ ```bash
43
+ npm login
44
+ ```
45
+
46
+ ### 4. Verificar
47
+
48
+ ```bash
49
+ # Ver qué se publicará
50
+ npm publish --dry-run
51
+ ```
52
+
53
+ ### 5. Publicar
54
+
55
+ ```bash
56
+ # Publicar en npm
57
+ npm publish --access public
58
+ ```
59
+
60
+ ## 🎯 Después de Publicar
61
+
62
+ Los usuarios podrán instalarlo así:
63
+
64
+ ```json
65
+ {
66
+ "mcpServers": {
67
+ "figma-comments": {
68
+ "command": "npx",
69
+ "args": ["-y", "mcp-figma-comment-summary"],
70
+ "env": {
71
+ "FIGMA_ACCESS_TOKEN": "su_token_aqui"
72
+ }
73
+ }
74
+ }
75
+ }
76
+ ```
77
+
78
+ ## 📖 Más Información
79
+
80
+ Lee **PUBLISHING_GUIDE.md** para detalles completos sobre:
81
+ - Cómo crear repositorio en GitHub
82
+ - Cómo publicar en Hugging Face
83
+ - Solución de problemas
84
+ - Actualizaciones futuras
85
+
86
+ ## 🔑 Ventajas
87
+
88
+ ✅ **Sin servidor** - No necesitas hosting
89
+ ✅ **Seguro** - Cada usuario usa su token
90
+ ✅ **Fácil** - Solo npx para instalar
91
+ ✅ **Zero costo** - Gratis para siempre
92
+
93
+ ## 📝 Importante
94
+
95
+ Si usas un repositorio diferente a `cloudframework-io`, actualiza la URL en `package.json` antes de publicar.
96
+
97
+ ¡Éxito! 🚀
index.js CHANGED
@@ -79,6 +79,93 @@ async function getFigmaComments(fileId) {
79
  }
80
  }
81
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
82
  /**
83
  * Generate a summary of comments
84
  * @param {Array} comments - Array of comment objects
@@ -142,7 +229,7 @@ function summarizeComments(comments) {
142
  const server = new Server(
143
  {
144
  name: 'mcp-figma-comment-summary',
145
- version: '1.0.0',
146
  },
147
  {
148
  capabilities: {
@@ -183,6 +270,58 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
183
  required: ['file_id'],
184
  },
185
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
186
  ],
187
  };
188
  });
@@ -231,6 +370,66 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
231
  };
232
  }
233
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
234
  throw new Error(`Unknown tool: ${name}`);
235
  } catch (error) {
236
  return {
 
79
  }
80
  }
81
 
82
+ /**
83
+ * Post a new comment to a Figma file
84
+ * @param {string} fileId - The Figma file ID
85
+ * @param {string} message - The comment message text
86
+ * @param {Object} location - Optional location object with node_id or coordinates
87
+ * @returns {Promise<Object>} The created comment
88
+ */
89
+ async function postFigmaComment(fileId, message, location = null) {
90
+ try {
91
+ const body = { message };
92
+
93
+ // Add location if provided
94
+ if (location) {
95
+ body.client_meta = {};
96
+
97
+ if (location.node_id) {
98
+ body.client_meta.node_id = location.node_id;
99
+
100
+ // Add node offset if provided
101
+ if (location.node_offset) {
102
+ body.client_meta.node_offset = location.node_offset;
103
+ }
104
+ }
105
+
106
+ // Add coordinates if provided
107
+ if (location.x !== undefined && location.y !== undefined) {
108
+ body.client_meta.x = location.x;
109
+ body.client_meta.y = location.y;
110
+ }
111
+ }
112
+
113
+ const response = await fetch(`${FIGMA_API_BASE}/files/${fileId}/comments`, {
114
+ method: 'POST',
115
+ headers: {
116
+ 'X-Figma-Token': FIGMA_TOKEN,
117
+ 'Content-Type': 'application/json',
118
+ },
119
+ body: JSON.stringify(body),
120
+ });
121
+
122
+ if (!response.ok) {
123
+ const errorData = await response.json().catch(() => ({}));
124
+ throw new Error(`Figma API error: ${response.status} ${response.statusText} - ${errorData.message || ''}`);
125
+ }
126
+
127
+ const data = await response.json();
128
+ return data;
129
+ } catch (error) {
130
+ throw new Error(`Failed to post Figma comment: ${error.message}`);
131
+ }
132
+ }
133
+
134
+ /**
135
+ * Reply to an existing Figma comment
136
+ * @param {string} fileId - The Figma file ID
137
+ * @param {string} commentId - The ID of the comment to reply to
138
+ * @param {string} message - The reply message text
139
+ * @returns {Promise<Object>} The created reply
140
+ */
141
+ async function replyToFigmaComment(fileId, commentId, message) {
142
+ try {
143
+ const body = {
144
+ message,
145
+ comment_id: commentId,
146
+ };
147
+
148
+ const response = await fetch(`${FIGMA_API_BASE}/files/${fileId}/comments`, {
149
+ method: 'POST',
150
+ headers: {
151
+ 'X-Figma-Token': FIGMA_TOKEN,
152
+ 'Content-Type': 'application/json',
153
+ },
154
+ body: JSON.stringify(body),
155
+ });
156
+
157
+ if (!response.ok) {
158
+ const errorData = await response.json().catch(() => ({}));
159
+ throw new Error(`Figma API error: ${response.status} ${response.statusText} - ${errorData.message || ''}`);
160
+ }
161
+
162
+ const data = await response.json();
163
+ return data;
164
+ } catch (error) {
165
+ throw new Error(`Failed to reply to Figma comment: ${error.message}`);
166
+ }
167
+ }
168
+
169
  /**
170
  * Generate a summary of comments
171
  * @param {Array} comments - Array of comment objects
 
229
  const server = new Server(
230
  {
231
  name: 'mcp-figma-comment-summary',
232
+ version: '1.1.0',
233
  },
234
  {
235
  capabilities: {
 
270
  required: ['file_id'],
271
  },
272
  },
273
+ {
274
+ name: 'post_figma_comment',
275
+ description: 'Create a new comment on a Figma file. Optionally specify a location (node_id and/or coordinates) where the comment should be placed',
276
+ inputSchema: {
277
+ type: 'object',
278
+ properties: {
279
+ file_id: {
280
+ type: 'string',
281
+ description: 'The Figma file ID (from the URL: figma.com/file/FILE_ID/...)',
282
+ },
283
+ message: {
284
+ type: 'string',
285
+ description: 'The text content of the comment',
286
+ },
287
+ node_id: {
288
+ type: 'string',
289
+ description: 'Optional: The ID of the node/element to attach the comment to',
290
+ },
291
+ x: {
292
+ type: 'number',
293
+ description: 'Optional: X coordinate for the comment position',
294
+ },
295
+ y: {
296
+ type: 'number',
297
+ description: 'Optional: Y coordinate for the comment position',
298
+ },
299
+ },
300
+ required: ['file_id', 'message'],
301
+ },
302
+ },
303
+ {
304
+ name: 'reply_to_figma_comment',
305
+ description: 'Reply to an existing comment in a Figma file',
306
+ inputSchema: {
307
+ type: 'object',
308
+ properties: {
309
+ file_id: {
310
+ type: 'string',
311
+ description: 'The Figma file ID (from the URL: figma.com/file/FILE_ID/...)',
312
+ },
313
+ comment_id: {
314
+ type: 'string',
315
+ description: 'The ID of the comment to reply to',
316
+ },
317
+ message: {
318
+ type: 'string',
319
+ description: 'The text content of the reply',
320
+ },
321
+ },
322
+ required: ['file_id', 'comment_id', 'message'],
323
+ },
324
+ },
325
  ],
326
  };
327
  });
 
370
  };
371
  }
372
 
373
+ if (name === 'post_figma_comment') {
374
+ const { file_id, message, node_id, x, y } = args;
375
+
376
+ if (!file_id) {
377
+ throw new Error('file_id is required');
378
+ }
379
+
380
+ if (!message) {
381
+ throw new Error('message is required');
382
+ }
383
+
384
+ // Build location object if any location parameters provided
385
+ const location = {};
386
+ if (node_id) location.node_id = node_id;
387
+ if (x !== undefined) location.x = x;
388
+ if (y !== undefined) location.y = y;
389
+
390
+ const result = await postFigmaComment(
391
+ file_id,
392
+ message,
393
+ Object.keys(location).length > 0 ? location : null
394
+ );
395
+
396
+ return {
397
+ content: [
398
+ {
399
+ type: 'text',
400
+ text: `Comment posted successfully!\n\n${JSON.stringify(result, null, 2)}`,
401
+ },
402
+ ],
403
+ };
404
+ }
405
+
406
+ if (name === 'reply_to_figma_comment') {
407
+ const { file_id, comment_id, message } = args;
408
+
409
+ if (!file_id) {
410
+ throw new Error('file_id is required');
411
+ }
412
+
413
+ if (!comment_id) {
414
+ throw new Error('comment_id is required');
415
+ }
416
+
417
+ if (!message) {
418
+ throw new Error('message is required');
419
+ }
420
+
421
+ const result = await replyToFigmaComment(file_id, comment_id, message);
422
+
423
+ return {
424
+ content: [
425
+ {
426
+ type: 'text',
427
+ text: `Reply posted successfully!\n\n${JSON.stringify(result, null, 2)}`,
428
+ },
429
+ ],
430
+ };
431
+ }
432
+
433
  throw new Error(`Unknown tool: ${name}`);
434
  } catch (error) {
435
  return {
package.json CHANGED
@@ -1,24 +1,45 @@
1
  {
2
  "name": "mcp-figma-comment-summary",
3
- "version": "1.0.0",
4
- "description": "MCP server to retrieve and summarize Figma file comments",
5
  "type": "module",
6
  "main": "index.js",
7
  "bin": {
8
  "mcp-figma-comment-summary": "./index.js"
9
  },
 
 
 
 
 
 
 
10
  "scripts": {
11
  "start": "node index.js",
12
  "dev": "node --watch index.js"
13
  },
14
  "keywords": [
15
  "mcp",
 
16
  "figma",
17
  "comments",
18
- "model-context-protocol"
 
 
 
 
 
19
  ],
20
- "author": "",
21
  "license": "MIT",
 
 
 
 
 
 
 
 
22
  "dependencies": {
23
  "@modelcontextprotocol/sdk": "^1.0.4",
24
  "dotenv": "^16.4.5",
 
1
  {
2
  "name": "mcp-figma-comment-summary",
3
+ "version": "1.1.0",
4
+ "description": "MCP server to retrieve, create, and analyze Figma file comments - enables Claude Desktop to read and write design feedback",
5
  "type": "module",
6
  "main": "index.js",
7
  "bin": {
8
  "mcp-figma-comment-summary": "./index.js"
9
  },
10
+ "files": [
11
+ "index.js",
12
+ "README.md",
13
+ "FEATURES.md",
14
+ "CHANGELOG.md",
15
+ ".env.example"
16
+ ],
17
  "scripts": {
18
  "start": "node index.js",
19
  "dev": "node --watch index.js"
20
  },
21
  "keywords": [
22
  "mcp",
23
+ "model-context-protocol",
24
  "figma",
25
  "comments",
26
+ "design",
27
+ "collaboration",
28
+ "claude",
29
+ "claude-desktop",
30
+ "ai",
31
+ "llm"
32
  ],
33
+ "author": "Fran Herrera and Sergio Martinez",
34
  "license": "MIT",
35
+ "repository": {
36
+ "type": "git",
37
+ "url": "git+https://github.com/cloudframework-io/mcp-figma-comment-summary.git"
38
+ },
39
+ "bugs": {
40
+ "url": "https://github.com/cloudframework-io/mcp-figma-comment-summary/issues"
41
+ },
42
+ "homepage": "https://github.com/cloudframework-io/mcp-figma-comment-summary#readme",
43
  "dependencies": {
44
  "@modelcontextprotocol/sdk": "^1.0.4",
45
  "dotenv": "^16.4.5",
package.json.backup ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "mcp-figma-comment-summary",
3
+ "version": "1.0.0",
4
+ "description": "MCP server to retrieve and summarize Figma file comments",
5
+ "type": "module",
6
+ "main": "index.js",
7
+ "bin": {
8
+ "mcp-figma-comment-summary": "./index.js"
9
+ },
10
+ "scripts": {
11
+ "start": "node index.js",
12
+ "dev": "node --watch index.js"
13
+ },
14
+ "keywords": [
15
+ "mcp",
16
+ "figma",
17
+ "comments",
18
+ "model-context-protocol"
19
+ ],
20
+ "author": "Fran Herrera and Sergio Martinez",
21
+ "license": "MIT",
22
+ "dependencies": {
23
+ "@modelcontextprotocol/sdk": "^1.0.4",
24
+ "dotenv": "^16.4.5",
25
+ "node-fetch": "^3.3.2"
26
+ },
27
+ "engines": {
28
+ "node": ">=18.0.0"
29
+ }
30
+ }