┌─────────────────────────────────────────────────────────────┐
│ AI Coding Assistant │
│ (Claude Desktop, Cursor, etc.) │
└───────────────────────┬─────────────────────────────────────┘
│ MCP Protocol (stdio)
│
┌───────────────────────▼─────────────────────────────────────┐
│ Local MCP Server (Node.js) │
│ │
│ ┌────────────────────────────────────────────────────────┐ │
│ │ MCP Protocol Layer (stdio transport) │ │
│ │ - Tool registration & dispatch │ │
│ │ - Request/response handling │ │
│ └──────┬─────────────────────────────┬───────────────────┘ │
│ │ │ │
│ ┌──────▼──────────────┐ ┌────────▼────────────────────┐ │
│ │ Figma REST API │ │ Desktop Bridge Client │ │
│ │ - File queries │ │ - Plugin API execution │ │
│ │ - Component data │ │ - Variable management │ │
│ │ - Style extraction │ │ - Design creation │ │
│ └──────┬──────────────┘ └────────┬────────────────────┘ │
│ │ │ │
│ ┌──────▼──────────────┐ ┌────────▼────────────────────┐ │
│ │ Chrome DevTools │ │ WebSocket Connection │ │
│ │ Protocol Client │ │ (localhost:9222) │ │
│ │ - Console capture │ │ │ │
│ │ - Screenshot │ │ │ │
│ └──────┬──────────────┘ └────────┬────────────────────┘ │
└─────────┼────────────────────────────┼──────────────────────┘
│ │
│ CDP WebSocket │ Plugin Message
│ │
┌─────────▼────────────────────────────▼──────────────────────┐
│ Figma Desktop Application │
│ (--remote-debugging-port=9222) │
│ │
│ ┌────────────────────────────────────────────────────────┐ │
│ │ Desktop Bridge Plugin │ │
│ │ ┌──────────────────────────────────────────────────┐ │ │
│ │ │ Plugin Runtime (Figma Plugin API) │ │ │
│ │ │ - figma.createFrame() │ │ │
│ │ │ - figma.variables.* │ │ │
│ │ │ - Full Plugin API access │ │ │
│ │ └──────────────────────────────────────────────────┘ │ │
│ └────────────────────────────────────────────────────────┘ │
│ │
│ ┌────────────────────────────────────────────────────────┐ │
│ │ User's Design File │ │
│ │ - Components, frames, styles │ │
│ │ - Variables and collections │ │
│ └────────────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────┘