{"at":"2026-11-23T05:52:41.669Z","dir":"sent","era":"server_discover","message":{"id":1,"jsonrpc":"2.0","method":"server/discover","params":{"_meta":{"io.modelcontextprotocol/clientCapabilities":{},"io.modelcontextprotocol/clientInfo":{"name":"didrun-lab","version":"0.1.0"},"io.modelcontextprotocol/protocolVersion":"2026-07-28"}}}}
{"at":"2026-11-23T05:52:42.117Z","dir":"received","era":"server_discover","message":{"error":{"code":-32601,"message":"Method not found"},"id":1,"jsonrpc":"2.0"}}
{"at":"2026-11-23T05:52:45.240Z","dir":"sent","era":"initialize","message":{"id":1,"jsonrpc":"2.0","method":"initialize","params":{"capabilities":{},"clientInfo":{"name":"didrun-lab","version":"0.1.0"},"protocolVersion":"2025-11-25"}}}
{"at":"2026-11-23T05:52:45.656Z","dir":"received","era":"initialize","message":{"id":1,"jsonrpc":"2.0","result":{"capabilities":{"tools":{}},"protocolVersion":"2025-11-25","serverInfo":{"name":"figma-ui-mcp","version":"2.5.30"}}}}
{"at":"2026-11-23T05:52:45.656Z","dir":"sent","era":"initialize","message":{"jsonrpc":"2.0","method":"notifications/initialized"}}
{"at":"2026-11-23T05:52:45.656Z","dir":"sent","era":"initialize","message":{"id":2,"jsonrpc":"2.0","method":"tools/list","params":{}}}
{"at":"2026-11-23T05:52:45.658Z","dir":"received","era":"initialize","message":{"id":2,"jsonrpc":"2.0","result":{"tools":[{"description":"Check whether the Figma plugin bridge is connected. Always call this first to confirm the plugin is running before any other tool.","inputSchema":{"properties":{},"required":[],"type":"object"},"name":"figma_status"},{"description":"Execute JavaScript code to CREATE or MODIFY designs in Figma. ⚠️ MANDATORY: Call figma_docs BEFORE writing any design code. Skipping figma_docs causes hardcoded colors, wrong sizing, broken layouts, and low-quality UI. Use the `figma` proxy object — all methods return Promises, use async/await. Operations: create, modify, delete, clone, group, ungroup, flatten, resize, set_selection, set_viewport, batch (multiple ops in one call). Design Tokens: createVariableCollection, createVariable, setVariableValue, addVariableMode, renameVariableMode, removeVariableMode, applyVariable, setFrameVariableMode, clearFrameVariableMode, createPaintStyle, createTextStyle, createComponent. Prototyping: setReactions, getReactions, removeReactions (click/hover/press → navigate/overlay/swap with Smart Animate transitions). Scroll: setScrollBehavior (overflowDirection: NONE/HORIZONTAL/VERTICAL/BOTH). Variants: setComponentProperties, swapComponent, getComponentProperties. Component property definitions (master-side, required for instance text overrides to recalc auto-layout): addComponentProperty (TEXT/BOOLEAN/INSTANCE_SWAP), bindComponentPropertyToText, removeComponentProperty. The code runs in a sandboxed VM: no access to require, process, fs, fetch, or network.","inputSchema":{"properties":{"code":{"description":"JavaScript using figma.create(), figma.modify(), figma.setPage(), etc.","type":"string"},"sessionId":{"description":"Target a specific Figma file/tab when multiple are connected. Omit to auto-select.","type":"string"}},"required":["code"],"type":"object"},"name":"figma_write"},{"description":"READ design data from Figma — extract node trees, colors, typography, spacing, and screenshots. Use to understand an existing design before generating code, or to inspect what's on the canvas.","inputSchema":{"properties":{"depth":{"description":"Tree depth for get_design/get_selection. Number (default 10) or 'full' for unlimited. Higher = more detail but larger output.","type":"string"},"detail":{"description":"Detail level for get_design/get_selection: 'minimal' (~5% tokens), 'compact' (~30%), 'full' (default, 100%). Use minimal for large files.","type":"string"},"format":{"description":"Image format for export_image: 'png' (default) or 'jpg'.","type":"string"},"includeHidden":{"description":"Include invisible nodes (visible:false) in results. Default false — hidden layers are skipped to reduce noise.","type":"boolean"},"nodeId":{"description":"Target node ID (optional — omit to use current selection).","type":"string"},"nodeName":{"description":"Target node name (alternative to nodeId).","type":"string"},"operation":{"description":"── Design-to-code (use these for code generation) ──\nget_design_context: AI-optimized payload for a node — flex layout, token-resolved colors, typography with style names, component instances with variant properties. Best single call for design→React/Vue/Swift code.\nget_css: ready-to-use CSS string for a single node — background, flex, border, radius, shadow, typography, opacity, transform.\nget_component_map: list every component instance in a frame with componentSetName, variantLabel, properties, and suggestedImport path. Use to scaffold import statements.\nget_unmapped_components: find component instances that have no description in Figma (likely no code mapping yet). Prompts AI to ask user for correct import paths.\n── Inspect ──\nget_node_detail: structured properties for a single node — fills, bound variables (resolved to name+value), style refs (resolved to name+hex), instance overrides (full field list), componentSetName/variantLabel.\nget_selection: full design tree of selected node(s) + design tokens summary.\nget_design: full node tree for a frame/page (depth param: number or 'full').\nget_page_nodes: top-level frames on the current page.\n── Styles & tokens ──\nget_styles: all local paint, text, effect, grid styles.\nget_variables: all local Design Token variables — collections, modes, resolved values.\nget_local_components: component listing with descriptions + variant property definitions.\n── Export ──\nscreenshot: PNG of a node — displays inline in Claude Code.\nexport_svg: SVG markup string.\nexport_image: base64 PNG/JPG for saving to disk (scale param for resolution).\n── Search ──\nsearch_nodes: filter by type, namePattern (wildcard *), fill color, fontFamily, fontSize, hasImage, hasIcon.\nscan_design: structured summary of large frames — all text, colors, fonts, images, icons, sections.\n── Viewport ──\nget_viewport: current viewport center, zoom, bounds.","enum":["get_selection","get_design","get_page_nodes","screenshot","export_svg","get_styles","get_local_components","get_viewport","get_variables","get_node_detail","get_css","get_design_context","get_component_map","get_unmapped_components","export_image","search_nodes","scan_design"],"type":"string"},"scale":{"description":"Export scale for screenshot (default 1).","type":"number"},"sessionId":{"description":"Target a specific Figma file/tab when multiple are connected. Omit to auto-select.","type":"string"}},"required":["operation"],"type":"object"},"name":"figma_read"},{"description":"Get the API reference and design rules for figma_write. Call with no args first — returns quick-start guide + critical rules. Then load specific sections as needed: section='rules' (design principles, token rules, layer order, component-first), section='layout' (auto-layout, button/card/badge/progress/mobile rules), section='api' (create/modify/delete/clone/batch/read operations + workflow), section='tokens' (variables, multi-mode, paint styles, text styles), section='icons' (loadImage, loadIcon, loadIconIn, icon libraries, coloring, sizing). Always call figma_docs BEFORE any figma_write code.","inputSchema":{"properties":{"section":{"description":"Which section to load. Omit (or null) for quick-start + critical rules. Load layout before any auto-layout work. Load api for full operation reference. Load tokens for variable/multi-mode work. Load icons for image/icon placement.","enum":["rules","layout","api","tokens","icons"],"type":"string"}},"required":[],"type":"object"},"name":"figma_docs"},{"description":"Generate a design system rule sheet from the current Figma file — aggregates color tokens, typography styles, variables (all modes), and component catalog into a single markdown block. Equivalent to official Figma MCP's create_design_system_rules. Call once at the start of a design-to-code session to give the AI full context: what tokens to use, what text styles exist, which components are available. Re-run when the design system changes.","inputSchema":{"properties":{"sessionId":{"description":"Target a specific Figma file/tab. Omit to auto-select.","type":"string"}},"required":[],"type":"object"},"name":"figma_rules"}]}}}
