Skip to main content
Glama

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
FIGMA_PERSONAL_ACCESS_TOKENYesPersonal Access Token for Figma REST API to resolve published component keys. Generate in Figma desktop: Profile picture → Settings → Personal access tokens.

Capabilities

Features and capabilities supported by this server

CapabilityDetails
tools
{}

Tools

Functions exposed to the LLM to take actions

NameDescription
mimic_statusA

Check Mimic AI readiness — the reviewer for your design system. Returns bridge status, plugin connection, DS knowledge (patterns, recipes, gaps, catalog freshness), and learning progress. Call at session start. If first_run is true, guide DS connection.

figma_insert_componentA

Insert a library component instance into a Figma frame. Use this to insert any published component from your design system library — navigation bars, headers, footers, section titles, cards, buttons, badges, and so on. This inserts the real library instance — not a recreation. Provide componentKey (preferred, from a DS search result) OR nodeId (component node ID in the library file).

figma_create_frameA

Create an auto-layout frame. Use for application shells, content containers, cards, rows, columns.

figma_create_textA

Create a text node. For DS compliance, always pass textStyleId (a DS text style ID from figma_list_text_styles) AND fillVariable (a DS color variable path). Raw fontSize/fontWeight/lineHeight are accepted as fallbacks but DS styles are preferred.

figma_create_rectangleA

Create a rectangle. Useful for dividers (e.g. 1px tall), image placeholders, colored blocks.

figma_create_ellipseA

Create an ellipse in Figma. Supports arcs for donut segments. Use DS color variables for fills and strokes.

figma_set_component_textA

Set a text property on a component instance. Tries component properties first, then falls back to text layer name search. Use figma_get_node_props to discover available property names before calling this.

figma_set_layout_sizingA

Adjust layout sizing, alignment, padding, or explicit dimensions of a node within its auto-layout parent.

figma_set_textA

Set text content on a TEXT node directly by its node ID. Use this to target a specific nested text node inside a component instance when figma_set_component_text cannot reach it by property name. Get nested text node IDs from figma_get_node_props.

figma_set_node_fillA

Set a fill or stroke color variable on any node. For component instances, walks to the first vector-type descendant (the actual colored shape inside an icon). Use this to apply DS color variables to nodes after insertion.

figma_set_visibilityB

Show or hide any node.

figma_set_variantA

Set VARIANT or BOOLEAN component properties on an instance. Supports single property OR batch mode. IMPORTANT: For VARIANT properties, Figma requires all variant axes to form a valid combination — use batch mode (properties object) to set multiple variants at once. For BOOLEAN properties, use true/false (not strings). Use figma_get_component_variants to discover available property names and values first.

figma_swap_main_componentA

Swap the main component of an INSTANCE node to a different component (by key). Changes which variant the instance is based on — bypasses setProperties entirely. Use figma_get_component_variants to find available variant keys.

figma_replace_componentA

Replace an existing node with a new component instance at the same position in its parent. Deletes the target node, inserts the new component at the same parent index. Use this to fix a wrong component insertion without rebuilding the parent frame.

figma_move_nodeA

Reorder a node within its current parent by moving it to a specific child index. Index 0 = front of stack (bottom in layer panel). Use figma_get_node_parent to see current sibling order before moving.

figma_delete_nodeC

Delete a node from the Figma document.

figma_create_chartA

Render a chart directly in Figma. All data is sent in one call — no per-element round trips. Supported chart types: • scatter / jitter — scatter plot with categorical Y bands • line — line chart with optional area fill, smooth curves, multi-series • donut / pie — donut or pie chart with legend and optional center label • bar / histogram — vertical bar chart with optional stacked segments; supports annotation vlines

figma_batchA

Execute multiple Figma operations in a single bridge round trip. Use this for repetitive structures — table rows, list items, grid cells, repeated cards — where individual calls would be impractical. Each operation in the array is a { tool, params } object using the same tool names as the individual tools (without the figma_ prefix internally). Returns an array of results in the same order as the operations. A failed operation is reported with { ok: false, error } and does not stop subsequent operations.

figma_get_node_propsA

Get the component properties and all text layers of a node. Call this before figma_set_component_text to discover valid property names. Also useful for Phase 5 validation — verify DS text styles are applied. Returns: { type, name, componentProperties: [{key, type, value}], textLayers: [{id, name, chars}] }

figma_get_node_childrenA

List all direct children of a node with their IDs, names, types, and dimensions. Use after construction to verify hierarchy or find a specific child node ID.

figma_get_node_parentA

Get the parent of a node, including all sibling children with their IDs and positions. Use to understand the current layout context or verify sibling order.

figma_get_text_infoA

Get the text style ID, font properties, and fill variable of a TEXT node. Use during Phase 5 validation to verify DS text style and color variable compliance. Returns: { textStyleId, fontName, fontSize, characters, fillVariable }

figma_list_text_stylesA

List all local text styles in the document with their IDs and names. Call this during Phase 2.5 (DS inspection) to discover available text style IDs before constructing text nodes. Use the returned IDs as textStyleId in figma_create_text.

figma_get_component_variantsA

Get all variant siblings of an instance's main component (all options in the component set). Use this to discover available variant values before calling figma_set_variant or figma_swap_main_component. Returns: { variants: [{id, key, name}] }

figma_get_selectionA

Get the currently selected nodes in Figma. Returns node IDs, names, and dimensions.

figma_select_nodeB

Select a node in Figma and scroll it into view.

figma_get_page_nodesA

List all top-level nodes on the current Figma page (names, IDs, positions, dimensions).

figma_get_pagesA

List all pages in the Figma document with their IDs and names. Use before figma_change_page to find the correct pageId.

figma_change_pageA

Switch the active Figma page. Subsequent operations will target the new page.

figma_preload_stylesA

Batch import DS text and color styles into the plugin cache. Call at build start with all style keys needed for the build. Cached styles resolve instantly during create_text/create_frame calls. Without preloading, each style import has an 8-second timeout.

figma_discover_library_stylesA

List local and imported text styles, color styles, and effect styles in the current file. Returns style IDs and keys usable with preload_styles and textStyleId in create_text. Note: Figma Plugin API cannot enumerate library styles directly — for full library style discovery, use search_design_system from the Figma MCP. Optional nameFilter narrows results.

figma_restyle_artboardA

Restyle an entire artboard by walking all descendants and applying color, font, radius, and spacing overrides. Pass a colorMap to remap hex colors (e.g. {"ffffff": "0f172a"} changes white to dark navy). Optional fontFamily changes all text to a new font. radiusScale multiplies all corner radii. spacingScale multiplies all padding and gaps.

figma_discover_library_variablesA

Discover ALL variable collections and variables available from enabled libraries. Uses figma.teamLibrary API to enumerate across all enabled libraries (including community libraries). Returns variable keys grouped by collection, usable with preload_variables or fillVariable/strokeVariable. Call this at build start to discover what DS variables are available. Optional nameFilter narrows results.

figma_preload_variablesA

Batch import DS variables into the plugin cache. Two import modes:

  1. Prefix-based (prefixes param): Walks team library collections and imports variables matching path prefixes. Works for team-published libraries. Does NOT find community library variables.

  2. Key-based (keys param): Imports variables directly by their Figma key, bypassing collection enumeration. Use this for community library variables — get the keys from search_design_system (Figma MCP), then pass them here. Each key entry can be a string (just the key) or { key, name } for explicit name mapping. Both modes can be used together. Call at build start alongside preload_styles.

figma_set_session_defaultsA

Set session-level defaults for DS compliance. Call once at build start after preload_styles. textFillStyleKey sets the default fill for all text nodes that have no explicit fill — prevents raw #000000 black. Pass the DS text-primary color style key. textFillVariable is the alternative for DSs that use variables instead of color styles (e.g., community libraries). Pass one of textFillStyleKey or textFillVariable — not both. fontFamily sets the default font family for all text nodes (default: "Inter"). Set this if your DS uses a different font (e.g., "Roboto", "SF Pro"). dsMode controls DS enforcement: "strict" (default) requires all visual properties to use DS variables/styles — raw hex, raw px, raw fonts are rejected. "permissive" allows raw fallbacks for component-only DSs without published tokens.

figma_read_variable_valuesA

Read the resolved values of all local variables in the current Figma file. Returns variable names, types, resolved hex values (for colors), and numeric values (for spacing/radius). Use this to extract DS token values for DESIGN.md generation, Tailwind export, or drift detection. Must be run in the library file (where variables are local) for full results. In consumer files, use discover_library_variables instead (returns keys/names but not values).

