Figma MCP Write Server

by oO

240 downloads Not rated yet View license
GitHub

About

A Model Context Protocol (MCP) server for writing to Figma files

Details

License
View license

Explore

- πŸ”Έ Corner Properties: Basic cornerRadius or individual corner radii (topLeftRadius, topRightRadius, etc.)
- πŸ”Έ Corner Smoothing: iOS-style squircle effect with cornerSmoothing (0-1)
- πŸ”Έ Visual Controls: opacity (transparency), visible (show/hide), rotation (degrees)
- πŸ”Έ Interaction: locked state to prevent user modifications
- πŸ”Έ Shape Types: Create star and polygon nodes with pointCount and innerRadius
- πŸ”Έ Frame Features: clipsContent to control overflow behavior
- πŸ”Έ Enhanced Responses: Warnings for clamped values, echo back applied properties

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name Figma MCP Write Server
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

- Node.js 18+
- Figma desktop app or browser access
- MCP-compatible client (Claude Desktop, Cursor, etc.)

npm install

1. Open Figma
2. Go to Plugins β†’ Development β†’ Import plugin from manifest
3. Select figma-plugin/manifest.json
4. Run the plugin to establish connection

For Claude Desktop, add to ~/.claude/claude_desktop_config.json:

{
"mcpServers": {
"figma-write": {
"command": "node",
"args": ["/path/to/figma-mcp-write-server/dist/index.js"]
}
}
}

For Cursor, add to MCP configuration:

{
"mcpServers": {
"figma-write": {
"command": "node",
"args": ["/path/to/figma-mcp-write-server/dist/index.js"]
}
}
}

Common use cases:
- Create Layout: "Create a header frame with title and subtitle"
- Auto Layout: "Make this frame arrange its children vertically with 16px spacing" (NEW v0.13.0)
- Constraints: "Pin this sidebar to the left and stretch to full height" (NEW v0.13.0)
- Typography: "Make a styled heading with mixed formatting"
- Design System: "Create color palette and apply styles consistently"
- Components: "Build button variants with different colors and styles"
- Batch Operations: "Select all text elements and update font size"

πŸ“š Examples & Usage Guide β†’

- FIGMA_MCP_PORT - WebSocket server port (default: 8765)

create_node

**ENHANCED** Create nodes with advanced visual properties

create_text

Create text with typography features

manage_styles

Style management (paint, text, effect, grid)

manage_auto_layout

**NEW v0.13.0** Auto layout configuration

manage_constraints

**NEW v0.13.0** Constraints management

manage_hierarchy

Layer & hierarchy management (grouping, depth, parent-child)

update_node

**ENHANCED** Update nodes with advanced visual properties

move_node

Move nodes to new positions

delete_node

Delete nodes

duplicate_node

Duplicate nodes

get_selection

Get currently selected nodes

set_selection

Set node selection

get_page_nodes

List all nodes on current page with filtering options

export_node

Export nodes as images

get_plugin_status

Check plugin connection

| Tool | Description | Parameters |
|------|-------------|------------|
| create_node | ENHANCED Create nodes with advanced visual properties | nodeType (rectangle/ellipse/text/frame/star/polygon), position, size, corners, opacity, rotation, styling, etc. |
| create_text | Create text with typography features | characters, fontFamily, fontSize, styleRanges, textAlign, etc. |
| manage_styles | Style management (paint, text, effect, grid) | operation, styleType, styleName, color, fontSize, effects, etc. |
| manage_auto_layout | NEW v0.13.0 Auto layout configuration | operation, nodeId, direction, spacing, padding, alignment, resizing, etc. |
| manage_constraints | NEW v0.13.0 Constraints management | operation, nodeId, horizontal, vertical |
| manage_hierarchy | Layer & hierarchy management (grouping, depth, parent-child) | operation, nodeId, nodeIds, targetNodeId, newParentId, newIndex, etc. |
| update_node | ENHANCED Update nodes with advanced visual properties | nodeId, width, height, x, y, cornerRadius, fillColor, opacity, rotation, visible, locked, etc. |
| move_node | Move nodes to new positions | nodeId, x, y |
| delete_node | Delete nodes | nodeId |
| duplicate_node | Duplicate nodes | nodeId, offsetX, offsetY |
| get_selection | Get currently selected nodes | - |
| set_selection | Set node selection | nodeIds |
| get_page_nodes | List all nodes on current page with filtering options | detail, includeHidden, includePages, nodeTypes, maxDepth |
| export_node | Export nodes as images | nodeId, format, scale |
| get_plugin_status | Check plugin connection | - |

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "figma mcp write server": {
            "figma-write": {
                "command": "node",
                "args": [
                    "/path/to/figma-mcp-write-server/dist/index.js"
                ]
            }
        }
    }
}

