figma_batch
Executes up to 6 operations sequentially via the Figma plugin bridge. Each operation specifies a type (bridge handler name) and payload. Returns an array of results in order.
Turn HTML into real Figma layers built from your design system — components, variables, text styles — with raw hex, raw pixel sizes and off-system fonts refused at write time.
LABSCO SUMMARY
Several tools can write into Figma. This one gates the write inside the plugin: a raw hex where a colour variable exists, a raw pixel size where a text style exists, a font outside the system, or a primitive frame where the library already has a component, are refused rather than merely discouraged. Where the design system genuinely has no equivalent, that becomes a line in the build report instead of a raw value quietly left in the file. The knowledge store is the other half — confirmed component recipes and your corrections carry into later builds, scoped per library.
A server that drives a companion Figma plugin to build screens from HTML using your design system. It discovers the library's components, variables, text styles and fill styles, turns them into an enforcement profile, then builds with them — refusing a raw value wherever a design-system equivalent exists, and recording the gap where one does not.
Published as @miapre/mimic-ai and launched over stdio with npx, on Node.js 20.6 or newer, macOS or Windows. It is half of a pair: the companion Figma plugin does the writing and holds the enforcement gate, so Figma has to be open with the plugin running and the design-system library reachable by file key. Everything runs locally, and the project states that design data does not leave the machine.
Follow the published steps — bash <(curl -fsSL https://raw.githubusercontent.com/miapre/mimic-ai/main/install.sh)
USE CASES
Resolve the input, build the frames with auto-layout, and insert real component instances from the library rather than drawing lookalikes.
Discover the components, styles and variables in the design-system file, then compile them into the profile that governs the session.
Validate the node against the enforcement profile, then generate the report naming components used, primitives built and the reason for each.
One call constructs the whole table or chart with DS values applied; the geometry can be computed first if you want to see it.
Update the mapping from HTML element to design-system component and write it to the knowledge store, where later builds pick it up.
The build report records every primitive built because no component existed; the design document compiles what has accumulated across builds.
Counted once with only startup setup. Other versions, modes or optional credentials may expose a different list.
figma_batchExecutes up to 6 operations sequentially via the Figma plugin bridge. Each operation specifies a type (bridge handler name) and payload. Returns an array of results in order.
figma_batch_set_component_textSets ALL text overrides on a component instance in a single call. Pass an array of {textNodeName, content} overrides. Saves 1 tool call per text node vs. individual figma_set_component_text calls. Use after figma_insert_component — configurationHints.textNodes tells you which nodes to override.
figma_change_pageSwitches to a different page in the Figma file.
figma_create_ellipseCreates an ellipse node in Figma. Supports arcData for donut charts.
figma_create_frameCreates an auto-layout frame in Figma. All sizing uses DS variables when available. The name parameter should describe the HTML section or element role (e.g., "Header Section", "Metrics Row", "Card: Revenue"). Meaningful names enable iteration. IMPORTANT: Before creating frames for section-level elements (header, footer, sidebar), first check if the DS has a component for it via mimic_map_components or Figma MCP search_design_system.
figma_create_rectangleCreates a rectangle node in Figma.
figma_create_svgCreates a node from an SVG string in Figma. Useful for icons and custom graphics. Returns unboundChildren — a list of child nodes that need DS variable bindings. You MUST apply figma_set_node_fill to every unbound vector and figma_set_text_style + figma_set_node_fill to every unbound text. Leaving unbound children breaks DS compliance and light/dark mode.
figma_create_textCreates a text node in Figma with DS text style and color variable. The name parameter should describe the HTML element role (e.g., "Page Title", "Card: Revenue Label", "Subtitle"). Meaningful names enable iteration.
figma_delete_nodeDeletes a node from the Figma document. NEVER deletes artboards (top-level frames) — only child nodes within an artboard. To rebuild a screen, create a NEW artboard alongside the existing one.
figma_discover_library_componentsScans existing component instances on the current page to discover available DS library components, their keys, and variant properties. Call during DS discovery phase.
figma_discover_library_stylesDiscovers and caches text styles from a Figma library file.
figma_discover_library_variablesDiscovers and caches variables from a Figma library file.
figma_fill_slotInserts a DS component instance into a SLOT-type component property on an existing instance (Figma Slots, GA June 2026). Use configurationHints.slotProperties from figma_insert_component to find the slotName.
figma_get_component_variantsReturns all variants for a component set.
figma_get_node_childrenReturns the children of a node up to the specified depth.
figma_get_node_parentReturns the parent node info for a given node.
figma_get_node_propsReturns comprehensive properties of a Figma node: type, size, layout, fills, strokes, text styles, variable bindings, and children count.
figma_get_page_nodesReturns top-level nodes (artboards, frames) on the current page.
figma_get_pagesReturns all pages in the current Figma file.
figma_get_selectionReturns the currently selected nodes in Figma.
figma_get_text_infoReturns detailed text information: content, style, font, color, variable bindings.
figma_insert_componentImports and inserts a DS component instance. Returns component info and configuration hints from the knowledge store.
figma_list_fill_stylesReturns all cached fill (color) styles from the DS. Use the style key as fillStyleId in create_frame, create_text, create_rectangle, create_ellipse, or set_node_fill.
figma_list_text_stylesReturns all cached text styles from the DS.
figma_move_nodeMoves a node to a new parent at the specified index.
figma_preload_fill_stylesPreloads fill (color) styles into the DS cache from a library file key. Call when discovery missed fill styles (e.g. library variables not enumerable but fill styles exist in the REST API).
figma_preload_stylesSends text style keys to the plugin for caching. Call during DS setup phase.
figma_preload_variablesStores DS variables in the local cache for enforcement and resolution.
figma_read_variable_valuesReturns cached variable values, optionally filtered by category.
figma_replace_componentReplaces an instance node with a new component instance at the same position.
figma_reset_slotResets a SLOT-type component property back to its default content (Figma Slots, GA June 2026).
figma_restyle_artboardUpdates styling properties on an existing artboard or frame.
figma_select_nodeSelects a node in Figma and scrolls it into view.
figma_set_all_variable_modesSets the default variable mode on ALL variable collections for a node at once. Use this on every new artboard instead of figma_set_variable_mode — it eliminates collection name guessing.
figma_set_component_textSets text on a component instance by finding a text node with the given name. Prefer figma_set_component_text_by_id when configurationHints include text node IDs, because many components contain repeated text node names.
figma_set_component_text_by_idSets text on a component instance using an exact text node ID from configurationHints.textNodes. Use this instead of name-based text overrides when available.
figma_set_layout_sizingUpdates layout sizing, padding, gap, and max width on a frame node.
figma_set_node_fillSets the fill of a node to a DS fill style, color variable, or raw color. Priority: fillStyleId (DS color style) → fillVariable (DS variable) → fill (raw hex/RGB).
figma_set_node_positionSets the absolute x/y position of a node. Use to correct top-level artboard placement after inspecting page nodes.
figma_set_session_defaultsComputes the enforcement profile from cached DS data and sends it to the plugin. Advances to Phase 2 (inventory ready).
figma_set_textSets the text content of a text node.
figma_set_text_styleApplies a DS text style to a text node.
figma_set_variable_modeSets the explicit variable mode on a node for a given collection. Required on every new artboard to render DS variables correctly.
figma_set_variantSets variant properties on a component instance.
figma_set_visibilityShows or hides a node.
figma_swap_main_componentSwaps the main component of an instance to a different component.
figma_validate_ds_complianceValidates a Figma node against the current DS enforcement profile. Returns compliance results from the plugin.
mimic_ai_knowledge_readLoads and returns the full knowledge store contents: components, patterns, gaps, and meta.
mimic_ai_knowledge_writeSaves a pattern, component recipe, or DS gap to the knowledge store.
mimic_build_chartBuilds an entire chart in one tool call. Creates chart container, visualization (SVG or native rectangles), axis labels, grid lines, and legend — all bound to DS variables. Supports line, bar, donut, and radar charts. Reduces chart builds from 30-50 tool calls to 1.
mimic_build_tableBuilds an entire data table in one call. Creates column frames with DS Table header cell and Table cell components, configures all variants, text, and sizing. Requires table cell components in the DS — if missing, returns guidance on creating them. Reduces table builds from 200+ tool calls to 1.
mimic_compute_chartTakes chart data and returns pre-computed geometry for building in Figma. Supports bar, donut, line, radar, scatter, and heatmap.
mimic_discover_dsComplete DS discovery in two steps. Step 1: call with fileKey — discovers variables, text styles, components via plugin API, caches everything, stays at Phase 1. Step 2: call again with communitySearchResults (library names from Figma MCP search_design_system) — verifies no community libraries were missed, then advances to Phase 2 (build-ready). Build tools are BLOCKED until Step 2 completes. If a community library's variables are not discoverable via the plugin API (communityVariablesRequired response), fetch them via Figma MCP search_design_system and pass as externalVariables.
mimic_find_nodeFind a Figma node by its HTML section name from the last build. Returns the node ID and metadata if found, or lists available sections.
mimic_generate_build_reportCompiles build session data into a structured report (markdown or HTML). Advances phase to 5.
mimic_generate_design_mdCompiles current DS knowledge into DESIGN.md format. Returns the content as a string.
mimic_map_componentsMaps HTML element types to DS component keys. Call once to get initial mapping. If FIGMA_TOKEN is configured (REST API discovery), all library components are already cached — missing types after the first call are confirmed gaps, proceed to build. If REST API is not available (no token), search the library via Figma MCP search_design_system for missing types, then call AGAIN with librarySearchResults to confirm gaps.
mimic_pipeline_resolveClassifies input as a URL, file path, or raw HTML and returns the resolved content.
mimic_render_urlPlaceholder for Puppeteer-based URL rendering. Currently returns instructions to provide HTML directly.
mimic_statusReturns plugin connection status, current build phase, enforcement profile, knowledge store summary, and a contextual hint for what to do next.
BEFORE YOU INSTALL
60 tools when we connected. The current documentation describes a consolidated 26-tool surface in which tools such as figma_inspect and figma_update_node absorb several granular ones; the capability is the same.
All 6 documented clients run the server on your machine.
CONTEXT COST
Rated by the size of the 60 tool definitions that ride along on every turn, not by how many there are
INSTALLATION
bash <(curl -fsSL https://raw.githubusercontent.com/miapre/mimic-ai/main/install.sh)This clones the repo to ~/mimic-ai, runs npm install, and prompts for your Figma personal access token
In the Figma desktop app: Plugins > Development > Import plugin from manifest > select ~/mimic-ai/plugin/manifest.json
Each session, start the plugin in Figma: Plugins > Development > Mimic AI > Run
Add the mimic-ai entry to your MCP client (client tabs below); every client needs the Figma plugin running
{
"mcpServers": {
"mimic-ai": {
"command": "npx",
"args": [
"-y",
"@miapre/mimic-ai"
]
}
}
}FIGMA_TOKEN is optional: set it in the server's env block, or in ~/.mimic-ai.json. Without it Mimic still works, falling back to a slower, plugin-only discovery path.
{
"servers": {
"mimic-ai": {
"command": "npx",
"args": [
"-y",
"@miapre/mimic-ai"
]
}
}
}FIGMA_TOKEN is optional: set it in the server's env block, or in ~/.mimic-ai.json. Without it Mimic still works, falling back to a slower, plugin-only discovery path.
{
"mcpServers": {
"mimic-ai": {
"command": "node",
"args": [
"<YOUR_PATH_TO_MIMIC_AI>/mcp.js"
]
}
}
}FIGMA_TOKEN is optional: set it in the server's env block, or in ~/.mimic-ai.json. Without it Mimic still works, falling back to a slower, plugin-only discovery path.