OpenCode Figma MCP
Connect AI coding agents (OpenCode/Claude Code) to Figma via MCP to inspect designs, generate code-oriented specs/assets, and create or edit Figma content.
Read documents, selections, nodes, pages, styles, components, variables, annotations, and code-oriented design context.
Export/download SVG, PNG, JPG, and PDF assets; read designs from Figma URLs via REST API.
Create and edit frames, shapes, text, SVG vectors, sections, image fills, strokes, effects, auto-layout, constraints, and layout grids.
Manage components, instances, variants, overrides, component properties, text/paint/effect/grid styles, and variables with modes/bindings.
Work with annotations, Dev Mode measurements/dev resources, prototype interactions, flows, scrolling/overlays, and FigJam elements/connectors.
Move, group, reorder, clone, resize, rename, delete nodes; export node images; save versions.
Access comments, file versions, team libraries/projects/files, and file dev resources through the Figma REST API.
Join channels and use MCP resources/prompts for design-to-code, text replacement, annotations, and prototype workflows.
Some features require FIGMA_ACCESS_TOKEN, an open/connected Figma plugin, and/or a paid Figma plan.
Reads Figma designs (frames, components, Figma URLs) as compact, code-oriented specs including layout, auto-layout, typography, colors, effects, variables, and component props, exports assets (SVG/PNG/JPG/PDF), and creates/edits Figma content such as frames, shapes, text, auto-layout, components, instances, variables, annotations, and prototype connections. Works live through a Figma plugin over a local WebSocket relay or via the Figma REST API with an access token.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@OpenCode Figma MCP read this Figma frame and generate the React code for it"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
OpenCode Figma MCP
OpenCode Figma MCP is a Model Context Protocol (MCP) server that connects AI coding agents — OpenCode and Claude Code — to Figma. It works in both directions:
Design → Code: read a frame, component, or a Figma URL and get a compact, code-oriented spec (layout, auto-layout, typography, colors, effects, variables, component props) plus downloadable SVG/PNG assets, so the agent can generate UI code that matches the design.
Code → Design: create and edit Figma content from the agent — frames, shapes, text, auto-layout, components, instances, variables, annotations, prototypes, and more (159 tools).
OpenCode / Claude Code ←(stdio)→ MCP Server ←(WebSocket)→ Relay (localhost:3055) ←(WebSocket)→ Figma PluginHighlights
Two ways to read designs: live from the open Figma file via the plugin (
get_design_context), or straight from a Figma link via the REST API (get_figma_design_from_url, needsFIGMA_ACCESS_TOKEN) — no plugin required.Asset export:
download_design_assetssaves icons and images (SVG/PNG/JPG/PDF) directly into your project.Full editing toolkit: batch text replacement, instance override propagation, auto-layout sizing, components & variants, variables, image fills, sections, and prototype connections.
Local & private: the WebSocket relay binds to localhost and the plugin talks only to your machine.
One-command setup:
bun setupbuilds the server and writes MCP config for OpenCode (opencode.json) and Claude Code (.mcp.json).
Project Structure
src/opencode_figma_mcp/- TypeScript MCP server for Figma integrationsrc/opencode_mcp_plugin/- Figma plugin for communicating with OpenCodesrc/socket.ts- WebSocket server that facilitates communication between the MCP server and Figma plugin
Related MCP server: Agent to Figma MCP
Quick start with npm
No clone needed for the MCP server and relay — only Node.js 18+.
Start the WebSocket relay (keep it running):
npx -y -p opencode-figma-mcp opencode-figma-relayAdd the MCP server to OpenCode (
opencode.json):
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"opencode-figma": {
"type": "local",
"command": ["npx", "-y", "opencode-figma-mcp@latest"],
"enabled": true,
"environment": {
"FIGMA_ACCESS_TOKEN": "{env:FIGMA_ACCESS_TOKEN}"
}
}
}
}Or for Claude Code:
claude mcp add opencode-figma -e FIGMA_ACCESS_TOKEN=<token> -- npx -y opencode-figma-mcp@latestTo install straight from GitHub instead of npm, replace opencode-figma-mcp@latest with github:yhoyoex/opencode-figma-mcp (the package is built on install). The relay works the same way: npx -y -p github:yhoyoex/opencode-figma-mcp opencode-figma-relay.
Install the Figma plugin: download or clone this repository and import
src/opencode_mcp_plugin/manifest.jsonin Figma (see Figma Plugin).
How to use (from source)
Install Bun if you haven't already:
curl -fsSL https://bun.sh/install | bashRun setup, this will build the server and write MCP config for OpenCode (
opencode.json) and Claude Code (.mcp.json)
bun setupStart the Websocket server
bun socketInstall the Figma plugin locally
Design Automation Example
Bulk text content replacement
Thanks to @dusskapark for contributing the bulk text replacement feature. Here is the demo video.
Instance Override Propagation Another contribution from @dusskapark Propagate component instance overrides from a source instance to multiple target instances with a single command. This feature dramatically reduces repetitive design work when working with component instances that need similar customizations. Check out our demo video.
Manual Setup and Installation
MCP Server: Integration with OpenCode
Build the server (bun run build), then add it to your OpenCode config (opencode.json in the project or ~/.config/opencode/opencode.json):
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"opencode-figma": {
"type": "local",
"command": ["bun", "/path/to/figma-mcp/dist/server.js"],
"enabled": true,
"environment": {
"FIGMA_ACCESS_TOKEN": "{env:FIGMA_ACCESS_TOKEN}"
}
}
}
}WebSocket Server
Start the WebSocket server:
bun socketFigma Plugin
In Figma, go to Plugins > Development > New Plugin
Choose "Link existing plugin"
Select the
src/opencode_mcp_plugin/manifest.jsonfileThe plugin should now be available in your Figma development plugins
Dev Mode plugin (measurements)
add_measurement, edit_measurement and delete_measurement only work in Dev Mode. Figma does not allow dev and figjam in one manifest, so a separate Dev Mode build is generated:
Run
bun run build:plugin-dev(writesdist/opencode_mcp_plugin_dev/)In Figma desktop, open a file in Dev Mode (Shift+D)
Plugins > Development > Import plugin from manifest > select
dist/opencode_mcp_plugin_dev/manifest.jsonRun it from the Plugins panel in Inspect and join a channel
Notes: Dev Mode needs a Full or Dev seat (paid plan). The Dev Mode plugin variant has not been tested in Figma yet. Other write tools (create, modify, delete nodes) do not work in Dev Mode; use the main plugin for those.
Plan limitations
Some tools only work on a paid Figma plan. Found by a smoke test on a Free account:
Tool | Required plan | Behaviour on Free |
| Paid plan, Full or Dev seat (Dev Mode) | Not available outside Dev Mode; |
| Paid plan | Error |
| Enterprise | Error |
| Probably paid plan/seat (not confirmed) | 403 error |
Windows + WSL Guide
Install bun via powershell
powershell -c "irm bun.sh/install.ps1|iex"Start the websocket, listening on all interfaces so WSL can reach it
HOST=0.0.0.0 bun socketSet RELAY_DEBUG=1 untuk mencetak payload lengkap ke log relay (default mati).
Usage
Start the WebSocket server
Install the MCP server in OpenCode
Open Figma and run the OpenCode Figma MCP plugin
Connect the plugin to the WebSocket server by joining a channel using
join_channelUse OpenCode to communicate with Figma using the MCP tools
Local Development Setup
To develop, update your mcp config to direct to your local directory.
{
"mcpServers": {
"opencode-figma": {
"command": "bun",
"args": ["/path-to-repo/src/opencode_figma_mcp/server.ts"]
}
}
}MCP Tools
The MCP server provides the following tools for interacting with Figma:
Design to Code
Read a design as a compact, code-oriented spec (CSS-like layout, shared style references, text, components, design tokens, assets) so OpenCode can generate UI code from it.
get_design_context- Read the current selection (or given node IDs) through the plugin. No token needed; Figma and the plugin must be open.get_figma_design_from_url- Read a design from a Figma link through the REST API, without the plugin. Withoutnode-idit returns the page/frame outline. RequiresFIGMA_ACCESS_TOKEN.download_design_assets- Save icons (SVG), illustrations and image fills to a local folder, via the plugin or the REST API.
To use the REST API tools, create a personal access token in Figma (Settings → Security → Personal access tokens, scope file_content:read) and export it before starting OpenCode:
export FIGMA_ACCESS_TOKEN=figd_...The opencode.json written by bun setup passes it to the server with "environment": { "FIGMA_ACCESS_TOKEN": "{env:FIGMA_ACCESS_TOKEN}" }. FIGMA_API_KEY and FIGMA_TOKEN are also accepted.
Example prompt in OpenCode: "Buat komponen React untuk https://www.figma.com/design/AbC123/App?node-id=12-345, simpan ikon ke src/assets/icons."
Document & Selection
get_document_info- Get information about the current Figma documentget_selection- Get information about the current selectionread_my_design- Get detailed node information about the current selection without parametersget_node_info- Get detailed information about a specific node (detail: "full"adds visibility/opacity, constraints, effects, style ids, bound variables, component properties, auto-layout & sizing fields and stroke details)get_nodes_info- Get detailed information about multiple nodes by providing an array of node IDs (also supportsdetail: "full")set_focus- Set focus on a specific node by selecting it and scrolling viewport to itget_viewport- Get the current page's viewport: center, zoom (1 = 100%) and visible boundsset_viewport- Move and/or zoom the viewport of the current page (to fit nodes useset_focusorset_selections)set_selections- Set selection to multiple nodes and scroll viewport to show them
Annotations
get_annotations- Get all annotations in the current document or specific nodeset_annotation- Create or update an annotation with markdown supportget_annotation_categories- List the annotation categories in the file (id, label, color, isPreset); use the id ascategoryIdinset_annotationcreate_annotation_category- Create an annotation categoryget_measurements- List Dev Mode measurements on the current page, optionally only those touching a nodeadd_measurement- Add a measurement between two nodes on the current page (Dev Mode only, paid plan)edit_measurement- Change a measurement's offset and/or label text (Dev Mode only, paid plan)delete_measurement- Delete a measurement from the current page (Dev Mode only, paid plan)get_dev_resources- List dev resources (links to code, docs, tickets) attached to a node, including inherited ones (probably paid plan)add_dev_resource- Attach a dev resource link to a node (probably paid plan)edit_dev_resource- Change the URL and/or name of a dev resource on a node (probably paid plan)delete_dev_resource- Remove a dev resource from a node by URL (probably paid plan)set_multiple_annotations- Batch create/update multiple annotations efficientlyscan_nodes_by_types- Scan for nodes with specific types (useful for finding annotation targets)
Prototyping & Connections
get_reactions- Get all prototype reactions from nodes with visual highlight animationset_default_connector- Set a copied FigJam connector as the default connector style for creating connections (must be set before creating connections)create_connections- Create FigJam connector lines between nodes, based on prototype flows or custom mappingadd_interaction- Add a prototype interaction (trigger, action such as NAVIGATE/OVERLAY/SWAP/SCROLL_TO/CHANGE_TO/BACK/CLOSE/URL, transition) to a nodeset_reactions- Replace all reactions of a node with raw Plugin APIReactionobjects (advanced: variables, conditionals, key triggers)remove_interactions- Remove all interactions of a node, or only those with a given trigger typeget_flow_starting_points- List prototype flow starting points of the current pageset_flow_starting_point- Add or rename a flow starting point on a top-level frameremove_flow_starting_point- Remove a frame's flow starting pointset_overlay_settings- Read overlay settings of a frame (read-only in the Plugin API; change requests return an error with the current values)set_scroll_behavior- Set a frame's overflow (scroll) direction and make a child FIXED or SCROLLS (STICKY_SCROLLS unsupported by the Plugin API)set_frame_properties- Set absolute positioning inside auto-layout (layoutPositioning), auto-layout stacking order (itemReverseZIndex), clip content, and x/y
Creating Elements
create_rectangle- Create a new rectangle with position, size, and optional namecreate_frame- Create a new frame with position, size, and optional namecreate_section- Create a section to group related content on the canvascreate_text- Create a new text node with customizable font properties (fontFamily/fontStyle; seeget_available_fonts)create_node_from_svg- Create editable vector nodes from SVG markup (e.g. replace PNG icons with vectors), optionally inside a parent at a given positioncreate_ellipse- Create an ellipse (circle/oval)create_line- Create a linecreate_polygon- Create a polygon with a given number of sidescreate_star- Create a star with a given number of pointscreate_vector- Create a vector node from path datacreate_slice- Create a slice (an export region independent of layers). Add export formats to it withset_export_settings
Modifying text content
scan_text_nodes- Scan text nodes with intelligent chunking for large designsset_text_content- Set the text content of a single text nodeset_multiple_text_contents- Batch update multiple text nodes efficientlyset_text_properties- Set font family/style/size, line height, letter spacing, text case, fill and alignment, optionally for a character range; also hyperlinks (http/https/mailto), list type, indentation, text truncation and max linesget_available_fonts- List fonts available to the Figma plugin (same as the font picker), grouped by family with their style names. Use the exact family/style withcreate_text,set_text_propertiesor text styles
Auto Layout & Spacing
set_layout_mode- Set the layout mode and wrap behavior of a frame (NONE, HORIZONTAL, VERTICAL, GRID with row/column count, gaps, track sizes and auto tracks), pluscounterAxisAlignContentandstrokesIncludedInLayoutset_layout_child- Set how a node behaves inside its auto-layout parent:layoutGrow/layoutAlignfor HORIZONTAL/VERTICAL parents, cell position, spans and cell alignment for GRID parentsset_padding- Set padding values for an auto-layout frame (top, right, bottom, left)set_axis_align- Set primary and counter axis alignment for auto-layout framesset_layout_sizing- Set horizontal and vertical sizing modes (FIXED, HUG, FILL) for frames, components, instances and text; HUG needs auto-layout or text, FILL needs an auto-layout parentset_item_spacing- Set distance between children in an auto-layout frame
Styling
set_fill_color- Set the fill color of a node (RGBA)set_stroke_color- Set the stroke color and weight of a nodeset_corner_radius- Set the corner radius of a node with optional per-corner controlset_image_fill- Fill a node with an image from a local file path, URL, or base64 data (FILL, FIT, CROP, or TILE); optionalimageTransform,scalingFactor,rotationandfiltersset_image_properties- Change scaleMode, crop (imageTransform), tiling scale, rotation or filters of an IMAGE fill already on a node, without re-uploading the imageset_gradient_fill- Fill a node with a linear, radial, angular or diamond gradientset_stroke_properties- Set stroke weight, alignment, dash pattern, caps and joinsset_node_properties- Set opacity, rotation, blend mode, locked, mask, and min/max sizeset_constraints- Set horizontal and vertical constraints of a nodeset_layout_grids- Set layout grids (columns, rows, grid) on a frameset_fills- Replace all fills or strokes of a node with a list of paints (solid, gradient, image); index 0 is the bottom-most paint,paints: []removes allset_export_settings- Replace the export settings stored on a node (the Export panel in Figma);settings: []removes all. To export now useexport_node_as_imageordownload_design_assets
Layout & Organization
move_node- Move a node to a new positionresize_node- Resize a node with new dimensionsdelete_node- Delete a nodedelete_multiple_nodes- Delete multiple nodes at once efficientlyclone_node- Create a copy of an existing node with optional position offsetrename_node- Rename a nodeset_parent- Move a node into a new parent (section, frame or group), preserving its absolute position by defaultgroup_nodes- Group nodesungroup_node- Ungroup a group, keeping its childrenboolean_operation- Combine nodes with UNION, SUBTRACT, INTERSECT or EXCLUDEflatten_nodes- Flatten nodes into a single vectorreorder_node- Change a node's layer order (z-index) within its parentdetach_instance- Detach an instance from its main component into a frame
Components & Styles
get_styles- Get information about local stylesget_style_usage- List the nodes that use a style and in which field (fillStyleId, textStyleId, ...)reorder_style- Move a local style after another local style of the same type and folder (Figma Design only)reorder_style_folder- Move a local style folder after another folder with the same parent (Figma Design only)create_text_style- Create a local text style (font, size, line height, letter spacing, case, decoration)update_text_style- Update an existing local text styleapply_text_style- Apply a text style to one or more text nodes (including text inside instances)set_text_decoration- Set underline, strikethrough or none on text nodes, optionally for a character rangeset_visible- Show or hide nodes, including children inside instances (visibility override)get_main_component- Read the main component / variant of instances directly in the plugin (no REST API)create_paint_style- Create a local paint (color) styleupdate_paint_style- Update the name, description or paints of a paint styleapply_paint_style- Apply a paint style to the fills or strokes of one or more nodesdelete_style- Delete a local text, paint, effect or grid styleset_effects- Set drop/inner shadows and layer/background blur on a node (empty array clears)create_effect_style- Create a local effect style (shadow/blur token)update_effect_style- Update the name, description or effects of an effect styleapply_effect_style- Apply an effect style to one or more nodes (''detaches)create_grid_style- Create a local grid style (layout grid token), e.g.Grid/12 columns, using the same grid format asset_layout_gridsupdate_grid_style- Update the name, description or layout grids of a local grid styleapply_grid_style- Apply a grid style to one or more frames, components or instances (''detaches)import_style_by_key- Import a published library style (paint, text, effect or grid) by its key so it can be applied locallyget_local_components- Get information about local componentscreate_component_instance- Create an instance of a componentget_instance_overrides- Extract override properties from a selected component instanceset_instance_overrides- Apply extracted overrides to target instancescreate_component_from_node- Convert an existing node (e.g. a frame) into a main Componentcombine_as_variants- Combine components namedProp=Value, Prop2=Valueinto a Component Set (variants)add_component_property- Add a TEXT, BOOLEAN or INSTANCE_SWAP property to a component/component set, optionally linked to a child nodeswap_instance- Swap the main component of an instanceedit_component_property- Rename a BOOLEAN, TEXT or INSTANCE_SWAP component property or change its default value, preferred values or description (VARIANT properties not supported)delete_component_property- Delete a BOOLEAN, TEXT or INSTANCE_SWAP property from a component or component setreset_instance_overrides- Reset all overrides on one or more instances back to the main component
Variables
get_local_variables- List local variable collections (with modes) and variables; colors returned as hexcreate_variable_collection- Create a variable collection with named modes (extra modes may require a paid plan)create_variable- Create a COLOR, FLOAT, STRING or BOOLEAN variable, with optional value and scopesset_variable_value- Set a variable value for a mode (literal or alias via{ aliasOf: variableId })delete_variable- Permanently delete a variable (destructive; bound nodes lose the binding)delete_variable_collection- Permanently delete a collection with all its variables and modes (destructive)bind_variable- Bind (or unbind withvariableId: null) a variable to fills/strokes, size, spacing, padding, corner radius, stroke weight, opacity, characters or visibilityupdate_variable- Update variable metadata: name, description, scopes, hiddenFromPublishing and code syntax (WEB/ANDROID/iOS)update_variable_collection- Rename a variable collection or change whether it is hidden from publishingmanage_variable_modes- Add, rename or remove a mode of a variable collection (e.g. Light/Dark); adding a mode needs a paid plan (Free: 1 mode per collection)set_variable_mode- Set the explicit variable mode of a node for a collection (e.g. switch a frame to Dark mode);clear: truemakes it inherit from its parentget_library_variable_collections- List variable collections available from enabled team libraries (requires the plugin'steamlibrarypermission)extend_library_collection- Create an extended variable collection (inherits variables, allows overrides) from a library collection key or a local collection ID (Enterprise plan only)get_library_variables- List variables (key, name, resolvedType) in a team library variable collectionimport_variable_by_key- Import a published library variable by its key so it can be bound locally
Pages
get_pages- List pages of the documentcreate_page- Create a new pageset_current_page- Switch to another pageduplicate_page- Duplicate a page with all its content
Inspection
get_node_css- Get the CSS of a node generated by Figmafind_nodes- Find nodes by name and/or type (allPages: truesearches every page)
FigJam
create_sticky- Create a sticky notecreate_shape_with_text- Create a FigJam shape with textcreate_table- Create a FigJam tablecreate_code_block- Create a code block (FigJam only)create_link_preview- Insert a link preview for a URL (FigJam only)
Plugin Data
set_shared_plugin_data- Store shared plugin data (namespace/key/value) on a nodeget_shared_plugin_data- Read shared plugin data from a node
Export & Advanced
export_node_as_image- Export a node as an image (PNG, JPG, SVG, or PDF) - limited support on image currently returning base64 as textsave_version- Save a named version to the file's version history
Comments, Versions & Team Library (REST API)
These tools use the Figma REST API and require FIGMA_ACCESS_TOKEN (no plugin needed).
get_comments- Read the comments of a Figma file (scopefile_comments:read)post_comment- Post a real comment or reply to a Figma file, visible to every collaborator under the token owner's account (scopefile_comments:write); use only when explicitly askedget_file_versions- List the version history of a Figma file, newest first (paginated)get_team_components- List the published components of a team library (scopeteam_library_content:read); use the key withcreate_component_instanceget_team_styles- List the published styles of a team library (scopeteam_library_content:read); use the key withimport_style_by_keyget_team_projects- List the projects of a team (scopeprojects:read)get_project_files- List the files of a project (scopeprojects:read)get_file_dev_resources- List the dev resources (Dev Mode links) of a file, optionally only for some nodes (scopefile_dev_resources:read)create_file_dev_resources- Attach real dev resources to nodes of a file, visible to every collaborator (scopefile_dev_resources:write); use only when explicitly askeddelete_file_dev_resource- Permanently delete a dev resource from a file (scopefile_dev_resources:write); use only when explicitly asked
Connection Management
join_channel- Join a specific channel to communicate with Figma
MCP Resources
Read-only resources served through the plugin (Figma and the plugin must be connected):
figma://document- Current document and page info (same asget_document_info)figma://selection- Current selection (same asget_selection)figma://styles- Local paint, text, effect and grid styles (same asget_styles)figma://variables- Local variable collections and variables (same asget_local_variables)figma://pages- Pages of the current document (same asget_pages)
MCP Prompts
The MCP server includes several helper prompts to guide you through complex design tasks:
design_to_code- Workflow for turning a Figma design into code (read spec, map tokens, export assets, verify)design_strategy- Best practices for working with Figma designsread_design_strategy- Best practices for reading Figma designstext_replacement_strategy- Systematic approach for replacing text in Figma designsannotation_conversion_strategy- Strategy for converting manual annotations to Figma's native annotationsswap_overrides_instances- Strategy for transferring overrides between component instances in Figmareaction_to_connector_strategy- Strategy for converting Figma prototype reactions to connector lines using the output of 'get_reactions', and guiding the use 'create_connections' in sequence
Development
Building the Figma Plugin
Navigate to the Figma plugin directory:
cd src/opencode_mcp_pluginEdit code.js and ui.html
Type checking, tests & lint
bun run typecheck # MCP server (tsc --noEmit)
bun run typecheck:plugin # Figma plugin code.js against @figma/plugin-typings (tsconfig.plugin.json)
bun test # unit tests (tests/simplify.test.ts, tests/figma_rest.test.ts)
bun run lint # checks plugin code.js (scripts/check-plugin.mjs)The plugin was granted the teamlibrary permission in manifest.json; reload (or re-link) the plugin in Figma after updating.
Best Practices
When working with the Figma MCP:
Always join a channel before sending commands
Get document overview using
get_document_infofirstCheck current selection with
get_selectionbefore modificationsUse appropriate creation tools based on needs:
create_framefor containerscreate_rectanglefor basic shapescreate_textfor text elements
Verify changes using
get_node_infoUse component instances when possible for consistency
Handle errors appropriately as all commands can throw exceptions
For large designs:
Use chunking parameters in
scan_text_nodesMonitor progress through WebSocket updates
Implement appropriate error handling
For text operations:
Use batch operations when possible
Consider structural relationships
Verify changes with targeted exports
For converting legacy annotations:
Scan text nodes to identify numbered markers and descriptions
Use
scan_nodes_by_typesto find UI elements that annotations refer toMatch markers with their target elements using path, name, or proximity
Categorize annotations appropriately with
get_annotationsCreate native annotations with
set_multiple_annotationsin batchesVerify all annotations are properly linked to their targets
Delete legacy annotation nodes after successful conversion
Visualize prototype noodles as FigJam connectors:
Use
get_reactionsto extract prototype flows,set a default connector with
set_default_connector,and generate connector lines with
create_connectionsfor clear visual flow mapping.
Support
If this project helps you, consider buying me a coffee ☕
Credits
This project is based on cursor-talk-to-figma-mcp by Sonny Lazuardi and its contributors. Many thanks to the original authors for the MCP server, WebSocket relay, and Figma plugin that this project builds upon.
License
MIT — see LICENSE. The original copyright notice from the upstream project is retained.
Available Tools
79 toolsadd_component_propertyA
Add a component property (TEXT, BOOLEAN or INSTANCE_SWAP) to a COMPONENT or COMPONENT_SET. Optionally link it to a child node: TEXT controls the node's characters, BOOLEAN its visibility, INSTANCE_SWAP the main component of a nested instance.
Inputs: name (required), type (required), componentId (required), defaultValue (required), +1 more.
add_interactionA
Add a prototype interaction (trigger + action) to a node. NAVIGATE/SWAP/OVERLAY need a top-level frame on the same page as destination, SCROLL_TO a node inside the same top-level frame, CHANGE_TO a variant of the same component set (source must be an instance or inside a variant). Directional transitions (MOVE_IN, MOVE_OUT, PUSH, SLIDE_IN, SLIDE_OUT) require a direction. Appends to existing reactions unless replace is true.
Inputs: nodeId (required), url, action, replace, +6 more.
apply_effect_styleA
Apply an effect style to one or more nodes (frames, components, instances, shapes). Pass styleId '' to detach. Reports per-node success.
Inputs: styleId (required), nodeId, nodeIds.
apply_text_styleB
Apply a text style to one or more TEXT nodes (also works on text inside instances, e.g. 'I;'). Reports per-node success.
Inputs: styleId (required), nodeId, nodeIds.
bind_variableB
Bind a variable to a node property. Fields: fills/strokes (COLOR, bound to the first paint), width, height, itemSpacing, counterAxisSpacing, paddingLeft/Right/Top/Bottom, topLeftRadius/topRightRadius/bottomLeftRadius/bottomRightRadius, strokeWeight, opacity, characters, visible. Shortcuts: "padding" (4 sides), "cornerRadius" (4 corners). Pass variableId null to unbind.
Inputs: field (required), nodeId (required), variableId (required).
clone_nodeC
Clone an existing node in Figma
Inputs: nodeId (required), x, y.
combine_as_variantsA
Combine multiple main Components into a Component Set (variants). Each component name must use the variant format "Prop=Value, Prop2=Value" (e.g. "Type=Primary, Size=Large") so Figma can derive the variant properties. Variants are then laid out in a grid (max 4 columns, 24px gap, 24px padding) and the component set is resized to fit them (skipped if the set uses auto layout).
Inputs: componentIds (required), name, parentId.
create_component_from_nodeB
Convert an existing node (e.g. a frame) into a Figma main Component. The node is replaced in place by the new component.
Inputs: nodeId (required), name.
create_component_instanceA
Create an instance of a component in Figma. For LOCAL components (from get_local_components), use componentId with the id field. For published LIBRARY components, use componentKey with the publishedKey field.
Inputs: x (required), y (required), parentId, componentId, +1 more.
create_connectionsB
Create connections between nodes using the default connector style
Inputs: connections (required).
create_effect_styleA
Create a local effect style (shadow/blur token), e.g. 'Shadow/lg'. Returns the style id for apply_effect_style.
Inputs: name (required), effects (required), description.
create_frameC
Create a new frame in Figma
Inputs: x (required), y (required), width (required), height (required), +16 more.
create_node_from_svgA
Create vector nodes from SVG markup (e.g. to replace raster PNG icons with editable vectors). Figma wraps the result in a FRAME containing the vector paths.
Inputs: svg (required), x, y, name, +1 more.
create_rectangleC
Create a new rectangle in Figma
Inputs: x (required), y (required), width (required), height (required), +2 more.
create_sectionC
Create a section in Figma to group related content on the canvas
Inputs: x (required), y (required), width (required), height (required), +1 more.
create_textC
Create a new text element in Figma
Inputs: x (required), y (required), text (required), name, +4 more.
create_text_styleA
Create a local text style (typography token). Use slashes in the name to group styles, e.g. 'Heading/H1'. Returns the style id for apply_text_style.
Inputs: name (required), fontSize, textCase, fontStyle, +7 more.
create_variableB
Create a variable in a collection and optionally set its value. Use slashes in the name for grouping (e.g. "color/primary"). Colors use RGBA 0-1.
Inputs: name (required), collectionId (required), resolvedType (required), value, +2 more.
create_variable_collectionA
Create a local variable collection. The default mode is renamed to modes[0]; remaining modes are added (multiple modes may require a paid Figma plan).
Inputs: name (required), modes.
delete_multiple_nodesB
Delete multiple nodes from Figma at once
Inputs: nodeIds (required).
delete_nodeC
Delete a node from Figma
Inputs: nodeId (required).
delete_styleA
Delete a local style (text, paint, effect or grid) by ID. Nodes using it keep their current values but are detached.
Inputs: styleId (required).
delete_variableA
DESTRUCTIVE: permanently delete a local variable. Nodes bound to it lose the binding. Cannot be undone through this tool.
Inputs: variableId (required).
delete_variable_collectionA
DESTRUCTIVE: permanently delete a local variable collection together with ALL variables and modes inside it. Nodes bound to those variables lose their bindings. Cannot be undone through this tool.
Inputs: collectionId (required).
download_design_assetsA
Download icons, illustrations and image fills from a Figma design into a local folder so generated code can reference them. Use source 'plugin' for designs read with get_design_context, or 'rest' (with url/fileKey) for designs read with get_figma_design_from_url.
Inputs: items (required), source (required), localPath (required), url, +1 more.
export_node_as_imageC
Export a node as an image from Figma
Inputs: nodeId (required), scale, format.
get_annotationsB
Get all annotations in the current document or specific node
Inputs: nodeId (required), includeCategories.
get_design_contextA
Read a Figma design from the open file through the plugin and return a compact, code-oriented spec (layout, styles, text, components, variables, assets) for generating UI code. Uses the given nodeIds or the current selection. Spec format: each node references shared values in styles by id (layout*, fill*, stroke*, effect*, text*). Layout values are CSS-like (flex, gap, padding, sizing fill/hug/fixed). exportAs: svg marks icons/vectors to export as assets instead of rebuilding them; assets lists icons and image fills to download with download_design_assets. designStyles and variables give design-token names to map onto the project's theme.
Inputs: nodeIds, maxDepth, includeHidden.
get_document_infoA
Get detailed information about the current Figma document
Inputs: no named parameters.
get_figma_design_from_urlA
Read a Figma design through the Figma REST API (no plugin needed, requires FIGMA_ACCESS_TOKEN). Pass a Figma URL (figma.com/design//...?node-id=1-2) or fileKey + nodeId. With a node it returns the code-oriented spec; without a node it returns the file outline (pages and top-level frames) so you can pick one. Spec format: each node references shared values in styles by id (layout*, fill*, stroke*, effect*, text*). Layout values are CSS-like (flex, gap, padding, sizing fill/hug/fixed). exportAs: svg marks icons/vectors to export as assets instead of rebuilding them; assets lists icons and image fills to download with download_design_assets. designStyles and variables give design-token names to map onto the project's theme.
Inputs: url, nodeId, fileKey, maxDepth, +1 more.
get_flow_starting_pointsA
Get the prototype flow starting points of the current page
Inputs: no named parameters.
get_instance_overridesA
Get all override properties from a selected component instance. These overrides can be applied to other instances, which will swap them to match the source component.
Inputs: nodeId.
get_local_componentsA
Get all local components from the Figma document
Inputs: no named parameters.
get_local_variablesA
Get all local variable collections (with modes) and variables in the current document. Color values are returned as hex, aliases as { aliasOf }.
Inputs: no named parameters.
get_main_componentB
Return the main component (id, name, variant name and component set) of one or more INSTANCE nodes, read directly in the plugin (no REST API).
Inputs: nodeId, nodeIds.
get_node_infoB
Get detailed information about a specific node in Figma
Inputs: nodeId (required).
get_nodes_infoC
Get detailed information about multiple nodes in Figma
Inputs: nodeIds (required).
get_reactionsA
Get Figma Prototyping Reactions from multiple nodes. CRITICAL: The output MUST be processed using the 'reaction_to_connector_strategy' prompt IMMEDIATELY to generate parameters for connector lines via the 'create_connections' tool.
Inputs: nodeIds (required).
get_selectionB
Get information about the current selection in Figma
Inputs: no named parameters.
get_stylesA
Get all styles from the current Figma document
Inputs: no named parameters.
join_channelC
Join a specific channel to communicate with Figma
Inputs: channel.
move_nodeC
Move a node to a new position in Figma
Inputs: x (required), y (required), nodeId (required).
read_my_designA
Get detailed information about the current selection in Figma, including all node details
Inputs: no named parameters.
remove_flow_starting_pointB
Remove the prototype flow starting point of a frame
Inputs: nodeId (required).
remove_interactionsB
Remove prototype interactions from a node: all of them, or only those with a given trigger type
Inputs: nodeId (required), triggerType.
rename_nodeA
Rename a node in Figma
Inputs: name (required), nodeId (required).
resize_nodeC
Resize a node in Figma
Inputs: width (required), height (required), nodeId (required).
scan_nodes_by_typesC
Scan for child nodes with specific types in the selected Figma node
Inputs: types (required), nodeId (required).
scan_text_nodesC
Scan all text nodes in the selected Figma node
Inputs: nodeId (required).
set_annotationB
Create or update an annotation
Inputs: nodeId (required), labelMarkdown (required), categoryId, properties, +1 more.
set_axis_alignA
Set primary and counter axis alignment for an auto-layout frame in Figma
Inputs: nodeId (required), counterAxisAlignItems, primaryAxisAlignItems.
set_corner_radiusA
Set the corner radius of a node in Figma
Inputs: nodeId (required), radius (required), corners.
set_default_connectorB
Set a copied connector node as the default connector
Inputs: connectorId.
set_effectsA
Replace the effects (drop/inner shadows, layer/background blur) of a node. Pass an empty array to clear all effects.
Inputs: nodeId (required), effects (required).
set_fill_colorC
Set the fill color of a node in Figma can be TextNode or FrameNode
Inputs: b (required), g (required), r (required), nodeId (required), +1 more.
set_flow_starting_pointA
Add (or rename) a prototype flow starting point on a top-level frame
Inputs: name (required), nodeId (required).
set_focusA
Set focus on a specific node in Figma by selecting it and scrolling viewport to it
Inputs: nodeId (required).
set_frame_propertiesA
Set frame layout properties not covered by other tools: layoutPositioning (ABSOLUTE takes a child out of its auto-layout parent's flow, AUTO puts it back), itemReverseZIndex (auto-layout stacking: true = first child on top), clipsContent (clip overflowing children). x/y are applied last, so an ABSOLUTE child can be positioned in the same call.
Inputs: nodeId (required), x, y, clipsContent, +2 more.
set_image_fillA
Fill a node in Figma with an image from a local file path, a URL, or base64 data (replaces the node's existing fills)
Inputs: nodeId (required), imageUrl, imagePath, scaleMode, +1 more.
set_instance_overridesA
Apply previously copied overrides to selected component instances. Target instances will be swapped to the source component and all copied override properties will be applied.
Inputs: targetNodeIds (required), sourceInstanceId (required).
set_item_spacingA
Set distance between children in an auto-layout frame
Inputs: nodeId (required), itemSpacing, counterAxisSpacing.
set_layout_modeB
Set the layout mode and wrap behavior of a frame in Figma
Inputs: nodeId (required), layoutMode (required), layoutWrap.
set_layout_sizingC
Set horizontal and vertical sizing modes for a frame, component, component set, instance or text node in Figma
Inputs: nodeId (required), layoutSizingVertical, layoutSizingHorizontal.
set_multiple_annotationsC
Set multiple annotations parallelly in a node
Inputs: nodeId (required), annotations (required).
set_multiple_text_contentsB
Set multiple text contents parallelly in a node
Inputs: text (required), nodeId (required).
set_overlay_settingsA
Read the overlay settings (position, background, close on click outside) of a frame used as an overlay. These properties are READ-ONLY in the Figma Plugin API: calling with any setting returns an error together with the current values; set them manually in Figma's Prototype panel.
Inputs: nodeId (required), position, background, closeOnClickOutside.
set_paddingB
Set padding values for an auto-layout frame in Figma
Inputs: nodeId (required), paddingTop, paddingLeft, paddingRight, +1 more.
set_parentA
Move a node into a new parent node (e.g. a section, frame or group). Preserves the node's absolute position unless x/y are provided
Inputs: nodeId (required), parentId (required), x, y, +1 more.
set_reactionsA
Replace all prototype reactions of a node with raw Figma Plugin API Reaction objects ({ trigger, actions: [...] }). Use for advanced cases (e.g. SET_VARIABLE, CONDITIONAL, ON_KEY_DOWN). Trigger timeout/delay are in milliseconds, transition duration in seconds.
Inputs: nodeId (required), reactions (required).
set_scroll_behaviorA
Set prototype scrolling: overflowDirection on a frame, and/or make a child FIXED (fix position when scrolling) or SCROLLS. FIXED moves the node to the top of its parent's layer order (last child); in an auto-layout parent this also changes the node's position in the flow. SCROLLS moves a fixed node back to the top of the scrolling children. STICKY_SCROLLS is not supported by the Figma Plugin API and returns an error.
Inputs: nodeId (required), scrollBehavior, overflowDirection.
set_selectionsA
Set selection to multiple nodes in Figma and scroll viewport to show them
Inputs: nodeIds (required).
set_stroke_colorB
Set the stroke color of a node in Figma
Inputs: b (required), g (required), r (required), nodeId (required), +2 more.
set_text_contentA
Set the text content of an existing text node in Figma
Inputs: text (required), nodeId (required).
set_text_decorationA
Set underline / strikethrough / none on one or more TEXT nodes (also text inside instances, e.g. 'I;'), optionally only for a character range [start, end). Reports per-node success.
Inputs: decoration (required), end, start, nodeId, +1 more.
set_variable_valueC
Set the value of a variable for a mode. Value may be a literal or an alias to another variable ({aliasOf: variableId}).
Inputs: value (required), variableId (required), modeId.
set_visibleA
Show or hide one or more nodes (also nodes inside instances, e.g. 'I;', which creates a visibility override). Reports per-node success.
Inputs: visible (required), nodeId, nodeIds.
swap_instanceB
Swap the main component of an instance, preserving overrides where possible
Inputs: instanceId (required), componentId (required).
update_effect_styleB
Update the name, description or effects of a local effect style. Nodes using the style update automatically.
Inputs: styleId (required), name, effects, description.
update_text_styleA
Update properties of an existing local text style. Text nodes using the style update automatically.
Inputs: styleId (required), name, fontSize, textCase, +8 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 79 tools
The set contains many overlapping read/selection tools, such as get_selection vs. read_my_design and get_node_info vs. get_nodes_info, making it hard to know which to call. Similar pairs exist for annotations (set_annotation vs. set_multiple_annotations) and selection (set_focus vs. set_selections), so boundaries are often unclear despite descriptive labels.
Most tools follow a clear snake_case verb_noun pattern: get_*, set_*, create_*, delete_*, apply_*, bind_*, etc. A few names like read_my_design and join_channel break the pattern, but overall naming is predictable and consistent.
79 tools is far beyond what is appropriate for a Figma plugin, exceeding the 50+ threshold for extreme mismatch. While the domain is broad, the surface is massively over-scoped and likely overwhelms tool selection.
Coverage is broad across node creation/editing, components, variables, text/effect styles, prototyping, and asset export. Minor gaps remain, such as creating or applying paint styles and editing/removing component properties, but core design workflows are covered.
Maintenance
Related MCP Connectors
Email inboxes, webhooks, mock APIs, 2FA codes, approvals and 170 tools for AI agents.
Discover, inspect and run 63,000+ agent tools from one balance. Pay per call, no subscriptions.
Connect your AI agent to 300+ methods and 100+ live tools
85 public tools: agent workflows, audio data transfer, semantic search, queues and webhooks.
Related MCP Servers
- -licenseCqualityNot gradedmaintenanceEnables AI agents to interact with Figma in real-time through a WebSocket connection. Supports comprehensive design operations including text manipulation, layouts, components, variables, and export functionality.72207 npm-
- AlicenseNot gradedqualityNot gradedmaintenanceEnables AI agents like Claude to interact with Figma designs through 50+ tools for creating, styling, and manipulating design elements, components, and variables via a WebSocket relay and Figma plugin.-
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants like Claude and Cursor to interact directly with Figma to create, modify, and analyze design elements in real-time. It provides a comprehensive suite of tools for document inspection, styling, component management, and automated layout via a bidirectional WebSocket connection.807 npmMIT
- AlicenseBqualityCmaintenanceEnables local AI agents to generate and edit Figma designs via the Plugin API through a WebSocket relay, with no rate limits and all communication remaining local.501,224 npmMIT