McpServers

{
    "figma-write": {
        "command": "node",
        "args": [
            "/path/to/figma-mcp-write-server/dist/index.js"
        ]
    }
}

A Model Context Protocol (MCP) server that provides write access to Figma through the Plugin API, enabling AI agents to create, modify, and manage Figma designs programmatically.

_Designed and Architected with ❀️ by a real human. Coded by an AI Assistant._

πŸ†• What's New in v0.13.0

Auto Layout & Constraints - Build responsive designs with automatic content arrangement:
- πŸ”„ Auto Layout: Enable frames that automatically arrange children vertically or horizontally
- πŸ“ Constraints: Pin elements to edges, center them, or make them scale proportionally
- 🎯 Integration: Move elements into auto layout containers with automatic positioning
- πŸ› οΈ Configuration: Configure spacing, padding, alignment, and resizing behavior programmatically

πŸš€ Overview

Because the Figma REST API is mostly read-only, this project uses the Plugin API to enable full write operations. This allows AI agents to:

- βœ… Create design elements (rectangles, ellipses, text, frames)
- βœ… Typography with mixed styling and text formatting
- βœ… Style Management for paint, text, effect, and grid styles
- βœ… Auto Layout & Constraints for responsive design and automatic arrangement
- βœ… Layer & Hierarchy management (grouping, depth sorting, parent-child relationships)
- βœ… Modify existing nodes (properties, position, styling)
- βœ… Delete and duplicate design elements
- βœ… Manage selections and page content
- βœ… Export designs programmatically

πŸ—οΈ Architecture

Direct communication design eliminates complexity and improves reliability.

Components

1. MCP Server (src/)
- MCP Server (mcp-server.ts) - Built-in WebSocket server with direct plugin communication - Entry Point (index.ts) - CLI interface with configuration options - Type Definitions (types.ts) - Shared types and Zod schemas
2. Figma Plugin (figma-plugin/)
- Plugin (code.js) - WebSocket client that connects to MCP server - UI (ui.html) - Real-time status monitoring and connection feedback - Plugin Manifest (manifest.json) - Standard Figma plugin configuration

πŸ”„ How It Works

graph LR
    subgraph Agent
        A[AI Agent/Claude] --> B[MCP Client]
    end
    subgraph Figma
        D[Figma Plugin] --> E[Figma Design]
    end
    B --> C[MCP Server]
    C --> D

Architecture Benefits:
- Single process design - MCP server includes WebSocket server
- Direct WebSocket connection with auto-reconnection
- Error handling and status reporting
- No complex bridges or multiple processes
- Standardized port 8765 for all communication

1. AI Agent calls MCP tools (e.g., create_node)
2. MCP Server validates parameters and connects to plugin
3. Figma Plugin receives message and executes operation using Plugin API
4. Results are sent back to the MCP server and then to the AI agent

πŸ“‹ Available MCP Tools

