Skip to content

Lutimi/claude2figma

Repository files navigation

cursor2figma 🎨

Tu bridge oficial entre Cursor/Claude y Figma

Fork de figma-console-mcp con mejoras especΓ­ficas para flujos de trabajo AI-asistido.

ΒΏQuΓ© es cursor2figma?

cursor2figma es un servidor MCP (Model Context Protocol) que conecta Cursor IDE con Figma Desktop, permitiendo:

  • 🎯 ImportaciΓ³n HTML β†’ Figma (ΓΊnico en el mercado)
  • 🎨 GestiΓ³n completa de design systems (tokens, componentes, estilos)
  • πŸ“Έ Screenshots y debugging visual
  • πŸ“ FigJam, Slides, y herramientas de colaboraciΓ³n
  • ⚑ 94+ herramientas disponibles

Arquitectura

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     WebSocket      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Cursor IDE    β”‚ ◄─────────────────► β”‚  Figma Desktop  β”‚
β”‚  (Claude AI)    β”‚    (Port 9223+)    β”‚ (Desktop Bridge)β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
         β”‚
         β–Ό MCP Protocol
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  cursor2figma   β”‚
β”‚   (este repo)   β”‚
β”‚                 β”‚
β”‚ β€’ HTML Import   β”‚
β”‚ β€’ Variables     β”‚
β”‚ β€’ Componentes   β”‚
β”‚ β€’ Screenshots   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Estructura del Proyecto

claude2figma/
β”œβ”€β”€ cursor2figma/              # 🎯 Servidor MCP principal
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ core/
β”‚   β”‚   β”‚   β”œβ”€β”€ html-import/   # ⭐ Nuestra contribuciΓ³n
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ html-to-figma.ts
β”‚   β”‚   β”‚   β”‚   └── index.ts
β”‚   β”‚   β”‚   └── ...            # 94+ herramientas de southleft
β”‚   β”œβ”€β”€ figma-desktop-bridge/  # Plugin Figma
β”‚   └── dist/                  # Build output
β”‚
β”œβ”€β”€ deprecated/                # πŸ—„οΈ CΓ³digo histΓ³rico
β”‚   └── cursor2figma-old/      # VersiΓ³n CDP anterior
β”‚
β”œβ”€β”€ .cursor/
β”‚   β”œβ”€β”€ mcp.json               # Config MCP
β”‚   └── rules/
β”‚       └── figma-connection.mdc
β”‚
β”œβ”€β”€ landing.html               # 🎨 Ejemplo para importar
└── README.md                  # Esta documentaciΓ³n

Quick Start

1. Configurar Figma Access Token

  1. Ve a Figma Settings β†’ Personal Access Tokens
  2. Crea un token con scopes:
    • βœ… File content (Read)
    • βœ… Variables (Read)
    • βœ… Comments (Read and write)
  3. Copia el token (figd_...)
  4. Edita %USERPROFILE%\.cursor\mcp.json:
{
  "mcpServers": {
    "cursor2figma": {
      "command": "node",
      "args": ["C:\\Users\\misat\\Desktop\\claude2figma\\cursor2figma\\dist\\local.js"],
      "env": {
        "FIGMA_ACCESS_TOKEN": "figd_TU_TOKEN_AQUI",
        "ENABLE_MCP_APPS": "true",
        "FIGMA_WS_PORT": "9223"
      }
    }
  }
}

2. Instalar Desktop Bridge Plugin

  1. Abre Figma Desktop
  2. Plugins β†’ Development β†’ Import plugin from manifest...
  3. Selecciona: %USERPROFILE%\.figma-console-mcp\plugin\manifest.json
  4. El plugin se abre automΓ‘ticamente β€” dΓ©jalo abierto

3. Build e Instalar

cd C:\Users\misat\Desktop\claude2figma\cursor2figma
npm install
npm run build:local

4. Reiniciar Cursor

  1. Cierra Cursor completamente
  2. Vuelve a abrirlo
  3. Espera 5-10 segundos a que el MCP se cargue

5. Verificar ConexiΓ³n

En el chat de Cursor, escribe:

Check Figma status

Debe responder:

{
  "connected": true,
  "transport": "websocket",
  "fileName": "Tu Archivo Figma"
}

Uso

Importar HTML a Figma

// Desde HTML inline
figma_import_html({
  html: "<!DOCTYPE html><html>...</html>",
  name: "Mi Landing",
  width: 1440
})

// O desde URL
figma_import_html({
  url: "http://localhost:8778/landing.html",
  name: "Izipay Landing",
  width: 1440
})

Otras Herramientas Principales

Herramienta DescripciΓ³n
figma_get_variables Extraer design tokens
figma_batch_create_variables Crear 100+ tokens en batch
figma_get_component Metadata de componentes
figma_instantiate_component Crear instancias
figma_execute Ejecutar JavaScript arbitrario
figma_capture_screenshot Capturar screenshots
figjam_create_sticky Crear sticky notes
figma_list_slides Gestionar slides

Nuestra ContribuciΓ³n: HTML Import

Hemos desarrollado una funcionalidad ΓΊnica que no existe en ningΓΊn otro MCP de Figma:

Archivos:

  • cursor2figma/src/core/html-import/html-to-figma.ts β€” LΓ³gica de extracciΓ³n
  • cursor2figma/src/core/html-import/index.ts β€” Registro MCP

CaracterΓ­sticas:

  • Renderizado con Playwright (headless Chromium)
  • ExtracciΓ³n de estilos computados (CSS aplicado)
  • Soporte para: gradientes, sombras, pseudo-elementos, textos, imΓ‘genes
  • Posicionamiento absoluto para fidelidad pixel-perfect

SoluciΓ³n de Problemas

"MCP server does not exist"

  1. Verifica que el build existe: cursor2figma/dist/local.js
  2. Reinicia Cursor
  3. Espera 10 segundos despuΓ©s de reiniciar

"WebSocket not available"

  1. Abre Figma Desktop
  2. Activa el plugin Desktop Bridge
  3. Verifica que no haya mΓΊltiples instancias del MCP corriendo

MΓΊltiples instancias (problema anterior)

Si ves puertos 9223-9228 todos ocupados, mata los procesos:

Get-Process -Name "node" | Where-Object { $_.CommandLine -like "*cursor2figma*" } | Stop-Process

Diferencias con figma-console-mcp oficial

Aspecto cursor2figma figma-console-mcp
HTML Import βœ… Incluido ❌ No disponible
Nombre cursor2figma figma-console-mcp
Mantenimiento Nosotros + upstream southleft
Objetivo Cursor + Figma General

Roadmap

  • Mejorar soporte para fuentes web en HTML Import
  • AΓ±adir importaciΓ³n de componentes React β†’ Figma
  • Integrar con Code Connect
  • Visual regression testing

Licencia

Recursos

About

Workspace claude2figma: cursor2figma MCP server (HTML->Figma), skills, proyectos y herramientas Cursor/Claude

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors