fig-inspector-mcp
Offline inspection of Figma .fig files: lists pages and views, extracts flows and prototype interactions, expands component instances and overrides, resolves design tokens/variables, measures spacing/layout, generates CSS, and exports embedded images and SVG icons without Figma API tokens or cloud calls.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
fig-inspector
Offline Figma (.fig) inspector, Dev-Mode HTML viewer, CLI, and Model Context Protocol (MCP) server for developers and AI agents — powered by openfig-core with zero Figma API tokens, zero cloud calls, and zero WASM overhead.
Key Capabilities
Full Component Instance Expansion: expands
INSTANCE→SYMBOLhierarchies up to 30+ levels deep, including nested design-system slots.Scoped
symbolOverrides& Cross-Variant Resolution: steps downguidPathrespectingoverrideKey,componentPropAssignments(TEXT_DATA,VISIBLE,OVERRIDDEN_SYMBOL_ID), outer-over-inner precedence, and cross-variant layer matching within the sameComponentSet.True 2×3 Affine Matrix Composition: accurately computes local and view-relative bounding boxes across flipped (
m00: -1,m11: -1) and rotated layers.Flow & Prototype Extraction (
flows/fig_get_flows): groups screens into ordered horizontal flow rows (section+Y, sorted byX), extracts UX notes/annotations, and exposesprototypeInteractions(ON_CLICK→ destination /BACK).Configurable Component Library Matching (
match-components/fig_match_components): maps Figma components against any local component library directory configured via--components-dir,FIG_COMPONENTS_DIR, or MCP parameters — with zero hardcoded vendor paths.Internal Helper Noise Filtering: filters private/internal design-system helper components (prefixed with
⛔️,⛔,_,.) by default in view summaries (--include-internal/includeInternal: trueto include them).Auto Layout, Spacing, Tokens & CSS: extracts
mode,gap,padding,flex-grow,align-self, parent margins, visual sibling gaps,VARIABLE_SET/VARIABLEcollections, bound tokens (variableConsumptionMap,paint.colorVar), independent border weights, shadows/blurs,clipsContent, and mixed rich-text segments.Assets & Vectors: exports embedded
images/(PNG/JPEG/WEBP/GIF) and standalone<svg>icons.Bounded LRU Cache: caches parsed
.figdocuments by(filePath, mtimeMs)(up to 8 entries) for sub-millisecond repeat queries without unbounded memory growth.
Related MCP server: figctx-mcp
Architecture
src/
├── fig-geometry.mjs # Affine 2x3 matrix math, colors, paints, layout, typography & SVG path extraction
├── fig-overrides.mjs # Scoped guidPath stepping, cross-variant ComponentSet matching, prop & text overrides
├── fig-loader.mjs # Bounded LRU .fig loader, parentMap, varsByKey, variantIndex, compound ID resolution
├── fig-inspector-core.mjs # Tree inspection, spacing, views, summaries, distance measurement, override-aware search
├── fig-flows.mjs # Horizontal flow row grouping, UX annotation extraction, prototypeInteractions
├── fig-catalog.mjs # Configurable local component catalog scanner and Figma-to-library matcher
├── fig-export.mjs # Markdown spec, CSS generator, image format/data-URI helpers, standalone SVG export
├── fig-reader.mjs # Backwards-compatible barrel re-exporting all core functions
├── html-viewer.mjs # Self-contained interactive Dev-Mode HTML visual inspector
├── cli.mjs # CLI entry point (fig-inspector)
├── mcp-server.mjs # MCP stdio server entry point (fig-inspector-mcp)
└── index.mjs # Public package entry pointInstallation
Requires Node.js >= 20.
git clone https://github.com/PixelDroid19/fig-inspector.git
cd fig-inspector
npm installOptional global link (exposes fig-inspector and fig-inspector-mcp on your PATH):
npm linkCLI Reference
fig-inspector <command> <file.fig> [args] [options]
# or directly:
node src/cli.mjs <command> <file.fig> [args] [options]Command | Description |
| Document stats (size, pages, nodes, components, tokens, images) |
| List all pages ( |
| List screens/views with IDs, dimensions, coordinates, and preview texts |
| Group views into ordered flow rows, UX notes, and prototype interactions |
| Compact AI View Brief (texts, clean components, palette, tokens, image hashes) |
| Inspect node subtree (supports compound instance IDs like |
| Generate copyable CSS with design-token comments |
| Measure exact pixel gaps and edge alignments between two nodes |
| Search node names, text nodes, and overridden text in |
| List |
| Match Figma components against your configured local component library (with metadata, abbreviation expansion, and optional alias map) |
| List design tokens ( |
| Export embedded image(s) with auto-detected extensions |
| Export a vector or icon container as standalone SVG |
| Generate an interactive Dev-Mode HTML viewer |
Examples
# Discover pages and ordered user flows
node src/cli.mjs pages ./design.fig
node src/cli.mjs flows ./design.fig --page "Handoff Dev"
# Get a compact AI brief for a screen
node src/cli.mjs summary ./design.fig 3064:160159
# Match Figma components against your local component library
node src/cli.mjs match-components ./design.fig --components-dir ./packages --view 3064:160159
# Search inside both raw text nodes and instance symbolOverrides
node src/cli.mjs search ./design.fig "Submit" --text
# Export icons and images
node src/cli.mjs export-svg ./design.fig 19:88 --out icon.svg
node src/cli.mjs export-image ./design.fig --all --out-dir ./assets
# Generate an interactive Dev-Mode HTML viewer
node src/cli.mjs viewer ./design.fig --page "Handoff Dev" --out viewer.htmlMCP Server (for AI Agents)
fig-inspector provides a stdio Model Context Protocol (MCP) server (src/mcp-server.mjs) compatible with Claude Desktop, Cursor, Windsurf, Claude Code, Antigravity, and other MCP clients.
Configuration
{
"mcpServers": {
"fig-inspector": {
"command": "node",
"args": ["/absolute/path/to/fig-inspector/src/mcp-server.mjs"],
"env": {
"FIG_DEFAULT_FILE": "/optional/default/design.fig",
"FIG_COMPONENTS_DIR": "/optional/path/to/your/component-library/packages",
"FIG_CATALOG_MAP": "/optional/path/to/component-aliases.json"
}
}
}
}Both environment variables are optional:
FIG_DEFAULT_FILE(or passing the.figpath as the first CLI argument) makesfilePathoptional on every tool call.FIG_COMPONENTS_DIRsets the default local component library directory forfig_match_components.
MCP Tools (14)
Tool | Purpose |
| High-level file stats (pages, node counts, components, tokens, images) |
| List all pages and sections |
| List screens/views with IDs, dimensions, coordinates, and preview texts |
| Group views into ordered flow rows, extract UX notes, and return |
| Compact AI View Brief (texts in reading order, public components, colors + tokens, typography, image hashes) |
| Detailed node tree in |
| Generate copyable CSS with design-token comments for any plain or compound node ID |
| Exact horizontal/vertical pixel gaps and edge alignments between two nodes |
| Search node names, text nodes, and overridden texts inside |
| List |
| Match Figma components against a user-configured local component library directory |
| List design tokens ( |
| Export an embedded image asset by |
| Export a vector/icon node as standalone SVG (returned directly or saved to disk) |
Programmatic JavaScript API
import {
loadFig,
listPages,
listViews,
getFlows,
summarizeView,
inspectNode,
matchFigmaComponents,
nodeToCss,
measureDistance,
exportNodeSvg,
generateHtmlViewer,
} from 'fig-inspector';
const fig = loadFig('./design.fig');
const flows = getFlows(fig, { pageName: 'Handoff Dev' });
const brief = summarizeView(fig, flows.flows[0].steps[0].id);
const matches = matchFigmaComponents(fig, {
componentsDir: './packages',
viewId: brief.id,
});Known Limitations
The HTML viewer renders layout, fills, gradients, embedded bitmaps, shadows, independent borders, rich text, and SVG vector paths; complex Figma boolean blends, custom shaders, and runtime variable-mode switching (Light/Dark evaluation) are not simulated in the HTML preview.
Testing
npm testLicense
MIT © 2026 PixelDroid
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
The Figma MCP server brings Figma design context directly into your AI workflow.
Deterministic Figma to Elementor, Gutenberg, Oxygen, Etch, Divi and HTML layouts for AI agents.
Design canvas for agents: create, edit, render and export Figma-shaped designs over MCP.
Read-only design skills, components and tokens from your Alpy library for any AI agent.
Related MCP Servers
- AlicenseBqualityDmaintenanceEnables offline reading and rendering of Figma .fig files, allowing AI agents to extract design specs, export assets, and generate code without needing the Figma API or network access.262MIT
- AlicenseNot gradedqualityCmaintenanceEnables agents to extract, inspect, search, and bundle design context from local Figma .fig files entirely offline, exposing frame summaries, node context, style tokens, assets, vector SVGs, and visual-match review via MCP.MIT
- AlicenseAqualityBmaintenanceEnables AI agents to read and inspect local Figma .fig files entirely offline, exposing document structure, geometry, styles, text, components, variables, and embedded images via MCP tools.1286 npm5MIT
- AlicenseAqualityBmaintenanceReads a saved Figma .fig file offline and gives coding agents layout, text, variables, assets, renders and frame bundles, with no Figma app, login or API rate limit.2028MIT