| Tool | Description | Parameters |
|------|-------------|------------|
| create_node | ENHANCED Create nodes with advanced visual properties | nodeType (rectangle/ellipse/text/frame/star/polygon), position, size, corners, opacity, rotation, styling, etc. |
| create_text | Create text with typography features | characters, fontFamily, fontSize, styleRanges, textAlign, etc. |
| manage_styles | Style management (paint, text, effect, grid) | operation, styleType, styleName, color, fontSize, effects, etc. |
| manage_auto_layout | NEW v0.13.0 Auto layout configuration | operation, nodeId, direction, spacing, padding, alignment, resizing, etc. |
| manage_constraints | NEW v0.13.0 Constraints management | operation, nodeId, horizontal, vertical |
| manage_hierarchy | Layer & hierarchy management (grouping, depth, parent-child) | operation, nodeId, nodeIds, targetNodeId, newParentId, newIndex, etc. |
| update_node | ENHANCED Update nodes with advanced visual properties | nodeId, width, height, x, y, cornerRadius, fillColor, opacity, rotation, visible, locked, etc. |
| move_node | Move nodes to new positions | nodeId, x, y |
| delete_node | Delete nodes | nodeId |
| duplicate_node | Duplicate nodes | nodeId, offsetX, offsetY |
| get_selection | Get currently selected nodes | - |
| set_selection | Set node selection | nodeIds |
| get_page_nodes | List all nodes on current page with filtering options | detail, includeHidden, includePages, nodeTypes, maxDepth |
| export_node | Export nodes as images | nodeId, format, scale |
| get_plugin_status | Check plugin connection | - |

✨ Enhanced Node Creation & Updates

New Features in create_node and update_node:

- πŸ”Έ Corner Properties: Basic cornerRadius or individual corner radii (topLeftRadius, topRightRadius, etc.) - πŸ”Έ Corner Smoothing: iOS-style squircle effect with cornerSmoothing (0-1) - πŸ”Έ Visual Controls: opacity (transparency), visible (show/hide), rotation (degrees) - πŸ”Έ Interaction: locked state to prevent user modifications - πŸ”Έ Shape Types: Create star and polygon nodes with pointCount and innerRadius - πŸ”Έ Frame Features: clipsContent to control overflow behavior - πŸ”Έ Enhanced Responses: Warnings for clamped values, echo back applied properties

Example: Enhanced Rectangle

{
  "nodeType": "rectangle",
  "width": 200, "height": 100,
  "cornerRadius": 12,
  "cornerSmoothing": 0.6,
  "fillColor": "#FFFFFF",
  "opacity": 0.9,
  "rotation": 5
}

Example: Custom Star

{
  "nodeType": "star",
  "width": 50, "height": 50,
  "pointCount": 5,
  "innerRadius": 0.4,
  "fillColor": "#FFD700"
}

πŸ“„ Enhanced Page Navigation

get_page_nodes Parameters

The get_page_nodes tool now supports advanced filtering and detail control:

Detail Levels:
- simple: Returns only id, name, type for each node
- standard (default): Includes position, size, hierarchy info
- detailed: All available properties including fills, effects, layout properties

Filtering Options:
- includeHidden: Include invisible nodes (default: false)
- includePages: Include the page node itself (default: false)
- nodeTypes: Filter by specific types like ["FRAME", "TEXT"]
- maxDepth: Limit hierarchy traversal depth

Example: Simple Node List

{
  "detail": "simple",
  "nodeTypes": ["FRAME", "TEXT"]
}
Returns: [{"id": "123:1", "name": "Header", "type": "FRAME"}, ...]

Example: Detailed Analysis

{
  "detail": "detailed",
  "includeHidden": true,
  "maxDepth": 2
}
Returns: Full node properties with hierarchy limited to 2 levels

πŸ› οΈ Installation & Setup

Prerequisites

- Node.js 18+ - Figma desktop app or browser access - MCP-compatible client (Claude Desktop, Cursor, etc.)

1. Clone Repository

git clone https://github.com/oO/figma-mcp-write-server.git
cd figma-mcp-write-server

2. Install Dependencies

npm install

3. Build the Project

npm run build

4. Start the Server

Production:
```bash

No reviews yet β€” be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.