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.
MCP Server Overview
OpenPencil provides a Model Context Protocol (MCP) server that lets AI coding assistants read and modify.fig files programmatically. Connect tools like Claude Code, Cursor, Windsurf, or custom scripts to create, inspect, and transform design files without a GUI.
What is MCP?
The Model Context Protocol is an open standard that enables AI assistants to interact with external tools and data sources. OpenPencil’s MCP server exposes 75+ design operations as tool calls that AI models can invoke.Key Features
- 75+ tools — create shapes, set fills/strokes/layout, manage variables, boolean operations, vector manipulation, viewport control
- Headless file operations — open, save, and create
.figfiles without the desktop app - Two transports — Stdio for IDE integrations (Claude Code, Cursor), HTTP for scripts and CI
- Full Figma Plugin API compatibility — familiar abstractions if you’ve worked with Figma plugins
- Security controls — file access restrictions, optional auth, eval tool toggles
Architecture
The MCP server reuses OpenPencil’s core tool definitions from@open-pencil/core. Each tool:
- Operates on a
FigmaAPIinstance (Plugin API compatible) - Has typed parameters (string, number, boolean, color, string arrays)
- Returns JSON results or errors
- Is automatically exposed via both stdio and HTTP transports
Available Tools
Tools are organized into categories:- Read —
get_selection,get_page_tree,get_node,find_nodes - Create —
create_shape,render(JSX),create_component,create_instance,create_page - Modify —
set_fill,set_stroke,set_effects,update_node,set_layout - Structure —
delete_node,clone_node,reparent_node,group_nodes,ungroup_node - Components —
create_component,create_instance - Pages —
list_pages,switch_page,create_page - Variables —
list_variables,create_variable,set_variable,bind_variable - Boolean operations —
boolean_union,boolean_subtract,boolean_intersect,boolean_exclude - Vector paths —
path_get,path_set,path_scale,path_flip - Viewport —
viewport_get,viewport_set,viewport_zoom_to_fit - Text —
set_text,set_font,set_text_properties - Eval —
eval(execute arbitrary JavaScript with Figma API access)
Transport Options
Stdio Transport
For IDE integrations (Claude Code, Cursor, Windsurf). The AI assistant spawnsopenpencil-mcp as a subprocess and communicates over stdin/stdout.
Use when:
- Integrating with Claude Code, Cursor, Windsurf, or other MCP-compatible IDEs
- You want the assistant to edit
.figfiles in your project
HTTP Transport
For scripts, browser extensions, CI pipelines, or custom integrations. Starts an HTTP server with SSE (Server-Sent Events) streaming. Use when:- Writing Node.js/Bun scripts to automate design file operations
- Building a browser extension or web tool
- Running design linting or export in CI
- Need multi-session support (each HTTP session maintains separate document state)
Security Model
- Stdio — inherits file permissions from the parent process.
evaltool is enabled by default. - HTTP — restricts file access to
OPENPENCIL_MCP_ROOT(defaults to current working directory).evaltool is disabled. Optional bearer token auth.
Installation
Install the MCP server globally:bunx to run without installing:
Next Steps
- Stdio Transport Setup — configure Claude Code, Cursor, or Windsurf
- HTTP Transport Setup — run the HTTP server for scripts and CI
- Tools Reference — browse all 75+ available tools