Skip to main content
Glama
Figma Vector MCP

Figma Vector MCP

by workingmodel

Figma Vector MCP

A Figma plugin + MCP server that lets Claude (or any MCP client) create and manipulate fully-editable vector nodes on the Figma canvas — paths, shapes, gradients, text, effects, image fills, and more — via a local WebSocket relay.

Developed by Working Model Inc

npm version npm downloads

Version 0.3.3 — 58 tools across creation, styling, layout, components, effects, pages, and export.

Why This Exists

cursor-talk-to-figma-mcp is great for reading Figma state and creating basic primitives, but it has no vector path creation, gradient, effects, or compositing tools. This plugin fills that gap:

Capability

cursor-talk-to-figma-mcp

figma-vector-mcp

Create rectangle / ellipse / frame / text

✅

✅

Create from SVG string

❌

✅

Create from path d string

❌

✅

Create polyline / polygon

❌

✅

Gradient fills (linear, radial, angular, diamond)

❌

✅

Image fills (base64 → canvas)

❌

✅

Effects (shadow, blur)

❌

✅

Blend modes

❌

✅

Boolean operations (union, subtract, etc.)

❌

✅

Auto-layout

❌

✅

Components + instances

❌

✅

Font discovery

❌

✅

Node search

❌

✅

Multi-page management

❌

✅

Named node registry

❌

✅

Batch commands (single round-trip)

❌

✅

Auto-reconnect + command queue

❌

✅

Export SVG + PNG

❌

✅


Related MCP server: OneWright

Architecture

Claude (MCP client)
  ↕ stdio (MCP protocol)
