figmcp
A local Figma MCP server that turns the file open in Figma Desktop into code, and lets your agent design in Figma — no REST API, tokens or rate limits.
Design to code:
get_design_contextreturns reference Flutter, SwiftUI, HTML + Tailwind or React + Tailwind code, assets, a screenshot and variables for a node (or the current selection).Inspect structure:
get_metadatagives the layer tree as XML (ids, types, names, positions, sizes).Screenshots:
get_screenshotrenders a node or selection to PNG with size caps and optional inline base64.Design tokens:
get_variable_defsresolves variables and styles used by a node for its mode.Assets:
download_assetsexports renders, original image fills and vector SVGs.Design in Figma:
use_figmaruns Figma plugin API scripts to create and edit frames (one undo step per script);search_design_systemfinds components, styles and variables to reuse;place_imagedrops local PNG/JPG/GIF/SVG into the file.Verify output:
verify_coderenders Flutter (flutter test), SwiftUI or React/HTML in headless Chrome and compares it with Figma's render — errors, layout mismatches, pixel diffs and a diff image.Code Connect:
get_code_connect_map,add_code_connect_map,remove_code_connect_mapmap design components to your own code components.Offline snapshots:
save_design_exportwrites a full JSON export;import_design_exportloads one as a snapshot readable without the plugin.Status:
whoamireports plugin connection, pairing code, open file, selection, project and saved snapshots.
Enables reading and writing Figma design files via a local Figma Desktop plugin, including design context extraction, screenshots, asset downloads, design creation/editing, and Code Connect mappings.
figmcp is a local MCP server that gives your coding agent the Figma file you have open in Figma Desktop. A development plugin streams the file to a server on your machine over localhost, so reads never touch the Figma REST API: no access token, no quota, no rate limit.
Design to code. Flutter widgets for Flutter projects, SwiftUI views for Swift packages and Xcode projects, HTML + Tailwind for static sites, React + Tailwind for everything else, with the assets and a screenshot to compare against.
Design in Figma. The agent creates and edits frames in the open file with Figma plugin API scripts, one undo step per script.
Your components. Map design components to code components with Code Connect.
Works offline. Read saved snapshots when the plugin is closed.
Any plan. Works on every Figma plan, including the free Starter plan. No Dev Mode seat needed.
Works with Claude Code, Cursor, Claude Desktop and any MCP client that runs stdio servers.
Quick start
Needs Node.js 18+ and Figma Desktop on macOS or Windows.
1. Run setup
npx -y @irshad.io/figma-local-mcp@latest setupIt registers the server with Claude Code, copies the Figma plugin to your home folder, and prints your pairing code and the config for other MCP clients.
2. Import the plugin (once)
In Figma Desktop, go to Plugins › Development › Import plugin from manifest… and choose:
macOS | Windows |
|
|
On macOS, press ⌘ ⇧ G in the file picker and paste the path. On Windows, paste it into the File name box.
3. Pair and ask
Restart your coding agent. In Figma Desktop, run Plugins › Development › figmcp and enter the pairing code. The dot turns green once it's connected. Then select a frame and ask:
implement the selected Figma frameKeep the plugin window open while you work. Full guide: figmcp.web.app/docs/installation.
Related MCP server: Figma Bridge MCP
Usage
Design to code
Select a frame, or paste a Figma link that has a node-id:
implement this frame as a Flutter screen and match the spacing exactly
build this frame as a React component with Tailwind, using our existing Button
compare your screen with the Figma screenshot and fix the differencesProjects with a pubspec.yaml get Flutter widgets, and SVGs and images are saved into the asset folders the pubspec declares. Projects with a Package.swift, .xcodeproj or .xcworkspace get SwiftUI views built as a production screen would be (Buttons, selection state with a sliding indicator, snapping carousels, grids, pinned bars, Dynamic Type), with image sets for the asset catalog and a Structure block naming what each part is. Static sites get HTML + Tailwind, and everything else gets React + Tailwind. React output uses the real font families, declares the design's variables as CSS (with a Tailwind 4 @theme), writes repeated items as data with .map() and names reused text styles, names assets after their layers with copy commands for public/figma, turns prototype taps, layer names and placeholders into buttons, links, landmarks and inputs, draws phone frames as screens that fill the viewport and desktop frames as pages whose full-width sections stretch. Its classes work in Tailwind 3.4 and 4. The code is a reference that your agent adapts to your project. More →
Design in Figma
Open the file in Figma Desktop, run the plugin and ask:
design a settings screen for a 390x844 phone in Figma
add a dark mode version of the selected frame next to itThe agent builds the design with use_figma and checks each step with a screenshot. Each script is one undo step. More →
Code Connect
map the selected button to AppButton in lib/widgets/app_button.dart
which components in this frame are not mapped yet?Mapped instances come back as your own components. Mappings are saved in .figma-local/code-connect.json in your project. More →
MCP clients
Claude Code is registered by setup. Restart it and check with /mcp.
Cursor, Claude Desktop and other clients: add the config that setup prints. It looks like this, with paths for your machine:
{
"mcpServers": {
"figma-local": {
"command": "/usr/local/bin/node",
"args": ["/Users/you/.figma-local-mcp/app/node_modules/@irshad.io/figma-local-mcp/bin/figma-local-mcp.js"]
}
}
}Client | Config file |
Cursor |
|
Claude Desktop (macOS) |
|
Claude Desktop (Windows) |
|
Step-by-step for each client, on macOS and Windows: figmcp.web.app/docs/configuration.
Tools
Tool | What it does |
| Reference code (Flutter, SwiftUI, React + Tailwind or HTML + Tailwind), assets, a screenshot and variables for a node. The main tool. |
| Layer tree as XML: ids, types, names, positions and sizes. |
| PNG of a node or the selection. |
| Variables and styles used by a node, resolved for its mode. |
| Exported renders, original image fills and vector SVGs. |
| Render Flutter code with |
| Run Figma plugin API scripts to create and edit designs. |
| Components (with properties and variants), styles and variables of the open file, to reuse while designing. |
| Put a local PNG, JPG, GIF or SVG into the open file, as a new layer or a layer's fill. |
| Which instances map to which code components. |
| Map a design component to a code component. |
| Remove a component mapping. |
| Connection status, pairing code, open file, selection and snapshots. |
| Write a full design export of a node to JSON. |
| Load an export JSON as a snapshot. |
Arguments for each tool: figmcp.web.app/docs/tools.
How it works
Figma Desktop ── WebSocket 127.0.0.1:3947 ──▶ figma-local-mcp ── MCP stdio ──▶ Coding agent
(dev plugin) paired with your code (node server) (Claude Code, Cursor, …)The plugin reads the open file with the Figma plugin API and runs the scripts your agent sends. The server turns that into code, assets, screenshots and metadata. When the plugin is closed, reads fall back to the newest saved snapshot. More →
Configuration
Set these in the env of your MCP client config.
Variable | Default | Description |
|
| Data folder: plugin, pairing code, snapshots and assets. |
| Force | |
|
| Path of the Code Connect mappings file. |
| Comma separated extra origins the server accepts for the plugin. |
Update
npx -y @irshad.io/figma-local-mcp@latest setupThen restart your coding agent and run the plugin again. The plugin updates itself, so there's no need to import it again.
Troubleshooting
The dot stays grey: start your coding agent first, then run the plugin again.
Lost the pairing code: run setup again, or ask your agent to run
whoami.use_figmacan't edit the file: switch the file from Dev Mode back to Design mode.
More fixes: figmcp.web.app/docs/troubleshooting. Still stuck? Open an issue with the output of whoami.
Development
npm install
npm testPath | What |
| The MCP server, plugin bridge and code generators |
| The Figma development plugin |
| Visual and Flutter checks for generated code |
| Tests ( |
| The website and docs (figmcp.web.app), Next.js on Firebase Hosting |
To work on the site: cd web && npm install && npm run dev. To publish it: npm run deploy.
License
Figma is a trademark of Figma, Inc. This project is not affiliated with Figma, Inc.
Available Tools
15 toolsadd_code_connect_mapAdd Code Connect MappingAIdempotent
Map a design component to a code component, so get_design_context names the code component for every instance of it. Pass an instance, component or component set id; a component in a set maps the whole set.
Inputs: nodeId (required), source (required), componentName (required), label, +1 more.
download_assetsDownload AssetsARead-only
Download assets for a single node: an exported render (export), the original images used as fills (rawImages, up to 20) and SVGs of the vector layers (svgAssets, up to 20). defaultFormat and defaultScale set the export format (png, jpg, svg, pdf) and scale (default png at 1).
Inputs: nodeId, fileKey, defaultScale, defaultFormat.
get_code_connect_mapGet Code Connect MappingARead-only
Get the mapping from the component instances in a node to code components: { nodeId: { codeConnectName, codeConnectSrc, label } }, plus the components that are not mapped yet. Mappings live in the project (.figma-local/code-connect.json under the working directory).
Inputs: nodeId, fileKey.
get_design_contextGet Design ContextARead-only
Get design context for a Figma node — the primary tool for design-to-code workflows. Returns reference code (Flutter widgets for Flutter projects, SwiftUI views for Swift packages and Xcode projects, HTML + Tailwind for static sites, React + Tailwind otherwise), the assets it uses, a screenshot and the variables in the node. SwiftUI code comes with a Structure block naming what each part is (tab bar, segmented control, chips, carousel, grid, buttons, fields) and the pattern used for it. The code must be adapted to the target project. Use the nodeId parameter to specify a node id; from a URL like https://figma.com/design/:fileKey/:fileName?node-id=1-2 the node id is 1:2. With no nodeId the current selection in Figma is used. Large nodes return metadata instead of code unless forceCode is set.
Inputs: page, nodeId, screen, fileKey, +10 more.
get_metadataGet MetadataARead-only
IMPORTANT: Always prefer to use get_design_context. Get metadata for a node or page in XML format: node IDs, layer types, names, positions and sizes, useful for an overview of the structure. nodeId can be a page id (e.g. 0:1). When nodeId is omitted, returns the pages of the document (and saved snapshots) instead. When something is selected in Figma, the response starts with a "Currently selected nodes:" block.
Inputs: nodeId, fileKey.
get_screenshotGet ScreenshotARead-only
Generate a screenshot for a given node or the currently selected node in Figma. maxDimension (default 1024) caps the longer edge of the PNG (up to 2x the node size). The response gives a local URL and file path plus width/height and original_width/original_height. Set enableBase64Response to also get the image inline.
Inputs: nodeId, fileKey, contentsOnly, maxDimension, +1 more.
get_variable_defsGet Variable DefinitionsARead-only
Get variable definitions for a given node id. E.g. {'icon/default/secondary': #949494}. Variables and styles are reusable values applied to colours, fonts, sizes and spacings. Values resolve for the node's own mode. Read-only; with no nodeId it uses the selection. Use it for design tokens, and get_design_context for the layout. Without the plugin, a saved snapshot gives the raw values only, without names.
Inputs: nodeId, fileKey.
import_design_exportImport Design ExportAIdempotent
Save a design export JSON (frames with node trees, as the plugin produces) as a snapshot, so its nodes can be read without the plugin. Use it for an export made earlier with save_design_export or the plugin. Copies the file into the local snapshot store, replacing an earlier snapshot of the same frames; the source file and the Figma file are not changed. Fails if the JSON is not a design export.
Inputs: path (required).
place_imagePlace ImageA
Put an image file from this computer into the file open in Figma Desktop: a PNG, JPG or GIF becomes a rectangle with the image fill (or the fill of the layer nodeId), and an SVG becomes editable vector layers. Use it for the project's own assets (logos, icons, photos) while designing; use_figma with figma.createImageAsync(url) takes images from the web. The new layer goes into parentId (default: the current page, right of its content), sized by width/height (one keeps the aspect ratio; default: the image's own size). Images larger than 4096 px on a side are scaled down by Figma.
Inputs: path (required), x, y, name, +7 more.
remove_code_connect_mapRemove Code Connect MappingADestructiveIdempotent
Remove the code component mapping saved by add_code_connect_map, so get_design_context stops naming that code component. Pass an instance, component or component set id. Only the local mapping file changes, never the design; returns how many mappings were removed (0 when none existed). Add it again with add_code_connect_map to undo.
Inputs: nodeId (required), fileKey.
save_design_exportSave Design ExportAIdempotent
Write a full design export of a node (default: the selection) to a JSON file: the node tree with every layout, paint, text, variable, style, component and interaction detail, icon SVGs, renders of masked or rotated groups, image fills and a 2x preview. Mapped components carry their code component. Use it to hand a frame to a build script.
Inputs: path, nodeId, fileKey.
search_design_systemSearch Design SystemARead-only
Search the design system of the file open in Figma Desktop: local components and component sets (with their properties and variant options), library components the file already uses (with an instance to copy), and local paint, text and effect styles and variables (with their default-mode values). Every word of query must appear in the name or description; leave it empty to list everything. Call it before designing with use_figma, and reuse what it finds: figma.getNodeByIdAsync(id) then component.createInstance(), instance.clone() for a library component, figma.getStyleByIdAsync and figma.variables.getVariableByIdAsync. Libraries the file does not use yet are not visible to the plugin; instancesNotScanned means the page was too large to look through all its instances. Needs the plugin and Design mode.
Inputs: kinds, limit, query, fileKey, +1 more.
use_figmaEdit DesignADestructive
Create or edit designs in the file open in Figma Desktop by running JavaScript against the Figma plugin API. code is the body of an async function with figma in scope: use await, and return a value (nodes come back as {id, name, type, x, y, width, height}); console.log output is returned too. The whole run is one undo step. If the script throws, the changes it made before the error stay.
Rules of the plugin API here:
The file uses dynamic page loading: use figma.getNodeByIdAsync, figma.setCurrentPageAsync, await page.loadAsync() before reading another page, getMainComponentAsync, and the *Async style/variable getters.
Load every font before setting text or text properties: await figma.loadFontAsync({ family: "Inter", style: "Regular" }). Check figma.listAvailableFontsAsync() when unsure a font exists.
Colours are 0-1 RGB: fills = [{ type: "SOLID", color: { r: 1, g: 0.4, b: 0 } }]. Paint arrays are immutable: assign a new array.
Prefer auto layout: layoutMode, itemSpacing, padding*, primaryAxisAlignItems, counterAxisAlignItems; set layoutSizingHorizontal/Vertical ("FILL", "HUG", "FIXED") only after the node is appended to an auto-layout parent.
New nodes land on the current page: place top-level frames clear of existing ones, and append children with parent.appendChild(node).
Reuse what the file has: find its components, styles and variables with search_design_system first, and set bound variables with figma.variables.setBoundVariableForPaint.
Images from the web: const img = await figma.createImageAsync(url), then fills = [{ type: "IMAGE", imageHash: img.hash, scaleMode: "FILL" }]. fetch(url) works too (e.g. an SVG for figma.createNodeFromSvg). Local files go in with place_image.
figma.currentPage.selection = [node] and figma.viewport.scrollAndZoomIntoView([node]) show the result.
Build a screen in a few calls (structure, then sections), return the ids, and check each step with get_screenshot.
Inputs: code (required), fileKey, timeoutMs.
verify_codeVerify CodeAIdempotent
Check Flutter, SwiftUI or React + Tailwind code against the design and compare the render with Figma's own 2x render of the node: Flutter code is analyzed and rendered with flutter test; SwiftUI code is compiled and rendered in the booted iOS simulator (Xcode needed); React and HTML render in headless Chrome with Tailwind. Returns compiler or analyzer errors, runtime errors (Flutter: overflows, missing assets; React: broken images), the share of differing pixels and a diff image (the design in grey, differing pixels in red). The framework comes from framework, else from the file's language, else from the client and the project like get_design_context.
React and HTML: without file it checks the code get_design_context generates and compares every layer's box too. With file (a .jsx or .tsx under a folder with package.json, or an .html page) it renders that file's default export or page: it must be self-contained apart from React and image imports; images load from the project's public folder. Pass css for the stylesheet with its tokens. React and Tailwind load from a CDN and the fonts from the system or Google Fonts. Needs Chrome and the puppeteer-core package.
Flutter and SwiftUI: with file, it checks that widget or view inside its own project: a Flutter widget with the project's packages and assets, inside a MaterialApp, scaled by flutter_screenutil to the frame size when the project uses it; a SwiftUI view compiled with the project's DesignSystem.swift and asset catalogs, so it must build without the rest of the project. The widget or view needs an init without arguments. Without file, it checks the reference code get_design_context generates and compares every layer's box with the design. Use it after implementing a frame, and fix what it reports. Text in fonts it cannot find is drawn in a fallback font, and emoji have no colour font in the Flutter test, so text after them shifts. The design's status bar and home indicator belong to the phone and are left out of the SwiftUI comparison. A run takes from 20 seconds to a few minutes.
Every result has a coverage block: what the run checked, and for each interactive element (from its role and the states its Figma component defines) the states, keyboard and screen-reader behaviour it did not check, plus screen-wide items (dark mode, other widths and text sizes, right-to-left). React and HTML runs also press Tab through the page: the Tab order, missing focus indicators, controls Enter or Space does not activate, missing accessible names and clickable elements the keyboard cannot reach. Hand the not-checked list back with the implementation.
Inputs: css, file, fonts, device, +11 more.
whoamiConnection StatusARead-only
Status of the local Figma connection: whether the plugin is connected, the pairing code it needs, the open file, page and selection, the project and its Code Connect file, and the saved snapshots. Use it when a read fails.
Inputs: no named parameters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 15 tools
Most tools have clearly distinct purposes (mapping CRUD, snapshot import/export, image insertion, JS execution, verification). A few overlaps remain: get_screenshot vs download_assets both produce renders, get_metadata is explicitly subordinate to get_design_context, and get_variable_defs overlaps with search_design_system's variable/style output — though descriptions do steer the agent. Nothing is truly indistinguishable.
Nearly every tool is a verb_noun snake_case name (get_design_context, save_design_export, add_code_connect_map, search_design_system), with the code-connect trio forming a clean get/add/remove group. The only deviation is the bare `whoami`, which is a conventional identity verb but breaks the pattern.
15 tools sits right at the top of the well-scoped range and each one earns its place across the read → design → implement → verify workflow. The code-connect sub-group and the export/snapshot pair justify their multiple entries rather than feeling redundant.
The surface covers the full design-to-code loop: context/metadata/screenshot reads, variable and design-system discovery, asset export, code-connect mapping CRUD, snapshot import/export, image placement, JS-based editing and render verification. Gaps are minor — no dedicated tool for listing/opening files or deleting snapshots, and any missing design-write operations must go through the generic use_figma escape hatch.
Maintenance
Related MCP Connectors
The Figma MCP server brings Figma design context directly into your AI workflow.
A coding agent searches the Icons8 library by keyword and style, then adds the selected icon or illustration to the project. Icons8 draws all of it: 420,000+ icons (130+ styles) and 110,000+ illustrations (340+ styles), so one project doesn't end up with mixed looks. The server lives at https://mcp.icons8.com/mcp/ and signs people in through their Icons8 account in the browser. Downloading PNG is free as long as the project links back to Icons8. SVG is on the paid plan, and that plan makes the link optional.
Serves your design system and coding standards to coding agents, so they stop guessing.
MCP server for secureFlows: token-free URL builders and integration-linting tools for AI agents.
Related MCP Servers
- AlicenseAqualityDmaintenanceLocal-first MCP server that connects AI coding agents to the currently open Figma file through a local plugin bridge, requiring no Figma API token.8MIT
- FlicenseBqualityCmaintenanceLocal MCP server connecting AI clients to the Figma desktop app for inspecting and editing Figma documents via the Plugin API.161-
- AlicenseAqualityDmaintenanceFigma MCP server that lets agents execute arbitrary JavaScript inside a running Figma desktop app via a local development plugin, enabling real-time document inspection and manipulation while avoiding REST API rate limits.3MIT
- AlicenseNot gradedqualityBmaintenanceLocal MCP server exposing Figma REST API tools to AI agents, enabling file reads, comments, variables, and other resource operations. Works with personal access tokens and integrates with Claude, Cursor, Codex, and more.MIT