Documentation Index
Fetch the complete documentation index at: https://mintlify.com/open-pencil/open-pencil/llms.txt
Use this file to discover all available pages before exploring further.
Tools Reference
The OpenPencil MCP server exposes 75+ tools for programmatic design file operations. All tools operate on aFigmaAPI instance and follow the Figma Plugin API conventions.
File Operations
These tools are unique to the MCP server (not in the AI chat or CLI).open_file
Open a .fig file for editing. Must be called before using other tools.
Parameters:
path(string, required) — Absolute path to a.figfile
save_file
Save the current document to a .fig file.
Parameters:
path(string, required) — Absolute path to save the.figfile
new_document
Create a new empty document with a blank page.
Parameters: (none)
Returns:
Read Tools
get_selection
Get details about currently selected nodes.
Parameters: (none)
Returns:
get_page_tree
Get the node tree of the current page. Returns all nodes with hierarchy, types, positions, and sizes.
Parameters: (none)
Returns:
get_node
Get detailed properties of a node by ID.
Parameters:
id(string, required) — Node ID
find_nodes
Find nodes by name pattern and/or type.
Parameters:
name(string, optional) — Name substring to match (case-insensitive)type(string, optional) — Node type filter. One of:FRAME,RECTANGLE,ELLIPSE,TEXT,LINE,STAR,POLYGON,SECTION,GROUP,COMPONENT,INSTANCE,VECTOR
Create Tools
create_shape
Create a shape on the canvas.
Parameters:
type(string, required) — Node type:FRAME,RECTANGLE,ELLIPSE,TEXT,LINE,STAR,POLYGON,SECTIONx(number, required) — X positiony(number, required) — Y positionwidth(number, required) — Width in pixels (min: 1)height(number, required) — Height in pixels (min: 1)name(string, optional) — Node name shown in layers panelparent_id(string, optional) — Parent node ID to nest inside
render
Render JSX to design nodes. Primary creation tool — creates entire component trees in one call.
Parameters:
jsx(string, required) — JSX string to renderx(number, optional) — X position of the root nodey(number, optional) — Y position of the root nodeparent_id(string, optional) — Parent node ID to render into
create_page
Create a new page.
Parameters:
name(string, required) — Page name
create_vector
Create a vector node with optional path data.
Parameters:
x(number, required) — X positiony(number, required) — Y positionname(string, optional) — Node namepath(string, optional) — VectorNetwork JSONfill(color, optional) — Fill color (hex)stroke(color, optional) — Stroke color (hex)stroke_weight(number, optional) — Stroke weightparent_id(string, optional) — Parent node ID
Modify Tools
set_fill
Set the fill color of a node.
Parameters:
id(string, required) — Node IDcolor(color, required) — Color value (hex like#ff0000)
set_stroke
Set the stroke (border) of a node.
Parameters:
id(string, required) — Node IDcolor(color, required) — Stroke color (hex)weight(number, optional, default: 1) — Stroke weight (min: 0.1)align(string, optional, default: “INSIDE”) — Stroke alignment:INSIDE,CENTER,OUTSIDE
set_effects
Set effects on a node (drop shadow, inner shadow, blur).
Parameters:
id(string, required) — Node IDtype(string, required) — Effect type:DROP_SHADOW,INNER_SHADOW,FOREGROUND_BLUR,BACKGROUND_BLURcolor(color, optional) — Shadow color (hex). Ignored for blur.offset_x(number, optional, default: 0) — Shadow X offsetoffset_y(number, optional, default: 4) — Shadow Y offsetradius(number, optional, default: 4) — Blur radius (min: 0)spread(number, optional, default: 0) — Shadow spread
update_node
Update properties of an existing node: position, size, opacity, corner radius, visibility, text, font.
Parameters:
id(string, required) — Node IDx(number, optional) — X positiony(number, optional) — Y positionwidth(number, optional) — Width (min: 1)height(number, optional) — Height (min: 1)opacity(number, optional) — Opacity (0-1)corner_radius(number, optional) — Corner radius (min: 0)visible(boolean, optional) — Visibilitytext(string, optional) — Text content (TEXT nodes)font_size(number, optional) — Font size (min: 1)font_weight(number, optional) — Font weight (100-900)name(string, optional) — Layer name
set_layout
Set auto-layout (flexbox) on a frame.
Parameters:
id(string, required) — Frame node IDdirection(string, required) — Layout direction:HORIZONTAL,VERTICALspacing(number, optional, default: 0) — Gap between items (min: 0)padding(number, optional) — Equal padding on all sides (min: 0)padding_horizontal(number, optional) — Horizontal padding (min: 0)padding_vertical(number, optional) — Vertical padding (min: 0)align(string, optional, default: “MIN”) — Primary axis alignment:MIN,CENTER,MAX,SPACE_BETWEENcounter_align(string, optional, default: “MIN”) — Cross axis alignment:MIN,CENTER,MAX,STRETCH
set_constraints
Set resize constraints for a node within its parent.
Parameters:
id(string, required) — Node IDhorizontal(string, optional) — Horizontal constraint:MIN,CENTER,MAX,STRETCH,SCALEvertical(string, optional) — Vertical constraint:MIN,CENTER,MAX,STRETCH,SCALE
Structure Tools
delete_node
Delete a node by ID.
Parameters:
id(string, required) — Node ID to delete
clone_node
Clone (duplicate) a node.
Parameters:
id(string, required) — Node ID to clone
rename_node
Rename a node in the layers panel.
Parameters:
id(string, required) — Node IDname(string, required) — New name
reparent_node
Move a node into a different parent.
Parameters:
id(string, required) — Node ID to moveparent_id(string, required) — New parent node ID
select_nodes
Select one or more nodes by ID.
Parameters:
ids(string[], required) — Node IDs to select
group_nodes
Group selected nodes.
Parameters:
ids(string[], required) — Node IDs to group
ungroup_node
Ungroup a group node.
Parameters:
id(string, required) — Group node ID
Component Tools
create_component
Convert a frame/group into a component.
Parameters:
id(string, required) — Node ID to convert
create_instance
Create an instance of a component.
Parameters:
component_id(string, required) — Component node IDx(number, optional) — X positiony(number, optional) — Y position
Page Tools
list_pages
List all pages in the document.
Parameters: (none)
Returns:
switch_page
Switch to a different page by name or ID.
Parameters:
page(string, required) — Page name or ID
Variable Tools
list_variables
List all design variables (colors, numbers, strings, booleans).
Parameters:
type(string, optional) — Filter by variable type:COLOR,FLOAT,STRING,BOOLEAN
list_collections
List all variable collections.
Parameters: (none)
Returns:
create_variable
Create a new variable in a collection.
Parameters:
name(string, required) — Variable nametype(string, required) — Variable type:COLOR,FLOAT,STRING,BOOLEANcollection_id(string, required) — Collection IDvalue(string, optional) — Initial value (hex for COLOR, number for FLOAT, etc.)
set_variable
Set the value of a variable for a specific mode.
Parameters:
id(string, required) — Variable IDmode(string, required) — Mode IDvalue(string, required) — Value (hex for COLOR, number for FLOAT, etc.)
bind_variable
Bind a variable to a node property.
Parameters:
node_id(string, required) — Node IDfield(string, required) — Property field (fills, strokes, opacity, width, height, etc.)variable_id(string, required) — Variable ID
Boolean Operations
boolean_union
Union (combine) multiple nodes.
Parameters:
ids(string[], required) — Node IDs to union
boolean_subtract
Subtract the second node from the first.
Parameters:
ids(string[], required) — Node IDs (first minus rest)
boolean_intersect
Intersect multiple nodes.
Parameters:
ids(string[], required) — Node IDs to intersect
boolean_exclude
Exclude (XOR) multiple nodes.
Parameters:
ids(string[], required) — Node IDs to exclude
Vector Path Tools
path_get
Get vector path data of a node.
Parameters:
id(string, required) — Node ID
path_set
Set vector path data on a node.
Parameters:
id(string, required) — Node IDpath(string, required) — VectorNetwork JSON
path_scale
Scale vector path from center.
Parameters:
id(string, required) — Node IDfactor(number, required) — Scale factor (e.g. 2 for double)
path_flip
Flip vector path horizontally or vertically.
Parameters:
id(string, required) — Node IDaxis(string, required) — Flip axis:horizontal,vertical
path_move
Move all path points by an offset.
Parameters:
id(string, required) — Node IDdx(number, required) — X offsetdy(number, required) — Y offset
Viewport Tools
viewport_get
Get current viewport position and zoom level.
Parameters: (none)
Returns:
viewport_set
Set viewport position and zoom.
Parameters:
x(number, required) — Center Xy(number, required) — Center Yzoom(number, required) — Zoom level (min: 0.01)
viewport_zoom_to_fit
Zoom viewport to fit specified nodes.
Parameters:
ids(string[], required) — Node IDs to fit in view
Text Tools
set_text
Set text content of a text node.
Parameters:
id(string, required) — Node IDtext(string, required) — Text content
set_font
Set font properties of a text node.
Parameters:
id(string, required) — Node IDfamily(string, optional) — Font family namesize(number, optional) — Font size (min: 1)style(string, optional) — Font style (e.g. “Bold”, “Regular”, “Bold Italic”)
set_text_properties
Set text layout properties: alignment, auto-resize, decoration.
Parameters:
id(string, required) — Text node IDalign_horizontal(string, optional) — Horizontal text alignment:LEFT,CENTER,RIGHT,JUSTIFIEDalign_vertical(string, optional) — Vertical text alignment:TOP,CENTER,BOTTOMauto_resize(string, optional) — Text auto-resize mode:NONE,WIDTH_AND_HEIGHT,HEIGHT,TRUNCATEtext_decoration(string, optional) — Text decoration:NONE,UNDERLINE,STRIKETHROUGH
Granular Tools
set_rotation
Set rotation angle of a node in degrees.
Parameters:
id(string, required) — Node IDangle(number, required) — Rotation angle in degrees
set_opacity
Set opacity of a node.
Parameters:
id(string, required) — Node IDvalue(number, required) — Opacity (0-1)
set_radius
Set corner radius.
Parameters:
id(string, required) — Node IDradius(number, optional) — Corner radius for all corners (min: 0)top_left(number, optional) — Top-left radius (min: 0)top_right(number, optional) — Top-right radius (min: 0)bottom_right(number, optional) — Bottom-right radius (min: 0)bottom_left(number, optional) — Bottom-left radius (min: 0)
set_visible
Set visibility of a node.
Parameters:
id(string, required) — Node IDvalue(boolean, required) — Visible (true/false)
set_blend
Set blend mode of a node.
Parameters:
id(string, required) — Node IDmode(string, required) — Blend mode:NORMAL,DARKEN,MULTIPLY,COLOR_BURN,LIGHTEN,SCREEN,COLOR_DODGE,OVERLAY,SOFT_LIGHT,HARD_LIGHT,DIFFERENCE,EXCLUSION,HUE,SATURATION,COLOR,LUMINOSITY
set_locked
Set locked state of a node.
Parameters:
id(string, required) — Node IDvalue(boolean, required) — Locked (true/false)
Advanced Tools
eval
Execute JavaScript with full Figma Plugin API access. Use for operations not covered by other tools.
Parameters:
code(string, required) — JavaScript code to execute
node_tree
Get a node tree with types and hierarchy.
Parameters:
id(string, required) — Node IDdepth(number, optional) — Max depth (default: unlimited)
node_replace_with
Replace a node with JSX content.
Parameters:
id(string, required) — Node ID to replacejsx(string, required) — JSX string for the replacement
Full Tool List
All 75+ tools:open_file,save_file,new_documentget_selection,get_page_tree,get_node,find_nodescreate_shape,render,create_page,create_vector,create_sliceset_fill,set_stroke,set_effects,update_node,set_layout,set_constraintsdelete_node,clone_node,rename_node,reparent_node,select_nodes,group_nodes,ungroup_nodecreate_component,create_instancelist_pages,switch_pagelist_variables,list_collections,create_variable,set_variable,delete_variable,bind_variableget_collection,create_collection,delete_collectionboolean_union,boolean_subtract,boolean_intersect,boolean_excludepath_get,path_set,path_scale,path_flip,path_moveviewport_get,viewport_set,viewport_zoom_to_fit,page_boundsset_text,set_font,set_font_range,set_text_resize,set_text_propertiesset_rotation,set_opacity,set_radius,set_minmax,set_visible,set_blend,set_locked,set_stroke_alignnode_bounds,node_move,node_resize,node_ancestors,node_children,node_tree,node_bindings,node_replace_withflatten_nodes,list_fonts,set_layout_childeval,get_variable,find_variables