server.ts (MCP server)
  ↕ WebSocket (ws://localhost:3055)
socket.ts (relay — channel-based routing)
  ↕ WebSocket
Figma plugin (ui.html ↔ code.js)
  ↕ postMessage
Figma Plugin API → canvas

The socket relay runs locally. The Figma plugin connects and joins a named channel. The MCP server joins the same channel and sends commands. Results flow back the same path.


AI Agent Quickstart

For AI agents (Claude Code, Cursor, etc.) — the recommended call sequence to start any session:

1. health_check                    → confirm plugin is connected
2. get_document_info               → get page IDs, current page, top-level nodes
3. get_available_fonts             → discover loadable fonts before create_text
4. get_styles                      → load brand colours/text styles if available

Color convention: All RGB values are 0–1 throughout (matching Figma's internal format). r: 1, g: 0, b: 0 = red. Never use 0–255.

Gradient workflow:

1. create_frame({ width, height })          → get frameId
2. set_gradient_fill({ nodeId: frameId, type: "LINEAR", angle: 135,
     stops: [{ color: { r:0.2, g:0.1, b:0.9 }, position: 0 },
             { color: { r:0.9, g:0.2, b:0.4 }, position: 1 }] })

Image fill workflow (with generative AI):

1. Generate image via Replicate/fal.ai → get base64 PNG
2. create_frame({ width: 512, height: 512 })
3. set_image_fill({ nodeId, base64, scaleMode: "FILL" })

Batch compositions — use $prev.id to chain commands without extra round-trips:

{ "commands": [
    { "command": "create_frame", "params": { "width": 400, "height": 300, "name": "Card" } },
    { "command": "set_gradient_fill", "params": { "nodeId": "$prev.id", "type": "LINEAR",
        "stops": [{"color":{"r":0.1,"g":0.1,"b":0.9},"position":0},
                  {"color":{"r":0.8,"g":0.2,"b":0.5},"position":1}] } },
    { "command": "create_text", "params": { "parentId": "$results.0.id",
        "text": "Hello", "fontSize": 32, "x": 24, "y": 24 } }
]}

Known SVG limits: figma.createNodeFromSvg() strips <defs>, gradients, filters, masks, and animations. Use set_gradient_fill for gradients instead of SVG <linearGradient>.

Reconnection: If the plugin disconnects, it auto-reconnects with exponential backoff (1s→30s max) and replays queued commands (up to 30s old). No manual intervention needed for short interruptions.


Setup

1 — Install the plugin

  1. Clone this repo or download the source

  2. In Figma desktop: Plugins → Development → Import plugin from manifest

  3. Select src/figma-plugin/manifest.json

2 — Install the MCP server

npm install -g figma-vector-mcp
# or use without installing via npx / bunx (see MCP config below)

3 — Start the socket relay

bun run socket

Listens on ws://localhost:3055. Auto-start on login (macOS):

./scripts/setup.sh --launchd

4 — Configure the MCP server

# Auto-detect Claude Code / Cursor and write config:
./scripts/setup.sh

# Local build:
./scripts/setup.sh --local

# Install git pre-commit sandbox lint hook:
./scripts/setup.sh --hooks

Manual config (~/.claude/settings.json or ~/.cursor/mcp.json):

{
  "mcpServers": {
    "FigmaVectorMCP": {
      "command": "bunx",
      "args": ["figma-vector-mcp@latest"],
      "env": { "FVMCP_CHANNEL": "figma-vector-mcp" }
    }
  }
}

5 — Connect the plugin

  1. Open your Figma file

  2. Plugins → Development → Figma Vector MCP

  3. Enter server URL (ws://localhost:3055) → Connect

  4. Enter channel name (figma-vector-mcp) → Join

The plugin saves your last URL and channel — pre-filled on next open. Keep the plugin panel open during your session — closing it terminates the WebSocket connection.

6 — Verify

health_check → { "status": "ok", "version": "0.3.3", "currentPage": { ... } }

Environment Variables

Variable

Default

Description

FVMCP_PORT

3055

Socket relay port

FVMCP_CHANNEL

figma-vector-mcp

Channel name — must match the plugin

FVMCP_TIMEOUT_MS

10000

Default command timeout (ms)

Per-tool timeout overrides: health_check → 3s, export_node_as_png → 30s, export_node_as_svg → 15s, create_batch → 60s.


Tool Reference

Connection & Health

Tool

Description

Key Params

health_check

Ping plugin; confirm connectivity

—

join_channel

Join a named channel

channel

Vector Creation

Tool

Description

Key Params

create_vector_from_svg

Place editable vector from SVG string

svg, x, y, name, parentId

create_path

Vector from SVG d path string

d, x, y, fillColor, strokeColor, strokeWeight

create_polyline

Vector from [x,y][] point pairs

points, closed, strokeColor, strokeWeight

Primitives

Tool

Description

Key Params

create_frame

Container frame

width, height, x, y, fillColor

create_rectangle

Rectangle

width, height, x, y, fillColor

create_ellipse

Ellipse / circle

width, height, x, y, fillColor

create_text

Text node with optional fixed-width column

text, fontSize, fontFamily, fontStyle, fillColor, width, height, textAutoResize

Fills & Colour

Tool

Description

Key Params

set_fill_color

Solid RGBA fill (0–1)

nodeId, r, g, b, a

set_gradient_fill

Gradient fill — LINEAR, RADIAL, ANGULAR, DIAMOND

nodeId, type, stops, angle, center, gradientTransform

set_image_fill

Base64 image as fill

nodeId, base64, scaleMode, opacity

Stroke

Tool

Description

Key Params

set_stroke

Full stroke control

nodeId, color, weight, position, dashPattern, lineCap, lineJoin

set_stroke_color

Quick stroke colour + weight

nodeId, r, g, b, a, weight

Effects & Compositing

Tool

Description

Key Params

set_effect

Drop shadow, inner shadow, blur, background blur

nodeId, effects[] (type, color, offset, blur, spread), mode (REPLACE | APPEND)

set_blend_mode

Layer blend mode

nodeId, mode (NORMAL, MULTIPLY, SCREEN, OVERLAY…)

Node Manipulation

Tool

Description

Key Params

set_corner_radius

Corner radius — uniform or per-corner

nodeId, radius or topLeft, topRight, bottomLeft, bottomRight

set_opacity

Opacity 0–1

nodeId, opacity

set_text_style

Modify text properties + text box size

nodeId, fontSize, fontFamily, fontStyle, letterSpacing, lineHeight, textAlign, fillColor, width, height, textAutoResize

rename_node

Rename a node

nodeId, name

set_visibility

Show or hide a node

nodeId, visible

reorder_node

Change Z-order within parent

nodeId, action (BRING_TO_FRONT / SEND_TO_BACK / BRING_FORWARD / SEND_BACKWARD) or index

move_node

Reposition

nodeId, x, y

resize_node

Resize

nodeId, width, height

delete_node

Remove from canvas

nodeId

clone_node

Duplicate, optionally reposition

nodeId, x, y, parentId

group_nodes

Group nodes

nodeIds[], name, parentId

ungroup_nodes

Ungroup

nodeId

boolean_operation

Union, subtract, intersect, exclude

nodeIds[], operation, name

create_mask

Clip mask — maskNode clips targetNode

maskNodeId, targetNodeId, name

Layout

Tool

Description

Key Params

set_auto_layout

Enable / configure auto-layout

nodeId, direction, spacing, padding, primaryAxisAlign, counterAxisAlign, primaryAxisSizingMode, counterAxisSizingMode, wrap

set_layout_grid

Column / row / grid guides on a frame

nodeId, grids[] (pattern, count, gutterSize, sectionSize, alignment, color)

batch_set_properties

Bulk update fill/stroke/opacity/position/size

operations[] (nodeId + any subset of properties)

Components

Tool

Description

Key Params

create_component

Convert frame/group to component

nodeId, name

create_instance

Place component instance

componentId, x, y, parentId

get_components

List all local components

—

get_library_components

Search local components by name

query

Document & Pages

Tool

Description

Key Params

get_document_info

Document name, pages, current page children

—

get_selection

Currently selected nodes

—

get_node_info

Full node detail: fills, strokes, layout, text, constraints

nodeId

set_focus

Scroll viewport to node and select it

nodeId

find_nodes

Search by name and/or type

query, type, pageId, recursive

get_page_list

All pages

—

switch_page

Activate a page

pageId or pageName

create_page

Create a new page

name

duplicate_frame_to_page

Copy node to another page

nodeId, targetPageId, x, y

Node Registry

Tool

Description

Key Params

register_node

Save named alias for a node ID (persists in document)

alias, nodeId

resolve_node

Look up node ID by alias

alias

Color Registry

Tool

Description

Key Params

register_color

Save a named color to the document palette (0–1)

alias, r, g, b, a

resolve_color

Look up a color by alias

alias

list_colors

List all registered colors in the document

—

Styles & Fonts

Tool

Description

Key Params

get_styles

All local paint and text styles

—

apply_style

Apply document style to node

nodeId, styleId, styleType

get_available_fonts

List loadable fonts; filter by name

query

Export

Tool

Description

Key Params

export_node_as_svg

Export node as SVG string

nodeId

export_node_as_png

Export as base64 PNG

nodeId, scale (default 2)

screenshot_current_page

Export full page as base64 PNG

scale

Batch

Tool

Description

Key Params

create_batch

Run multiple commands in one round-trip. Supports $prev.id and $results.N.field tokens for chaining.

commands[] (command, params)


Sandbox Compatibility

The plugin main thread (code.js) runs in Figma's restricted QuickJS sandbox. The UI (ui.html) is a normal browser context and is not affected.

Run bun run lint:plugin to check code.src.js for violations before building. A pre-commit hook can be installed via ./scripts/install-hooks.sh.

Banned in code.js

API / Syntax

Safe replacement

import / export

Inline all deps

x ?? y

(x != null) ? x : y

obj?.prop

obj && obj.prop

{ ...obj } / [ ...arr ]

Object.assign({}, obj) / Array.from(arr)

localStorage

figma.clientStorage

TextDecoder

Chunked String.fromCharCode

fetch()

Not available in main thread

figma.getNodeById() (sync)

await figma.getNodeByIdAsync()

figma.currentPage = x (sync assign)

await figma.setCurrentPageAsync(x)

figma.getLocalPaintStyles() (sync)

await figma.getLocalPaintStylesAsync()

figma.getLocalTextStyles() (sync)

await figma.getLocalTextStylesAsync()

figma.root.findAllWithCriteria() without page load

await figma.loadAllPagesAsync() first

SVG compatibility (create_vector_from_svg)

Feature

Status

<rect>, <polygon>, <polyline>, <path>, <circle>, <ellipse>

✅

fill, stroke, stroke-width, stroke-linecap, stroke-linejoin

✅

viewBox, width, height

✅

<linearGradient> / <radialGradient> in <defs>

❌ Stripped — use set_gradient_fill

<filter>, <mask>, <pattern>

❌ Stripped

<animate>, <animateTransform>

❌ Stripped

<script>, <foreignObject>

❌ Stripped

fill="url(#...)" references

❌ Replaced with fill="none"


Development

bun install              # install deps
bun run socket           # start relay on :3055
bun run build            # build MCP server → dist/server.js
bun run build:plugin     # build plugin: code.src.js → code.js
bun run lint:plugin      # check code.src.js for sandbox violations
./scripts/install-hooks.sh  # install pre-commit lint hook

Plugin workflow

  1. Edit src/figma-plugin/code.src.js

  2. bun run lint:plugin — catch sandbox violations before building

  3. bun run build:plugin — esbuild outputs code.js (ES2017)

  4. Close and reopen the plugin panel in Figma to load the new code.js


Credits

  • Socket relay (src/socket.ts) adapted from cursor-talk-to-figma-mcp — Copyright (c) 2025 sonnylazuardi, MIT License

  • setCharacters helpers in code.src.js adapted from the same project — Copyright (c) 2025 sonnylazuardi, MIT License


License

MIT © Working Model — see LICENSE and THIRD_PARTY_NOTICES.md.


Developed by Working Model Inc

Available Tools

58 tools
apply_styleC

Apply a named document style (paint or text) to a node by style ID.

Inputs: nodeId (required), styleId (required), styleType.

batch_set_propertiesB

Update fill color, stroke color, opacity, position, and/or size on multiple nodes in a single round-trip.

Inputs: operations (required).

boolean_operationC

Perform a boolean operation (union, subtract, intersect, exclude) on 2 or more vector nodes.

Inputs: nodeIds (required), operation (required), name.

clone_nodeC

Duplicate a Figma node, optionally repositioning the clone.

Inputs: nodeId (required), x, y, parentId.

create_batchA

Execute multiple commands in a single round-trip. Commands run sequentially. Each result includes success/error status. Use this for complex compositions (e.g. place an SVG, add a label, group them) to avoid multiple round-trips.

Inputs: commands (required).

create_componentB

Convert an existing frame or group into a reusable Figma component.

Inputs: nodeId (required), name.

create_ellipseC

Create an ellipse (or circle) on the Figma canvas.

Inputs: width (required), height (required), x, y, +3 more.

create_frameC

Create a Figma frame (container) on the canvas.

Inputs: width (required), height (required), x, y, +3 more.

create_instanceC

Place an instance of a local component on the canvas by component ID.

Inputs: componentId (required), x, y, name, +1 more.

create_maskA

Apply a clip mask — maskNode defines the shape, targetNode is clipped to it. Both nodes are grouped.

Inputs: maskNodeId (required), targetNodeId (required), name.

create_pageC

Create a new page in the Figma document.

Inputs: name (required).

create_pathA

Create an editable vector from a single SVG path d attribute string. Shorthand for simple paths without a full SVG wrapper.

Inputs: d (required), x, y, name, +4 more.

create_polylineB

Create an editable vector from an array of [x, y] point pairs. Use closed=true to produce a filled polygon.

Inputs: points (required), x, y, name, +4 more.

create_rectangleC

Create a rectangle on the Figma canvas.

Inputs: width (required), height (required), x, y, +3 more.

create_textC

Create a text node on the Figma canvas. Use width to fix the column width and enable text wrapping.

Inputs: text (required), x, y, name, +8 more.

create_vector_from_svgB

Place a fully editable vector node on the Figma canvas from an SVG string. Supports any valid SVG including paths, polylines, polygons, circles, and groups. The created node is fully editable in Figma.

Inputs: svg (required), x, y, name, +1 more.

delete_nodeC

Delete a node from the Figma canvas.

Inputs: nodeId (required).

duplicate_frame_to_pageC

Copy a node to a target page at an optional position.

Inputs: nodeId (required), targetPageId (required), x, y.

export_node_as_pngA

Export a Figma node as a base64-encoded PNG at the specified pixel scale.

Inputs: nodeId (required), scale.

export_node_as_svgA

Export a Figma node as an SVG string. Useful for round-tripping: create a vector, modify it in Figma, export back.

Inputs: nodeId (required).

find_nodesA

Search for nodes by name (case-insensitive contains) and/or type. Scoped to a page (defaults to current page). Recursive by default.

Inputs: type, query, pageId, recursive.

get_available_fontsA

List all fonts available in this Figma environment (system fonts + Figma font agent). Use before create_text to verify a font is loadable. Optionally filter by family name substring.

Inputs: query.

get_componentsB

List all local components in the Figma document.

Inputs: no named parameters.

get_document_infoB

Get information about the current Figma document: name, current page, all pages, and top-level nodes.

Inputs: no named parameters.

get_library_componentsB

List components available for use. Returns local document components. Filter by name with optional query.

Inputs: query.

get_node_infoB

Get detailed information about a specific node by ID: type, position, size, opacity, children.

Inputs: nodeId (required).

get_page_listB

List all pages in the current Figma document.

Inputs: no named parameters.

get_selectionB

Get the currently selected nodes in Figma, including position and size.

Inputs: no named parameters.

get_stylesA

Get all local paint styles and text styles defined in the Figma document. Use these IDs with apply_style to keep output on-brand.

Inputs: no named parameters.

group_nodesC

Group multiple Figma nodes into a group layer.

Inputs: nodeIds (required), name, parentId.

health_checkA

Ping the Figma plugin and confirm connectivity. Returns plugin version and current page.

Inputs: no named parameters.

join_channelA

Join a named channel on the Figma Vector MCP socket relay. Must be called before any drawing commands if the channel was not set via env/arg.

Inputs: channel (required).

list_colorsA

List all color aliases registered in this document's palette.

Inputs: no named parameters.

move_nodeC

Move a Figma node to a new position on the canvas.

Inputs: x (required), y (required), nodeId (required).

register_colorA

Save a named color alias to the document palette. All RGB values are 0–1. Use resolve_color or list_colors to retrieve.

Inputs: b (required), g (required), r (required), alias (required), +1 more.

register_nodeA

Save a named alias for a node ID, persisted in the Figma document. Use resolve_node to retrieve it later.

Inputs: alias (required), nodeId (required).

rename_nodeC

Rename a Figma node.

Inputs: name (required), nodeId (required).

reorder_nodeB

Change a node's Z-order within its parent. Use action for relative moves or index for an absolute position (0 = bottom of stack).

Inputs: nodeId (required), index, action.

resize_nodeC

Resize a Figma node to the given width and height.

Inputs: width (required), height (required), nodeId (required).

resolve_colorA

Look up a color by its registered alias. Returns r, g, b, a values (0–1).

Inputs: alias (required).

resolve_nodeA

Look up a node ID by its registered alias. Returns the node ID previously saved with register_node.

Inputs: alias (required).

screenshot_current_pageA

Export the current Figma page as a base64-encoded PNG. Useful for visual verification of the canvas state.

Inputs: scale.

set_auto_layoutA

Enable auto-layout on a frame and configure direction, spacing, padding, and alignment. Set direction to NONE to disable auto-layout.

Inputs: nodeId (required), wrap, padding, spacing, +5 more.

set_blend_modeC

Set the blend mode of a node layer.

Inputs: mode (required), nodeId (required).

set_corner_radiusB

Set corner radius of a rectangle or frame. Use radius for uniform corners or topLeft/topRight/bottomLeft/bottomRight for individual corners (e.g. pill, tab, card shapes).

Inputs: nodeId (required), radius, topLeft, topRight, +2 more.

set_effectA

Apply effects (drop shadow, inner shadow, layer blur, background blur) to a node. Use mode REPLACE (default) to overwrite all effects, or APPEND to add to existing ones.

Inputs: nodeId (required), effects (required), mode.

set_fill_colorC

Set the fill color of a Figma node.

Inputs: b (required), g (required), r (required), nodeId (required), +1 more.

set_focusB

Scroll the Figma viewport to focus on a node and select it.

Inputs: nodeId (required).

set_gradient_fillB

Apply a gradient fill to a Figma node. Supports LINEAR, RADIAL, ANGULAR (conic), and DIAMOND types. Replaces any existing fills. Stops must be sorted by position (0 → 1).

Inputs: stops (required), nodeId (required), type, angle, +2 more.

set_image_fillA

Set a node's fill to a base64-encoded image. Use with image generation APIs (Replicate, fal.ai) to place rendered imagery directly on canvas.

Inputs: base64 (required), nodeId (required), opacity, mimeType, +1 more.

set_layout_gridC

Apply column, row, or uniform grid guides to a frame.

Inputs: grids (required), nodeId (required).

set_opacityB

Set the opacity of a Figma node (0 = invisible, 1 = fully opaque).

Inputs: nodeId (required), opacity (required).

set_strokeB

Set comprehensive stroke properties on a node: color, weight, position, dash pattern, line cap, and line join.

Inputs: nodeId (required), color, weight, lineCap, +3 more.

set_stroke_colorC

Set the stroke color (and optional weight) of a Figma node.

Inputs: b (required), g (required), r (required), nodeId (required), +2 more.

set_text_styleB

Modify typographic properties of an existing text node without replacing its content. Also use to set or update text box width and wrapping.

Inputs: nodeId (required), width, height, fontSize, +7 more.

set_visibilityC

Show or hide a Figma node.

Inputs: nodeId (required), visible (required).

switch_pageB

Switch to a different page in the Figma document by ID or name.

Inputs: pageId, pageName.

ungroup_nodesA

Ungroup a group node, returning its children to the parent.

Inputs: nodeId (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    C2.9/5.0

    Scored across 58 tools

    Disambiguation3/5

    Most tools target a distinct resource/action, but several families overlap: get_components vs get_library_components both list local components; set_stroke_color vs set_stroke overlap; multiple fill-setting tools and batch tools can be confused. Descriptions often clarify the intended use, but boundaries are not consistently crisp.

    Naming Consistency4/5

    Names are consistently snake_case and mostly follow a verb_noun pattern such as create_frame, set_fill_color, and delete_node. Minor deviations like health_check and boolean_operation are still readable and do not significantly harm consistency.

    Tool Count1/5

    With 58 tools, the surface is far beyond the typical 3–15 well-scoped range and exceeds the 50+ threshold for extreme over-proliferation. While Figma is broad, many operations could be consolidated or handled through batch/parameterized tools.

    Completeness4/5

    The surface covers most of the Figma vector/design workflow: creation, read/inspect, modification, styling, components, styles, export, pages, aliases, and batching. Minor gaps remain, such as editing existing text content and fuller page management like rename/delete, but core operations are well covered.

    Maintenance

    ActivitySlowing
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      B
      maintenance
      Local-first MCP bridge for live Figma documents, enabling design inspection, editing, asset export, component authoring, and variable management through a plugin and WebSocket server without consuming Figma REST API requests.
      1
      MIT
    • A
      license
      Not graded
      quality
      A
      maintenance
      Enables AI agents to read and write Figma designs through a local WebSocket relay, turning Figma selections into framework-aware code and building/editing designs directly on the canvas. Provides 112 MCP tools for bidirectional design-code workflows with support for any MCP client.
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables MCP-compatible AI clients to read and modify the user's currently open Figma file by executing JavaScript in Figma's sandbox, all through a local bridge with status monitoring, node jumping, and automatic rollback on errors.
      3
      MIT