# Layerbridge [Health: Active]

**Category:** 📐 Architecture & Design  
**Repository:** https://github.com/muradyf/layerbridge  
**GitHub Stars:** 1  
**npm Downloads (last month):** 171  
**Views:** 8  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/layerbridge

## Description
Read, edit and export the Figma file open in a local plugin. No REST API, no rate limits.

## Tools
Capabilities this server exposes over MCP:

- **get_local_components** — List the file's own components and component sets with id, key, description, page and property definitions. Scans every page unless pageId is given.
- **create_component** — Turn an existing layer into a main component.
- **combine_as_variants** — Combine two or more components into a component set (variants).
- **create_instance** — Place an instance of a local component (componentId) or a published library component (componentKey).
- **swap_component** — Swap an instance to another component, keeping overrides where Figma can.
- **detach_instance** — Detach instances into plain frames.
- **set_instance_properties** — Set an instance's component properties (variant values, boolean toggles, text, instance swaps). Keys can be plain names ('Label') or Figma's suffixed keys ('Label#12:0').
- **add_component_property** — Add a component property to a component or component set.
- **create_paint_style** — Create a local colour style from one hex colour or a stack of solid paints.
- **create_text_style** — Create a local text style. The font must be available to Figma.
- **create_effect_style** — Create a local effect style (shadows / blurs). Shadow colours may be hex.
- **create_grid_style** — Create a local layout-grid style using Figma's LayoutGrid objects.
- **update_style** — Update a local style's name, description, colour, type settings, effects or grids.
- **delete_style** — Delete a local style. Requires confirm: true.
- **apply_style** — Apply a style to a layer as its fill, stroke, text, effect or grid style.
- **create_variable_collection** — Create a local variable collection.
- **add_variable_mode** — Add a mode (e.g. Dark) to a variable collection.
- **rename_variable_mode** — Rename a mode in a variable collection.
- **create_variable** — Create a variable in a collection, optionally with values per mode. Values: hex for COLOR, number for FLOAT, boolean, string, or { alias: variableId }. Modes may be named by id or name.
- **set_variable_value** — Set a variable's value for one mode (mode id or name).
- **delete_variable** — Delete a variable. Requires confirm: true.
- **delete_variable_collection** — Delete a variable collection and everything in it. Requires confirm: true.
- **bind_variable** — Bind a variable to a layer property (width, height, itemSpacing, paddingLeft, cornerRadius, opacity, visible, characters…) or to a fill/stroke colour (field 'fill' or 'stroke'). Omit variableId to unbind.
- **get_reactions** — Read a layer's prototype interactions (triggers and actions).
- **set_reactions** — Replace or append a layer's prototype interactions, using Figma's Reaction objects.
- **remove_reactions** — Remove all of a layer's interactions, or the one at index.
- **get_annotations** — Read Dev Mode annotations in a subtree (default: current page), with the file's annotation categories.
- **set_annotations** — Replace or append a layer's annotations ({ label | labelMarkdown, properties?, categoryId? }). Works in Dev Mode too.
- **get_fonts** — Fonts used in a subtree (default: current page) with how many text layers use each; optionally the fonts available to Figma.
- **create_section** — Create a section, either at a given box or wrapped around existing layers (nodeIds).
- **set_constraints** — Set a layer's resizing constraints.
- **reorder_nodes** — Move layers in their parent's stacking order.
- **lock_nodes** — Lock or unlock layers.
- **batch_rename_nodes** — Rename many layers: regex find/replace, or a template with {name} {index} {type}. Target explicit nodeIds or every layer under rootId.
- **find_replace_text** — Find and replace text in every text layer of a subtree (default: current page). dryRun previews.
- **rename_page** — Rename a page.
- **delete_page** — Delete a page and everything on it. Requires confirm: true.
- **get_viewport** — The canvas viewport: centre, zoom and visible bounds.
- **create_from_svg** — Create editable vector layers from an SVG string.
- **save_version** — Save a named version to the file's version history. Figma notes very recent edits may not be included.
- **notify** — Show a toast message inside Figma.
- **get_rest_json** — A layer in the REST API's JSON shape (exportAsync JSON_REST_V1), without using the REST API.
- **get_selection_colors** — The colours and colour styles used in the current selection.
- **get_dev_resources** — Dev resources (links) attached to a layer, optionally its children too.
- **add_dev_resource** — Attach a dev resource link to a layer. Works in Dev Mode.
- **delete_dev_resource** — Remove a dev resource link from a layer.
- **get_board** — FigJam: read a board as compact JSON — stickies (text, colour, author, position), shapes with text, connectors (what they join, label, line type), sections with their children, tables (cell text), code blocks, text and stamps, plus a count of every layer type. Only works when the plugin runs in a FigJam file.
- **create_sticky** — FigJam: add a sticky note.
- **create_shape_with_text** — FigJam: add a shape with text in it, e.g. a flowchart box or decision diamond.
- **create_connector** — FigJam: connect two items (stickies, shapes, sections…) with a connector line that follows them when they move.
- **create_table** — FigJam: add a table, optionally filled with text row by row.
- **create_code_block** — FigJam: add a code block with syntax highlighting.
- **generate_diagram** — FigJam: draw a Mermaid flowchart as real FigJam shapes, connectors and sections, laid out automatically. Supports flowchart/graph with TD, TB, BT, LR or RL; node shapes [rect], (round), {diamond}, ((circle)), ([stadium]), [(database)], {{hexagon}}, [[subroutine]], [/parallelogram/]; edges -->, ---, -.->, ==> with |label| or -- label -->; subgraphs become sections; %% comments. Styling (classDef, style, click) is skipped and reported in warnings. Returns the id of every shape, connector and section, keyed by Mermaid id. Up to 300 nodes.
- **get_slides** — Figma Slides: the deck as rows of slides with id, name, whether it is skipped, its transition and the first few text layers of each. Only works when the plugin runs in a Slides file. Edit a slide's content with the usual tools (create_text, create_frame, set_text_content, …) using the slide id as parentId.
- **create_slide** — Figma Slides: add a slide, at the end of the deck or at a row and position. Use a row one past the last to start a new row.
- **reorder_slides** — Figma Slides: rearrange the deck. Pass every slide id exactly once, grouped into rows in the new order.
- **delete_slide** — Figma Slides: delete a slide and everything on it.
- **set_slide_transition** — Figma Slides: set the transition that plays when this slide appears. Values left out keep the slide's current ones.
- **focus_slide** — Figma Slides: make a slide the focused one, as when it is opened in single-slide view.
- **list_files** — List all currently connected Figma files. Returns fileKey and fileName for each. Use the fileKey to target a specific file in other tools.
- **get_document** — Get the current Figma page document tree. When multiple files are connected, specify fileKey.
- **get_selection** — Get the currently selected nodes in Figma. When multiple files are connected, specify fileKey.
- **get_node** — Get a specific Figma node by ID. Accepts top-level IDs like '4029:12345' and instance-child IDs like 'I12740:17806;12740:17793'. Never use hyphens. When multiple files are connected, specify fileKey.
- **get_styles** — Get all local styles in the document. When multiple files are connected, specify fileKey.
- **get_metadata** — Get metadata about the current Figma document including file name, pages, and current page info. When multiple files are connected, specify fileKey.
- **get_design_context** — Get the design context for the current selection or page. Returns a summarized tree structure optimized for understanding the current design context. When multiple files are connected, specify fileKey.
- **get_variable_defs** — Get all local variable definitions including variable collections, modes, and variable values. Variables are Figma's system for design tokens (colors, numbers, strings, booleans). When multiple files are connected, specify fileKey.
- **get_screenshot** — Export a screenshot of the selected nodes or specific nodes by ID. Returns base64-encoded image data. When multiple files are connected, specify fileKey.
- **set_node_visibility** — Show or hide specific Figma nodes. Returns previous visibility for each node so you can restore them after. Useful for isolating a single layer before exporting: hide all siblings, export the frame, then restore visibility.
- **set_text_content** — Update the contents of a single text node. The plugin loads the node's fonts before applying the new text. Accepts either text or characters. When multiple files are connected, specify fileKey.
- **set_text_properties** — Patch common text properties such as font family/style, size, alignment, auto-resize, line height, letter spacing, fill color, and bounds. When multiple files are connected, specify fileKey.
- **set_node_properties** — Patch common node properties such as name, position, size, visibility, opacity, and corner radius. Only supported properties for the target node type may be changed. Use set_solid_fill or set_gradient_fill to change paints. When multiple files are connected, specify fileKey.
- **set_solid_fill** — Replace a node's fill (or stroke) with a single solid paint. Provide a hex color and optional paint opacity — fillHex/fillOpacity are accepted as aliases. Use set_gradient_fill for gradient paints.
- **set_gradient_fill** — Replace a node's fill (or stroke) with a gradient paint. Provide ordered stops (position 0..1, hex color, optional alpha) and an optional 2x3 gradientTransform matching Figma's gradientTransform format. Useful for setting linear/radial/angular/diamond gradients programmatically.
- **set_effects** — Replace a node's effects list (drop/inner shadows, layer/background blurs). Pass an empty array to clear all effects. Each entry mirrors the shape returned by get_node's `effects` field.
- **set_stroke_properties** — Patch stroke geometry properties: weight, align, dash pattern, cap, join. Use set_solid_fill/set_gradient_fill with target='stroke' to set the paint itself.
- **set_auto_layout** — Configure auto-layout on a frame: direction, gap, padding, alignment, sizing modes, wrap. Set layoutMode='NONE' to disable auto-layout on the frame.
- **create_page** — Create a new page in the Figma document, optionally naming it and switching the editor to it. Returns the new page's ID, which can be passed as parentId to create_frame / create_text / create_shape / create_image to author content on that page. When multiple files are connected, specify fileKey.
- **create_frame** — Create a new frame, optionally inside a specified parent. You can set name, size, position, and a solid fill. When multiple files are connected, specify fileKey.
- **create_text** — Create a new text node, optionally inside a specified parent. You can set its content, font, size, alignment, color, position, and bounds. When multiple files are connected, specify fileKey.
- **create_shape** — Create a rectangle, ellipse, or line, optionally inside a specified parent. You can set its size, position, rotation, fill, and stroke. When multiple files are connected, specify fileKey.
- **create_image** — Create an image-backed rectangle from a local file path, remote URL, or data URI. You can set its parent, position, size, corner radius, and fit mode. When multiple files are connected, specify fileKey.
- **import_html_layers** — Import a DOM serialization (JSON produced by html-figma's browser htmlToFigma()) as editable Figma layers inside a new wrapper frame — frames, text, rectangles, and SVG vectors in one call. Source must be a JSON file path inside the MCP server working directory. Optionally append the wrapper into an existing frame/section via parentId. Requires the plugin to be open in the design editor. When multiple files are connected, specify fileKey.
- **duplicate_nodes** — Duplicate one or more nodes in place. The duplicates remain under the same parent as the originals. When multiple files are connected, specify fileKey.
- **reparent_nodes** — Move one or more nodes into a different parent container. When multiple files are connected, specify fileKey.
- **group_nodes** — Wrap a list of nodes in a new group. Nodes must share a common parent (or supply parentId explicitly). Returns the new group's node ID.
- **ungroup_node** — Ungroup a group or frame — its children move up to its parent and the wrapper is removed. Returns the IDs of the orphaned children in their new parent.
- **set_selection** — Set the current page selection to a list of node IDs. Pass an empty array to clear the selection. Works in both design editor and Dev Mode.
- **scroll_and_zoom_into_view** — Scroll and zoom the Figma viewport so the given nodes are framed in view. Works in both design editor and Dev Mode.
- **delete_nodes** — Delete one or more nodes. This is destructive and requires confirm: true. Page and document nodes cannot be deleted through this tool. When multiple files are connected, specify fileKey.
- **get_motion_styles** — List all available animation presets in Figma (Motion API beta). When multiple files are connected, specify fileKey.
- **get_node_motion** — Read a node's current animationStyles, animations, manualKeyframeTracks, and timelines (Motion API beta). When multiple files are connected, specify fileKey.
- **apply_animation_style** — Apply a preset animation style to a node (Motion API beta). When multiple files are connected, specify fileKey.
- **remove_animation_style** — Remove an applied animation style from a node (Motion API beta). If no animationStyleId is provided, removes all styles. When multiple files are connected, specify fileKey.
- **apply_manual_keyframe_track** — Applies or replaces the manual Motion keyframe track for a property, paint, or effect field on a node. When multiple files are connected, specify fileKey.
- **remove_manual_keyframe_track** — Removes the manual Motion keyframe track for a property, paint, or effect field on a node. When multiple files are connected, specify fileKey.
- **set_timeline_duration** — Sets the duration (in seconds) for a timeline. When multiple files are connected, specify fileKey.
- **save_screenshots** — Export nodes and save them straight to disk, one node at a time (PNG/SVG/JPG/PDF). Returns metadata only. Hidden nodes and existing files are reported rather than failing the batch; the run stops early if Figma's exports stall. When multiple files are connected, specify fileKey.
- **export_assets** — Export every matching layer in a frame to a folder, e.g. all icon instances as SVG, exactly as Figma draws them on that screen, overrides included. Scans rootId with the filter (types, namePattern, size, stopAtMatch, default true) or takes explicit nodeIds; skips hidden layers; writes identical exports once; writes manifest.json with each node's bounds relative to rootId and its file. Stops early and says why if exports stall.
- **export_tokens** — Export the file's local variables (every mode) and colour/text/effect styles as W3C design-tokens JSON, CSS custom properties, or both, written to disk.
- **export_frames_to_pdf** — Export frames as one multi-page PDF, one page per frame in the order given, written to disk.
- **export_image_fills** — Save the original images behind image fills in a subtree — the uploaded bitmaps, not a render — plus images.json listing which layers use each.
- **import_tokens** — Import design tokens into the file's local variables: W3C DTCG JSON (including export_tokens output), CSS custom properties (:root is the default mode; [data-theme="x"], .dark and @media (prefers-color-scheme: dark) are other modes) or Tailwind v4 @theme blocks. Matches existing variables by collection and name, creates what is missing, updates what changed, and sets aliases last. Previews by default — pass dryRun: false to apply. Never deletes; variables the import leaves out are listed as missing.
- **compare_to_image** — Compare a Figma node with the built page or component: exports the node as PNG, compares it with a local screenshot (image) or a screenshot Playwright takes of a local URL, and writes design, actual and diff PNGs. Returns the mismatch percentage and the largest mismatching regions in design coordinates, each with the layers most likely responsible. url needs the optional Playwright install.
- **import_url** — Render a localhost or file URL in Playwright and import the page (or one element, via selector) as editable Figma layers — frames, text, images and SVGs — through import_html_layers. Needs the optional Playwright install.
- **get_code_context** — Design-to-code context for one layer, read in a single walk. format "json" (default) returns a compact tree — each layer's flex/grid layout (mode, gap, padding, justify/align, fixed/hug/fill sizing, absolute position with constraints), a ref into a deduped styles table (fills, strokes, radius, effects, opacity) and textStyles table, text with mixed-style segments, component instances with variant and property values, icons collapsed to { type: ICON, assetHint }, image fills as imageRef — plus tokens used and assets to export. Every variable-bound value carries the variable name, its CSS custom property (the same name export_tokens writes) and the resolved value. "jsx-tailwind" and "html-css" return starter code built from that tree, headed by the tokens, components, icons and images it needs.
- **run_script** — Run JavaScript inside the Figma plugin with `figma` (the Plugin API) in scope, as the body of an async function: use await, and return a JSON-serialisable value. Returns { result, logs (console.log/info/warn/error/debug during the run), durationMs }; nodes in the result become {id, name, type}, cycles are cut and results over ~200KB are truncated. The script can change or delete anything in the file. In Dev Mode only reading works. A timed-out script cannot be stopped and may keep running. Off unless the server runs with FIGMA_BRIDGE_ALLOW_SCRIPTS=1.
- **generate_component_docs** — Document a component or component set (an instance documents its main component): name, description, documentation links, property definitions with types, defaults and variant options, the variants, every variable (with its CSS custom property) and style used inside it, and optionally how many instances the file has. Returns markdown (default) or JSON; outputPath also writes it to a file, writeToCanvas also places a documentation frame beside the component (needs the design editor).
- **check_accessibility** — Check a frame for WCAG 2.2 accessibility problems: text contrast (1.4.3 AA / 1.4.6 AAA), target size (2.5.8, or 2.5.5 at 44px) and very small text. Contrast is computed from the layers behind each text; when the background is an image, gradient, blur or blend it renders the containing layer as a PNG and samples the pixels behind the text, reporting the worst background colour (method: sampled). Returns a 0-100 score and issues sorted by severity, each with the node, colours, ratio, required ratio, informational APCA Lc, and the nearest colour variable or style that would pass. Optional: write JSON + Markdown reports to outputDir, and annotate failing layers in Figma (annotate: true changes the file; re-running replaces its own annotations). Cost: one scan, plus one export per containing layer that needs sampling (capped by maxExports).
- **lint_design_system** — Lint a frame against the file's design system. Rules: unbound-color (solid fill/stroke with no variable or style; suggests the matching local colour variable in the layer's mode, respecting variable scopes, or paint style — exact first, else nearest by CIEDE2000 within maxDeltaE), unbound-spacing and unbound-radius (auto-layout gap/padding and corner radius not bound to a number variable; suggests one), text-without-style (suggests the nearest text style in the same family), detached-instance, off-scale-spacing / off-scale-radius (against spacingScale/radiusScale, or a scale inferred from the file's number variables), default-name, hidden-layer, empty-frame. Returns issues with node, path, property, value, suggestion and whether fix_design_system can apply it, plus counts per rule and a 0-100 score. Read-only; one scan of the frame.
- **fix_design_system** — Apply lint_design_system's suggestions: bind solid fills/strokes to matching colour variables (or a paint style when the layer has one paint), bind auto-layout spacing/padding and corner radius to number variables with exactly the same value, and give unstyled text a text style whose font, size, line height and letter spacing match. Only binds when the variable resolves, in that layer's mode, to the same value (colours within maxDeltaE, default 2); re-checks each layer before changing it and reverts if Figma changed the result. dryRun defaults to true and returns the plan without changing anything; dryRun: false applies it and returns what changed and what was skipped and why. Changes the file when applied (design editor only).
- **health** — Diagnose the bridge: server version and role, connected files, and a live test export from the plugin. Use it when calls time out: it tells a dead plugin apart from one node that will not export.
- **get_pages** — List the file's pages and which one Figma currently shows. When multiple files are connected, specify fileKey.
- **navigate_to_page** — Switch Figma to a page by pageId or exact pageName. Reads and exports work across pages without this; use it to change what get_document and get_selection see.
- **get_nodes** — Fetch several nodes in one call. Each result carries its tree (optionally depth-limited), absolute bounds, auto-layout sizing, instance component properties and mixed-text segments. A node that fails is reported in place instead of failing the call. includeHidden keeps layers the design turns off.
- **scan_nodes** — Search a node's subtree and return a flat list of matches: id, name, type, visibility, layer path, absolute bounds, bounds relative to the root, text and font for TEXT, component name for INSTANCE. Filter by types, namePattern, textPattern, size, maxDepth; stopAtMatch keeps an icon instance whole. Hidden layers are skipped unless visibleOnly is false.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "layerbridge": {
    "command": "npx",
    "args": ["-y","layerbridge@latest"],
    "env": {
      "FIGMA_BRIDGE_PLAYWRIGHT": ""
    }
  }
}
```

**Requires environment variables:** `FIGMA_BRIDGE_PLAYWRIGHT` — the values above are empty placeholders; fill in real credentials before running (see the repository for what each one is for).

## Documentation

## What Layerbridge MCP server does

Layerbridge MCP server gives MCP-compatible AI tools access to the Figma document open in a local Layerbridge plugin. It can inspect pages, selections, nodes, styles, variables, components, fonts, annotations, and design metadata, then create or modify many of the same objects through the Figma Plugin API. The repository describes support for Figma design files, FigJam boards, and Slides decks.

Its design-to-code features include compact layout and style context, starter JSX with Tailwind, and HTML with CSS. Token workflows can export variables as W3C JSON or CSS and import DTCG JSON, CSS custom properties, or Tailwind v4 `@theme` definitions. Other workflows compare a design with a built-page screenshot or turn a locally running page into editable Figma layers.

## How it works

The AI client starts a Node-based MCP server through stdio. That process listens on `127.0.0.1:1995` and communicates with the Layerbridge Figma plugin over WebSocket. The plugin can access only the file in which it is running, and that file must remain open while requests are being handled. The server itself listens only on the local machine.

The server includes prompts for implementing designs, auditing designs, building in Figma, synchronizing tokens, and troubleshooting. Claude Code also receives skills for these workflows and asset export when installed through the repository’s plugin setup.

## Setup and configuration

Node 20 or newer and the Figma desktop application are required. Add the MCP server to the selected client with the client’s setup command or the documented `npx -y layerbridge@latest` configuration. The repository provides setup paths for Claude Code, Claude Desktop, Cursor, VS Code, Windsurf, and Codex.

Run the setup command to print the plugin manifest path, then import that manifest in Figma through Plugins → Development → Import plugin from manifest. FigJam and Slides require the additional manifest printed by setup because Figma does not run one plugin in both Dev Mode and FigJam. After installation, restart the AI client. For each session, open the target file, launch Layerbridge from Figma’s development plugins, and keep its panel open or collapsed.

`npx -y layerbridge@latest doctor` checks Node, the local port, the access token, connected files, and the installed plugin. URL-based comparison and import require Playwright plus Chromium, unless `FIGMA_BRIDGE_PLAYWRIGHT` points to an existing installation. JPEG screenshots also require `jpeg-js`.

## Tools and capabilities

Layerbridge MCP server groups its tools around several development tasks:

- Read document structure, selections, nodes, styles, variables, fonts, viewport state, and metadata.
- Create and edit frames, text, shapes, images, sections, components, styles, variables, pages, reactions, annotations, and dev resources.
- Run accessibility checks for WCAG contrast, target size, and very small text, including backgrounds involving images and gradients.
- Lint design-system usage and apply supported safe fixes, with dry-run behavior for bulk changes.
- Export screenshots, assets, PDFs, image fills, and design tokens; bulk asset exports deduplicate files and write a manifest.
- Generate code context, compare a layer with a built screenshot, and import a local page as Figma layers.
- Work with FigJam boards and Slides, including sticky notes, connectors, diagrams, slides, ordering, deletion, and transitions.

Optional REST tools cover comments, version history, team projects, project files, and rendering files that are not open in the plugin.

## Limitations and notes

The plugin cannot access closed files, and the local server does not provide remote access. Figma desktop is the documented requirement and is recommended. Destructive operations such as deleting pages, slides, styles, or variables require `confirm: true`; bulk design-system fixes and token imports preview their changes unless `dryRun: false` is supplied. Layerbridge is not affiliated with, endorsed, or sponsored by Figma, Inc.

_Full upstream README: https://allmcps.com/mcp/layerbridge/readme_