figma_tag_raw_exceptionA

Tag a node as a user-approved raw value exception. Prefixes the node name with [RAW-OK] and stores the reason in plugin data. Tagged nodes are skipped by validate_ds_compliance. Use ONLY after the user explicitly approves a raw fallback for a specific node.

figma_validate_ds_complianceA

Post-build DS compliance validation. Walks all nodes under an artboard and flags violations: raw fills (no bound DS variable), raw text styles (no textStyleId), raw spacing (no bound variable), fixed sizing on non-artboard frames. Returns a compliance report with violation details. Call after every build (Phase 4 QA) to verify DS-only rule compliance.

mimic_generate_design_mdA

Generate a DESIGN.md file from the current DS knowledge. Compiles DS variables, text styles, components, and Mimic's learned usage patterns into the open DESIGN.md format (compatible with Google Stitch, generative UI tools, and AI coding agents). The YAML frontmatter contains machine-readable tokens (colors, typography, spacing, radius, components). The markdown prose sections contain human-readable usage guidelines generated from build patterns. Optionally saves to a file path. Returns the full DESIGN.md content.

mimic_generate_build_reportA

Generate a build report after a Mimic build. Compiles DS compliance data, learned patterns, DS gap recommendations, and build metadata into a structured report. Call validate_ds_compliance first to get the complianceData, then pass it here. Returns the report as markdown (default) or HTML. Optionally saves to a file.

mimic_pipeline_resolveA

Deterministic input resolver for HTML → Figma builds. Provide a URL, local HTML file path, or raw HTML content. The controller classifies the input (DIRECT_HTML vs RENDERED_DOM_REQUIRED), renders client-rendered pages automatically if needed, validates the result, and returns a ready-to-build HTML file path. ALWAYS call this BEFORE starting any HTML → Figma build. If result.status is READY, use result.outputPath as build input. If result.status is FAILURE, do NOT proceed — report the error.

mimic_render_urlA

Render a client-rendered web page in a headless browser and extract the full DOM. Use this when a URL returns only a JS shell, loading spinner, or hydration scaffold — not meaningful HTML. The renderer waits for the page to fully hydrate using generic readiness signals (text density, node count, DOM stability) before extracting. Returns the path to the rendered HTML file which can then be used as build input. On failure, returns a classified error (auth wall, endless loading, empty shell, etc).

mimic_discover_dsA

Extract and normalize a design system from a Figma library file. Call this on first run or when the DS has been updated. Queries the Figma REST API for components, component sets, styles, and variables. Normalizes the extraction into a structured knowledge artifact at internal/ds-knowledge/ds-knowledge-normalized.json. Returns a summary of what was found (counts of components, styles, variables).

mimic_ai_knowledge_readA

Read the Mimic AI knowledge file (ds-knowledge.json). Call this at the start of every HTML-to-Figma run to load known pattern→component mappings. VERIFIED entries should be used directly without a fresh DS lookup. CANDIDATE entries should be used with a confirming DS check. Returns the full knowledge object, or a single entry if pattern_key is provided.

mimic_ai_knowledge_writeA

Write pattern→component mappings and explicit DS rules to the Mimic AI knowledge file (ds-knowledge.json). Call this at the end of every successful HTML-to-Figma run. Automatically promotes CANDIDATE entries to VERIFIED once use_count reaches 3 with no corrections. Use increment_correction=true when the user corrected a mapping — also write a matching rule_update with reset_seen_count=true. Use state="REJECTED" to permanently suppress a mapping. Use dismissed_conflicts to suppress a DS evolution conflict notice for a specific candidate component. Use rule_updates to record DS gaps, substitutions, and conventions. Use reset_gap_seen_counts=true when the user signals their DS was updated — resets all gap AND substitution rules so new components can be discovered. Gaps with seen_count ≥ 3 are surfaced as DS enhancement recommendations (unless dismissed or resolved). Response includes key_warnings (malformed key format — treat as errors, fix immediately) and rule_type_warnings (rule type changed — confirm intentional).

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/miapre/mimic-ai'

If you have feedback or need assistance with the MCP directory API, please join our Discord server