OpenPencil is a free, open-source Figma alternative that opens and saves native .fig files. It runs in the browser and as a desktop app for macOS, Windows, and Linux.
If you already have a UI screen in Figma, you can continue working on its layout and components in OpenPencil. Make the changes on the canvas yourself or ask the built-in AI assistant to edit the document, then refine the result visually.
A coding agent can inspect and modify that design through MCP. You can export images, SVG assets, or frontend component code when you’re ready to implement the UI.
Features
- Open and save Figma
.figfiles, open supported.pendocuments, and copy compatible elements between OpenPencil and Figma. - Draw and edit frames, text, vector shapes, components, variants, variables, and flex or CSS Grid layouts.
- Ask the built-in AI assistant to create or change designs using more than 100 shared design tools.
- Use Claude Code, Codex, and other coding agents from the desktop app, or connect external agents through MCP.
- Inspect, lint, convert, query, and export design files from a headless CLI.
- Import HTML/CSS or an existing web page as editable layers, then export images, SVG, JSX, or frontend components.
- Inspect design tokens, contrast, spacing, and touch targets using the Lint panel and CLI analysis tools.
- Share a design room for real-time co-editing, live cursors, viewport following, and voice calls.
Edit Figma Files and Build UI Components
A Figma .fig file opens with editable pages, frames, text, vectors, and components. Adjust a layout or change the text, then save the design back to .fig. OpenPencil also supports copying selected layers between its canvas and Figma through the clipboard.
For new interfaces, create frames and arrange their contents with auto layout or CSS Grid. Components can have variants, instance overrides, and design variables for colors, spacing, and different modes such as light and dark. The editor also lets you assign interactive behaviors to components such as tabs, switches, and text fields, then try those controls in Preview.
The Lint tab flags issues including low text contrast, undersized touch targets, hardcoded colors, and inconsistent spacing. Select an issue to locate the affected layer, or apply a suggested correction where one is offered.
Create and Modify Designs with AI
Open AI Chat with Cmd+J on macOS or Ctrl+J on Windows and Linux.
For example, ask the assistant to create a pricing card with a heading, two buttons, and consistent spacing, or select an existing frame and request a layout or color change.
The assistant uses the editor’s design tools to create and update nodes, and the changes appear on the canvas with undo support.
OpenPencil can use an API key from Anthropic, OpenAI, Google AI, OpenRouter, DeepSeek, and more, as well as a server endpoint. Configure the model in Settings -> Models or use the guided setup.
The desktop editor can also launch a coding agent you already use, including Claude Code, Codex, and Pi. Install the agent’s local integration, sign in to its account, and run the setup to assign it to the design role.
Export Designs and Frontend Code
Select a layer or frame and use the Export controls to create PNG, JPG, WEBP, or SVG assets. Image exports offer multiple scales, and you can copy artwork as SVG, PNG, or JSX from the context menu.
The Code tab shows generated HTML, Design JSX, and Vue or React component code with CSS or Tailwind styling. It can also link Design JSX edits back to the visual layers.
For existing web layouts, the CLI can import an HTML file with its CSS or import a page URL into an editable .fig document.
How to Get Started
Use the Web Editor
Open the official web app and create a design or open a local file.
Install the Desktop App
Download a build for macOS, Windows, or Linux from the official GitHub releases.
On macOS, install the signed app with Homebrew:
brew install --cask openpencilAutomate Design Files with the CLI
The OpenPencil CLI can inspect design files, find specific layers, check design consistency, and export assets or frontend code from the terminal. File-based commands work with a local document even if the desktop editor is closed.
Install the CLI with NPM:
npm install -g @open-pencil/cliUse design.fig as the file path in the examples below. Commands that accept a document path can connect to the open desktop editor when you omit that argument.
| Task | Command |
|---|---|
| Show page, node, and font information | openpencil info design.fig |
| List pages in a document | openpencil pages design.fig |
| Inspect the layer hierarchy | openpencil tree design.fig --depth 3 |
| Find text nodes | openpencil find design.fig --type TEXT |
| Find layers with Header in the name | openpencil find design.fig --name "Header" |
Inspect a layer by an ID from the tree output | openpencil node design.fig --id NODE_ID |
| Find frames narrower than 300px | openpencil query design.fig "//FRAME[@width < 300]" |
| Export a JPG at 2× resolution | openpencil export design.fig -f jpg -s 2 |
| Export an individual layer as SVG | openpencil export design.fig -f svg --node NODE_ID |
| Export JSX with Tailwind classes | openpencil export design.fig -f tailwind-jsx |
| Export CSS custom properties for design tokens | openpencil tokens design.fig > tokens.css |
| Export Tailwind v4 theme variables | openpencil tokens design.fig --format tailwind > theme.css |
| Generate Vue Storybook stories | openpencil export design.fig -f storybook --framework vue -o src/stories |
| Convert a supported .pen design to .fig | openpencil convert design.pen design.fig |
| Lint a design with strict rules | openpencil lint design.fig --preset strict |
| Analyze colors used in the document | openpencil analyze colors design.fig |
| Analyze layout spacing | openpencil analyze spacing design.fig --grid 8 |
| Import an HTML/CSS design as editable layers | openpencil import card.html --css card.css -o card.fig |
| Compare two design revisions | openpencil diff files before.fig after.fig |
| List documents open in the desktop editor | openpencil documents list --json |
Inspect a design and export one component
For an existing Figma design, list its pages and inspect the layer hierarchy before targeting a specific frame.
The commands below identify pages, find frames, and report naming, layout, and accessibility issues.
openpencil pages design.fig
openpencil tree design.fig --depth 3
openpencil find design.fig --type FRAME
openpencil lint design.fig --preset strict
openpencil export design.fig -f svg --node NODE_ID -o component.svgPrepare UI assets and tokens for frontend development
After the design is ready, export code and design tokens for your frontend project. tailwind-jsx generates JSX with Tailwind utility classes, tokens writes design variables into CSS or a Tailwind v4 theme, and Storybook export creates component stories.
openpencil export design.fig -f tailwind-jsx -o design.jsx
openpencil tokens design.fig --format tailwind > theme.css
openpencil export design.fig -f storybook --framework react -o src/storiesTo inspect a document already open in the desktop editor, run openpencil documents list --json, then openpencil tree to inspect its active document.
Connect AI Coding Agents Through MCP
OpenPencil’s official MCP server allows you to connect an external coding agent to the design editor. For editing the live canvas, open the OpenPencil desktop app and load a document before connecting your MCP client.
Connect Claude Code or Cursor
Install the local MCP package and register the stdio command in Claude Code.
npm install -g @open-pencil/mcp
claude mcp add --scope user open-pencil -- openpencil-mcp
claude mcp listAfter registration, claude mcp list lists the configured server. With OpenPencil running, Claude Code can send requests to the live document. When it first calls an MCP tool, approve the requested access in Claude Code.
In Cursor, add the equivalent stdio server to your project’s .cursor/mcp.json (or its MCP configuration UI):
{
"mcpServers": {
"open-pencil": {
"command": "openpencil-mcp"
}
}
}Restart or reconnect the MCP client after saving the configuration. The stdio transport locates the running OpenPencil app automatically.
What the connected agent can do
For example, ask your connected agent: “Inspect the current design, find the pricing card, change its background color, increase the spacing between its buttons, and save the updated file.”
The agent can use get_page_tree and find_nodes to locate layers, get_node to inspect a selected element, set_fill or set_layout to change it, and save_document to write the changes to .fig. For a new component, create_shape or render can create frames and nested design elements.
If several documents are open, the agent can call list_documents to get stable document and page IDs before editing the intended canvas. OpenPencil also exposes export_image and export_svg to retrieve assets from the current design.
Limit what your agent can access
In OpenPencil, open Settings → MCP to control which tools the local server can expose. If you disabled individual tools before upgrading to 0.17, check the list again. The upgrade can re-enable tools that changed names.
For review-only use, choose Settings -> MCP -> Local server -> Share only the selection. In that mode, connected agents can inspect the selected layers with read-only tools but cannot edit the document, open other files, or change settings.
Restart the MCP server and reconnect your client after changing tool access or selection-only settings.
Use the local HTTP transport for scripts
For a browser extension or custom HTTP client, start the separate Streamable HTTP server:
openpencil-mcp-httpBy default it listens on 127.0.0.1:7600, with the MCP endpoint at http://127.0.0.1:7600/mcp and a connection-status endpoint at http://127.0.0.1:7600/health.
If you need a stable token for your own client, set OPENPENCIL_MCP_AUTH_TOKEN before starting the server and configure the client to send it.
For HTTP clients that open or save design files, set OPENPENCIL_MCP_ROOT to the specific folder you intend to share. The server restricts file access to this root. A browser client running on another origin also needs that origin allowed through OPENPENCIL_MCP_CORS_ORIGIN.
Collaborate on a Design
Select Share -> Share this file and send the generated room link to a teammate. Anyone with that link can join the room and edit the document with live cursors and selections. If your link starts with /share/ after the domain, share the document again to generate a /rooms/ link. Everyone in the room needs OpenPencil 0.17 or later.
Peer-to-peer rooms synchronize edits through WebRTC and Yjs. A participant who has the document must be online for another device to load a room that has no local copy.
For storage across sessions, connect your own S3-compatible bucket through Settings -> Storage.
Build OpenPencil from Source
Clone the repository and start the web editor:
git clone https://github.com/open-pencil/open-pencil.git
cd open-pencil
bun install
bun run devThe local development server opens at http://localhost:1420. For the desktop editor, run:
bun run tauri devDesktop Build Prerequisites
On macOS, install Apple command-line tools and Tauri CLI v2:
xcode-select --install
cargo install tauri-cli --version "^2"On Windows, select the stable MSVC Rust toolchain and install the Visual Studio Build Tools Desktop development with C++ workload:
rustup default stable-msvcOn Debian or Ubuntu, install the WebKitGTK and other native build dependencies:
sudo apt install libwebkit2gtk-4.1-dev build-essential curl wget file \
libxdo-dev libssl-dev libayatana-appindicator3-dev librsvg2-devBuild and Test Commands
| Command | Description |
|---|---|
bun run dev | Dev server at http://localhost:1420 |
bun run build | Production build |
bun run check | Lint + typecheck |
bun run test | E2E visual regression (Playwright) |
bun run test:update | Regenerate screenshot baselines |
bun run test:unit | Unit tests |
bun run tauri dev | Desktop app with hot reload (requires Rust) |
bun run tauri build | Production desktop build |
bun run tauri build --target universal-apple-darwin | macOS universal binary |
Pricing and Privacy
The core OpenPencil editor is free and open source under the MIT License.
Design documents stay on your device during local editing. When you use an online AI provider, your AI request is sent through the connection you configured.
Pros
- Existing Figma work can be edited directly in an app through native
.figfiles. - Designers and developers can work on the same document through the canvas, AI chat, and scripting tools.
- Code export, linting, and design-token inspection help prepare UI components for implementation.
- Local editing and peer-to-peer rooms.
Cons
- AI billing follows the connected provider or coding-agent plan.
- Desktop agent integration requires local setup.
- Building the desktop app from source requires Bun, Rust, and native development dependencies.
FAQs
Can OpenPencil open Figma files without a Figma account?
Yes. Open a local .fig file directly in the editor. Copying content from the Figma app requires access to the original design there.
Can I save a .pen file after editing it?
OpenPencil opens supported .pen documents and can convert supported design files to .fig. Its native editing and save workflow centers on .fig. Export or convert the design to the required supported output format.
Can Claude Code or Codex edit a design through OpenPencil?
Yes. Connect an agent through the MCP server or use a supported desktop coding-agent integration. The agent can inspect and modify document nodes using OpenPencil tools.
Can I work on designs offline?
The desktop editor can work with locally saved design files offline. Online AI models, shared rooms, and Cloud storage need an internet connection.
Related Resources
- Penpot: Open-Source Figma Alternative for UI Design and AI Workflows
- Doop: Open-Source Paper.design Alternative for AI Agents
- Google Stitch: Free AI Vibe Design Tool with Agent and Web Export
- Figma Dev Mode MCP Server: Generate Code from Figma Designs
- Open Design: A Free Open-Source Claude Design Alternative
Last Updated: Nov 23, 2026










