figlens is an offline Figma MCP server and CLI for coding agents, with the goal of turning saved Figma files into design context that agents can use directly, rather than just a screenshot that needs interpretation. It supports hosts such as Claude Code, Codex, Cursor, and OpenCode, and also provides a standalone binary and npm package.
Purpose and main capabilities
- Read design details from source files: read layout, text, styles, variables, Dev Mode annotations, and Ready for dev status; export vector icons as SVG and images as assets. bundle collects the data, assets, and reference render for a given frame; verify reports missing files, font checks, and handoff limitations. MCP nodes can use the out parameter to save large node JSON to a file instead of returning it inline.
- Compare a running interface: compare-image compares your screenshot with figlens's render output and identifies layer names under the differing regions. The official description emphasizes that this is an aid for reviewing differences and render warnings, and does not constitute a guarantee of pixel-perfect matching.
- Track design changes: diff compares saved revisions; changes and watch report updates to tracked local scopes; freshness determines whether the local copy is older than the online file; pull saves a new copy via your own browser login. Design modifications require re-saving the .fig from Figma; this is not live Figma sync. Named accounts can route different designs to separate browser profiles and API token environment variables, and existing default settings require no migration. figlens sources init [DIR] can scan local .fig files and write them to .figlens/sources.json without overwriting existing files; names come from meta.json or the file name, and blank URLs must be filled in before pulling.
- Offline foundation: In Figma, run File > Save local copy, place design.fig next to your code, and afterward a single Figma link is enough; its node id is used to locate the frame. If you have no saved copy, you can copy a layer in Figma (right-click > Copy) and run figlens clipboard screen.fig, but the copied content does not include images or vectoroutlines. A single native binary reads files locally, with no need to run the Figma app, log in, or make network calls to Figma; only the optional freshness check (requires an API token, FIGMA_TOKEN by default) and pull (via browser login) access Figma.
Usage
- Ordinary search requires no extra setup: figlens search design.fig "query" reads the .fig and creates nothing. An optional local index is created only when explicitly requested (figlens index prepare design.fig --scope 0:0), and is then reused across restarts and hosts. The optional semantic or hybrid modes (--mode semantic or hybrid) are experimental features and require you to configure a local model yourself.
- A single installation can add the figlens skill and MCP server to an agent (Node.js 18+). The server is pinned to the plugin release version (npx -y @runkids/figlens@<version> mcp), and updating the plugin switches the version. skillshare can install the same plugin across multiple hosts at once: skillshare plugin add https://github.com/runkids/figlens.git --target claude --target codex --target cursor -g, then update with skillshare plugin update figlens -g.
- If Node.js is unavailable, install the standalone binary (CLI) and configure "command": "figlens", "args": ["mcp"] in the MCP client. After starting a new session, confirm that the figlens tools are listed (in Claude Code, /mcp). No separate skill installation is needed. You can add --root <dir> after mcp to restrict the folders figlens can read and write.
- The only MCP startup options are --root and storage-root-related options; all are optional and repeatable; you must use absolute paths to existing directories. --root is a path boundary, not administrative privilege, and it only restricts the figlens MCP, not other agent tools. There is no figlens mcp --storage option; the actual location is chosen via the storage parameter of the index tool (which allows absolute paths under a storage root) or via the CLI figlens index prepare design.fig --storage /absolute/storage-a. After prepare, figlens remembers that workspace location across restarts and host reuse, so there is no need to repeat storage or --storage-root. Multiple storage roots only expand the allowed locations; they do not distribute, sync, or back up indexes. An existing workspace database cannot be moved merely by specifying another root; figlens will reject conflicting locations.
- A single package provides the CLI, MCP, viewer, /figlens command, and skill. After installing the same package in OpenCode V2 and OMP, restart the host and run /figlens help. You can run it via npm or install the standalone binary; npx runs the binary of the package version it resolves to. Update script installations with figlens update, and Homebrew installations with brew upgrade figlens. The binary covers macOS (Apple silicon, Intel), Linux (arm64, x86_64), and Windows (x86_64).
- Use CLI agents can read guidance matching the binary version via figlens workflow build (as well as audit, images, search, plan, planning-details, and optionally yolo), or read it from the agent skill.
- The agent skill is optional: it contains only instructions and must be used together with the CLI or MCP; MCP and Pi setups do not need it. It is recommended to install it once with skillshare and sync it to each agent, or copy skills/figlens/ from the repository or release package into the agent skills directory (Claude Code: ~/.claude/skills/). Installed skills are updated separately from the binary, and figlens workflow always matches.
When to use Suitable for scenarios where designs need to flow as files: remote agents, CI, offline work, handoffs between agents, and unlimited repeated reads. If an agent must view a live design without an export step, the official guidance recommends using the official Figma MCP.
Limitations and caveats
- Snapshot, not live sync: after design changes, you must re-export the .fig; figlens cannot download designs from a Figma URL.
- .fig is an undisclosed format: figlens decodes the schema embedded in the file, and new Figma exports may require updating figlens.
- Fonts and text: font files are not bundled; overridden text may retain the layout saved by Figma. Use licensed project fonts and compare the results.
- Supported coverage: see the issue tracker for rendering improvements and handoff semantics; consult the documentation for the current semantic coverage.
- Output must be checked: read bundle warnings, missing-assets.json, and unresolved variables in context.md, then compare the implementation with the design. Known visible rendering limitations appear in the node _figlens.renderDiagnostics, bounded inspect summaries, and bundle and export warnings; missing-assets.json lists only asset failures. The absence of warnings does not mean pixel-perfect matching. Background blurs exceeding 64 per single export are omitted and noted only in these warnings (the first 20 nodes are listed, followed by a count).
- Reading .fig is offline, but installing and updating figlens, gs:// inputs, optional freshness checks and pull, model providers, and project dependencies still require network.
- Development runs Rust only in Docker: docker compose run --rm dev cargo test. The project is MIT licensed, is an independent project, and is not affiliated with, endorsed by, or sponsored by Figma; the .fig format is not public and may change, so only use files and resources you have the right to access and share.
The official demo shows Pi using /figlens plan to read a dashboard frame from a local .fig, build it with React and Tailwind CSS, and inspect and fix the running interface; the video is an edited time-lapse, not a benchmark or a pixel-level promise. There is also a controlled task-list study claiming that all six figlens-based attempts preserved all 19 visible text items as real DOM text and all 4 icons, and that CLI and MCP extraction also passed when Docker networking was disabled.