Design Tool

Tool Reference

Complete reference for all 39 MCP tools available in the Efecto Design Tool. Each tool can be called via MCP or the REST API.

Quick start

Install the MCP and start designing:
terminal
npx @efectoapp/mcp install

Data Model

Efecto documents are built from artboards and nodes. The document is serialized as JSX-like markup where each element has a data-id attribute.

Node Types

TypeDescription
frameContainer element (div)
textText element (p, h1-h6, span)
imageImage element
buttonButton with variant support
linkAnchor link
iconIcon element
inputForm input
videoVideo element
componentReusable component instance

Styling

All styling uses Tailwind CSS via the className property. You can also use style for inline CSS when needed (especially for dynamic colors).

Tailwind v4 runtime note

Dynamic arbitrary values like bg-[#f9f9f9] may not work at runtime because Tailwind 4 generates CSS at build time. For dynamic hex colors, use the style property or the set_fill tool.

Artboard Sizes

DeviceWidthHeight
Desktop1440900
Tablet7681024
Mobile375812

Session Tools (3)

Manage the lifecycle of a design session. The MCP process tracks the active session so you don't need to pass the session ID to every tool.

create_session

Create a new session. Returns a URL the user opens in their browser. Once connected, all design tools execute in real-time. Only one session is active at a time.

ParameterTypeRequiredDescription
labelstringnoHuman-readable label (e.g. "Landing page design")
javascript
// Create a session
create_session({ label: "Landing page design" })
// → Returns { designUrl: "https://efecto.app/design?session=abc123" }
session_status

Check if the browser is connected, pending calls, etc.

ParameterTypeRequiredDescription
sessionIdstringnoDefaults to active session
close_session

Close the active session. Disconnects the browser and cleans up.

ParameterTypeRequiredDescription
sessionIdstringnoDefaults to active session

Reading Tools (5)

Inspect the current document state. Always read the document before making edits.

get_document

Returns the full document as JSX-like markup. Each element has a data-id for referencing in other tools. Always call this before modifying an existing design.

get_selection

Returns the currently selected nodes with serialized JSX subtrees. Use to understand user context before making edits.

list_artboards

Lists all artboards with IDs, names, dimensions, and positions.

find_nodes

Search for nodes by name, text content, type, or className.

ParameterTypeRequiredDescription
querystringnoSearch term (matches name and text, case-insensitive)
typestringnoframe | text | image | button | link | icon | input | video | component
classNameContainsstringnoFilter by className substring
get_node_tree

Returns JSX for a specific node or artboard subtree (faster than get_document for one section).

ParameterTypeRequiredDescription
nodeIdstringyesID of the node or artboard to serialize

Creating Tools (4)

Add new content to the document. Use add_section for complex layouts and add_node for single elements.

create_artboard

Creates a new artboard. Set className to "flex flex-col" for vertical layout.

ParameterTypeRequiredDescription
namestringyesName of the artboard
widthnumberyesWidth in CSS pixels (default: 1440)
heightnumberyesHeight in CSS pixels (default: 900)
xnumbernoHorizontal position on canvas
ynumbernoVertical position on canvas
backgroundColorstringnoBackground color as hex (default: "#ffffff")
classNamestringnoTailwind CSS classes
javascript
create_artboard({
  name: "Desktop",
  width: 1440,
  height: 900,
  className: "flex flex-col",
  backgroundColor: "#ffffff"
})
add_section

Adds a complete section from JSX-like markup. Most efficient for complex layouts.

ParameterTypeRequiredDescription
parentIdstringyesID of the parent artboard or node
jsxstringyesJSX-like markup with HTML tags and Tailwind className
indexnumbernoInsert position (appends if omitted)
javascript
add_section({
  parentId: "artboard-1",
  jsx: `<section className="flex flex-col items-center justify-center py-24 px-8 bg-black text-white">
  <h1 className="text-6xl font-bold tracking-tight mb-4">Build faster</h1>
  <p className="text-xl text-gray-400 max-w-2xl text-center">Ship beautiful products with AI-powered design.</p>
  <button className="mt-8 px-8 py-3 bg-white text-black rounded-full font-medium">Get Started</button>
</section>`
})
add_node

Adds a single node to the document tree.

ParameterTypeRequiredDescription
parentIdstringyesID of the parent artboard or node
typestringyesframe | text | image | button | link | icon | input | video | component
tagstringnoHTML tag to render
classNamestringnoTailwind CSS classes
textContentstringnoText content
srcstringnoImage/video source URL
altstringnoAlt text for images
hrefstringnoLink URL
variantstringnoprimary | secondary | outline | ghost | destructive
styleobjectnoInline CSS styles
replace_section

Replaces an existing node with new JSX content in-place. Preserves position in parent.

ParameterTypeRequiredDescription
nodeIdstringyesID of the node to replace
jsxstringyesJSX-like markup for the replacement

Modifying Tools (5)

Update existing nodes without replacing them entirely.

update_node

Updates properties of an existing node. Only specified properties are changed.

ParameterTypeRequiredDescription
nodeIdstringyesID of the node to update (from data-id)
classNamestringnoNew Tailwind classes
textContentstringnoNew text content
tagstringnoChange HTML tag
styleobjectnoInline CSS styles
srcstringnoImage/video source
variantstringnoButton variant
javascript
update_node({
  nodeId: "node-abc123",
  textContent: "New heading text",
  className: "text-4xl font-bold text-white"
})
update_class

Updates only the className of a node. Replaces existing className entirely.

ParameterTypeRequiredDescription
nodeIdstringyesNode ID
classNamestringyesNew Tailwind classes (replaces all)
batch_update

Updates multiple nodes in a single call. Efficient for bulk changes.

ParameterTypeRequiredDescription
updatesarrayyesArray of { nodeId, className?, textContent?, style? }
javascript
batch_update({
  updates: [
    { nodeId: "node-1", textContent: "Updated" },
    { nodeId: "node-2", className: "text-red-500" },
  ]
})
update_artboard

Updates artboard properties (resize, rename, change background).

ParameterTypeRequiredDescription
artboardIdstringyesID of the artboard to update
namestringnoNew name
widthnumbernoNew width
heightnumbernoNew height
backgroundColorstringnoNew background color
classNamestringnoTailwind classes
set_fill

Sets the fill (background) of a node or artboard. Supports solid colors, gradients, and images. Handles dual-write automatically.

ParameterTypeRequiredDescription
targetIdstringyesID of the node or artboard
fillobjectnoFill config: { type: "solid"|"gradient"|"image", color?, gradient?, url? }. Omit to clear.

Organizing Tools (8)

Restructure the document tree — move, duplicate, group, and delete nodes.

move_node

Moves a node to a new parent or reorders within current parent.

ParameterTypeRequiredDescription
nodeIdstringyesNode to move
newParentIdstringyesNew parent node/artboard
indexnumbernoPosition in parent
duplicate_node

Duplicates a node and all its children. Inserted after the original.

ParameterTypeRequiredDescription
nodeIdstringyesNode to duplicate
duplicate_artboard

Duplicates an entire artboard with all content. Creates a deep copy with fresh IDs.

ParameterTypeRequiredDescription
artboardIdstringyesArtboard to duplicate
newNamestringnoName for the copy
offsetXnumbernoHorizontal offset from original
group_nodes

Groups selected nodes into a new frame container.

ParameterTypeRequiredDescription
nodeIdsstring[]yesNode IDs to group
ungroup_node

Ungroups a frame container, moving its children up to the parent.

ParameterTypeRequiredDescription
groupIdstringyesID of the group/frame to ungroup
reorder_node

Changes z-order: "front" = bring to top, "back" = send to bottom.

ParameterTypeRequiredDescription
nodeIdstringyesNode to reorder
positionstringyes"front" or "back"
delete_nodes

Deletes one or more nodes and all their children.

ParameterTypeRequiredDescription
nodeIdsstring[]yesArray of node IDs to delete
delete_artboard

Deletes an artboard and all its contents.

ParameterTypeRequiredDescription
artboardIdstringyesID of the artboard to delete

Canvas & Viewport (6)

Manage the document and viewport.

new_document

Creates a new blank document, replacing the current one. Discards unsaved changes.

ParameterTypeRequiredDescription
namestringnoName for the new document
rename_document

Renames the document.

ParameterTypeRequiredDescription
namestringyesNew name
undo

Undoes the last action (Cmd+Z).

redo

Redoes the last undone action (Cmd+Shift+Z).

zoom_to_fit

Zooms the viewport to fit all artboards. Useful after creating multiple artboards.

zoom_to_artboard

Zooms the viewport to fit a specific artboard.

ParameterTypeRequiredDescription
artboardIdstringyesID of the artboard to zoom to

Selection & Visibility (3)

select_nodes

Selects nodes on the canvas to highlight for the user. Empty array deselects all.

ParameterTypeRequiredDescription
nodeIdsstring[]yesNode IDs to select
deselect_all

Deselects all currently selected nodes.

set_visibility

Shows or hides a node. Hidden nodes remain in the tree but are not rendered.

ParameterTypeRequiredDescription
nodeIdstringyesNode ID
visiblebooleanyestrue to show, false to hide

Layout Tools (4)

Align, distribute, and position elements on the canvas.

align_nodes

Aligns multiple nodes along a shared axis.

ParameterTypeRequiredDescription
nodeIdsstring[]yesNode IDs to align (min 2)
alignmentstringyesleft | center | right | top | middle | bottom
distribute_nodes

Distributes nodes evenly with equal spacing.

ParameterTypeRequiredDescription
nodeIdsstring[]yesNode IDs to distribute (min 3)
directionstringyes"horizontal" or "vertical"
move_artboard

Repositions an artboard on the canvas. Use to lay out multi-screen flows (e.g. Desktop at 0,0, Tablet at 1540,0).

ParameterTypeRequiredDescription
artboardIdstringyesArtboard to move
xnumberyesNew X position
ynumberyesNew Y position
set_viewport

Sets the viewport zoom level and/or pan position. Zoom 1.0 = 100%.

ParameterTypeRequiredDescription
zoomnumbernoZoom level (0.1 to 5.0)
panXnumbernoHorizontal pan offset
panYnumbernoVertical pan offset

Export (1)

export_image

Exports an artboard or node as an image (PNG, JPEG, WebP, SVG). Returns base64 data URL.

ParameterTypeRequiredDescription
artboardIdstringyesArtboard to export
nodeIdstringnoSpecific node to export
formatstringnopng | jpeg | webp | svg (default: png)
scalenumbernoScale multiplier 1-4 (default: 1)
qualitynumbernoQuality 0-1 for JPEG/WebP (default: 0.92)