How uxmynd/figma-desktop-bidirectional-mcp works
Project type and purpose
• This is a “connector” or “middleware” system that links AI assistants (via the Model Context Protocol, MCP) to the Figma design tool. It consists of:
• An MCP server (Node.js/TypeScript) exposing 72 Figma commands
• A WebSocket broker for channel-based multi-session support
• An HTTP bridge for non-MCP clients (curl, Python scripts, etc.)
• A Figma plugin (UI + in-canvas code) that receives commands and invokes the Figma Plugin API
File structure
• Top-level
• package.json, tsconfig.json, build scripts, .claude/ (MCP config for Claude Code)
• server/
• index.ts – MCP server entrypoint over stdio
• broker.ts – WebSocket broker on port 3055, handles channel registration & message routing
• websocket.ts – client library used by the plugin to connect to the broker
• http-bridge.ts – HTTP REST API on port 3056 for non-MCP tools
• types.ts – shared TypeScript interfaces
• plugin/
• code.ts – Figma plugin logic, command handlers that receive MCP commands through WS or HTTP
• ui.html – simple UI to connect, display & copy channel IDs
• docs/ – user guides, quick-start, permission and integration guides
Key architecture details from README
• AI Assistant → MCP Server (stdio)
• ↓
• WebSocket Broker (3055) ──→ Figma Plugin → Figma API
• ↑
• HTTP Bridge (3056) ────────────┘
• Channel system: each plugin session generates a unique channel ID; AI tool joins that channel; all messages scoped by channel.
• Two transport paths: MCP (stdio → broker → plugin) vs HTTP (REST → broker → plugin).
Detailed call-outs
• That MCP Server defines 72 tool commands (referenced in index.ts)