Skip to main content
Glama
Blyawon

tokensStudioMCP

by Blyawon

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
FIGMA_ACCESS_TOKENYesYour Figma personal access token with scope File content: Read-only.

Capabilities

Features and capabilities supported by this server

CapabilityDetails
tools
{
  "listChanged": true
}

Tools

Functions exposed to the LLM to take actions

NameDescription
get_metadata_with_tokensA

STEP 2 of the recommended flow (call list_tokens first to see which tokens exist before fetching the whole tree). Returns a Figma MCP-style get_metadata XML tree for a Figma file or node, decorated with Tokens Studio applied tokens on every node. Every element gets a <tokens .../> child; nodes without applied tokens emit . The root element carries a token-coverage="/" attribute. Nodes with visual styling (shared styles, raw fills/strokes/effects) but no covering token get an untokenized="fill,stroke,…" attribute on their tokens element. x/y/w/h are omitted by default — pass layout=true if you need them. Composition tokens are stripped by default (they duplicate individual property tokens); pass includeComposition=true to include them. Pass format='tree' for a compact markdown tree (~50% fewer tokens than XML).

get_design_contextA

THE tool for building code from a Figma design — replaces the need for a separate Figma MCP. Returns a compact markdown tree of a node/subtree carrying everything needed to rebuild it: auto-layout (direction, gap, padding, alignment, hug/fill sizing), constraints, fills/strokes/gradients with resolved hex colors, stroke weight, corner radius, effects (shadows/blur), opacity, blend mode, typography (family, weight, size, line-height, tracking), text content, component/instance relationships + variant props — AND the Tokens Studio tokens applied to each node, so generated code can use design-token variables instead of hard-coded values. One line per node; defaults omitted.

get_node_tokensB

Return just the Tokens Studio applied tokens for a single Figma node, as a tiny XML snippet. Untokenized nodes come back as .

inspect_nodeA

Deep-inspect a Figma node (or its subtree) against the current token catalog: returns every applied token with its resolved value, flags broken references (unresolved / missing set / cycle / literal 'none'), and attaches the top remap suggestions for each broken token plus any style gaps. Pass scope='subtree' to walk descendants. Backs the plugin's Inspect tab; use it in chat when you need to audit a frame's token coverage end-to-end without assembling the pieces yourself.

list_tokensA

START HERE for any question about which design tokens a Figma frame uses. Cheap pre-flight: returns the unique Tokens Studio tokens applied anywhere in a subtree, grouped by property (fill, spacing, typography, …), with the layer names that use each value and a style-gap report at the bottom. Much smaller than get_metadata_with_tokens — call this first to decide whether you actually need the full tree. If the subtree relies on composition tokens the response surfaces a one-line hint so you don't get silent empty output; pass includeComposition=true to include them.

propose_token_remapA

Plan a token remap for a Figma subtree against a NEW token set the user pasted as JSON. Read-only — does NOT touch the Figma file. Returns candidate new tokens (with scores + reasoning) for every old token currently applied in the subtree, plus an ambiguous list where the agent should pick. Pass the returned plan to apply_token_remap once you've resolved ambiguity. Accepts any reasonable shape for newTokens (Tokens Studio export, single-set object, DTCG, or a flat list of paths).

apply_token_remapA

Apply a remap plan to the live Figma file via the companion plugin. Requires the 'Tokens Studio MCP Bridge' Figma plugin to be running and connected — call bridge_status first if unsure. Pass the plan you got back from propose_token_remap, after deciding chosen for any ambiguous entries. dryRun: true runs validation but skips the write. The whole batch is wrapped in a single Figma undo entry — Cmd-Z reverts the entire remap.

get_token_storage_configA

Auto-discover Tokens Studio's sync provider config from the live Figma file (via the companion plugin). Returns the storageType blob (provider, id, branch, filePath, ...) plus themes / activeTheme / tokenFormat / version metadata. Credentials are NOT returned — they live in env vars on the MCP server. Pair with get_token_catalog to actually fetch the tokens. Returns null storageType when the file has only a local cache (use get_token_catalog with no override to read it).

get_token_catalogA

Fetch the canonical Tokens Studio token catalog from its sync source (GitHub, GitLab, Bitbucket, ADO, JSONBin, URL, Tokens Studio SaaS, Supernova) — or from the file's local cache when no remote sync. By default auto-discovers the storage config from the live file via the plugin; pass override to point at a different repo / branch / file path. Returns the parsed token tree, themes, and metadata. Credentials come from env vars (TOKENS_STUDIO__TOKEN); call get_token_storage_config first to see which secrets are configured.

list_themesA

List the themes defined in the active token catalog (auto-fetched if needed). Each theme reports its enabled token sets so the agent can decide which one to apply. Pair with apply_theme to switch the file's active theme and (optionally) write resolved values to nodes.

apply_themeB

Switch the file to a theme and resolve every applied token to its concrete value. Sets the file's activeTheme + usedTokenSet shared plugin data (so Tokens Studio recognizes the switch), then walks the subtree and writes resolved values directly via the plugin — no need to click 'Apply' in Tokens Studio. Supports color (fill/stroke), spacing/padding (all 4 axes), border radius/width, opacity, sizing, composition (auto-expanded into their constituent property writes), typography (font family / weight / size / line-height / letter-spacing — pre-loads fonts in parallel), and shadow (drop / inner via the effects array). Math expressions like {base.size.4} * 2 are evaluated; references are followed (cycle-protected at depth 16). Hidden nodes are skipped by default for both performance and intent. Pass dryRun: true to see what would be written without touching the file.

bulk_rename_tokensA

Rename tokens by exact path or wildcard pattern, in two scopes: live (rewrite applied references on Figma nodes via apply_token_remap) and/or files (stage rename_token edits on the catalog working copy). scope: "both" (default) does both. dryRun: true returns counts without modifying anything. Pattern syntax: * captures one path segment, referenced as $1 in replacement (e.g. colors.brand.* → color.accent.$1).

create_branchA

Create a new branch on the active token source's remote. Defaults to branching from the current active branch. Optionally switch the plugin's saved override to the new branch so subsequent edits + applies target it. Currently supports GitHub only; other providers will return a 'not implemented' error.

set_tokenA

Stage a token write. Adds (or replaces) a token at path in the named set of the active catalog's working copy. Edit accumulates until you call commit_and_push. Use type to give Tokens Studio the correct token type (color / spacing / borderRadius / ...); we'll infer from value shape if omitted.

delete_tokenA

Stage a token deletion. Removes the token at path from the named set in the working copy. Accumulates until commit_and_push.

rename_tokenB

Stage a token rename. Moves a token from one path to another. By default also rewrites every other token's value reference from {from} to {to} so dependent tokens keep resolving — pass updateReferences: false to disable.

list_pending_editsA

Show what's staged in the working copy: branch, base commit SHA, source description, and the full edit log. Returns null when no edits have been staged yet.

discard_pending_editsA

Throw away every staged edit and reset the working copy to the last fetched base catalog. Useful when you want to start over.

commit_and_pushA

Flush every staged edit as a single commit on the configured branch (or a new one via branch / asNewBranch). Conflict-checked: refuses if the remote head moved since the working copy was loaded — pull (Refresh in plugin) and re-stage edits, then retry. Currently supports GitHub only.

suggest_tokensA

Suggest tokens from the loaded catalog that fit a Figma node, ranked. Reads the node + nearby context (name, type, parent variant axes, tokens already applied to siblings) and scores every catalog token of compatible type. Returns the top N with reasoning per candidate. Use this when the design system's naming convention isn't obvious or when the user just says 'tokenize this' without spelling out paths.

apply_to_variantsA

Bulk-apply tokens to every variant of a Figma component_set in a single call, using a token-path TEMPLATE with {axis} placeholders. Solves the 'tab bar / button / chip / icon-set' shape: 24+ variants, each with a per-variant token derived from the component's variant axes (variant, active, state, density, …). Works for ANY naming convention — you supply the template that matches your design system's path shape. Targets descendants by layerName (and optional layerType), so the token lands on the actual shape layer / instance / wrapper, not the variant frame. Optional clearProperties removes other token property keys on the same nodes (useful for fixing earlier wrong writes). dryRun: true returns the full plan without writing.

bridge_statusA

Diagnostic: is the local WebSocket bridge running and is the companion Figma plugin connected? Returns the connected file's key/name when known. If the plugin is not connected, make sure the 'Tokens Studio MCP Bridge' plugin is open in Figma.

get_current_targetA

Returns the designer's currently pinned target (if any) and live selection from the connected Figma plugin. Use when the user says 'this', 'here', 'the current selection', or doesn't specify a URL. Prefer pinned if present.

inspect_bound_variablesA

Diagnostic: dump the per-node state that can override raw writes — boundVariables (bound Figma Variables take visual precedence over any raw fill/stroke/effect/numeric value), fillStyleId/strokeStyleId/effectStyleId/textStyleId (attached Figma Styles), and insideInstance (non-overridable instance sublayers silently reject writes). Use this to figure out WHY a specific layer visually doesn't re-theme even though apply_theme reports the write as applied.

debug_resolve_tokenA

Diagnostic: resolve a specific token path under a given theme and return the full resolved value tree. Useful for debugging why a composition token doesn't produce the expected writes — if a sub-property is missing from the resolved entries, that reference couldn't be found in the theme's enabled sets.

figma_evalA

Execute JavaScript inside the connected Figma plugin sandbox with the full figma Plugin API in scope (create/edit any node, variables, styles, components, viewport, exports — everything). Code runs in an async IIFE: await works, the last expression (or return …) is the result. Figma nodes in the result come back as {id,name,type} stubs. Use the structured tools (create_node, set_node_properties, …) for common operations; reach for eval when you need something they don't cover. Each call is one Figma undo step.

create_nodeA

Create a node in the live Figma file via the plugin: frame, rectangle, ellipse, line, text, autolayout (frame with flex), or instance (from a componentId). Auto-positions right of existing content unless x is given. Supports fill/stroke (hex, rgb(), hsl(), or 'none'), cornerRadius, opacity, and auto-layout props (layout='row'|'col', gap, padding, justify/items = start|center|end|between, sizingHorizontal/Vertical = HUG|FILL|FIXED). Text supports characters, fontSize, fontFamily, fontStyle. Pass children (array of nested create_node specs, same shape minus parentId) to build a WHOLE TREE in one call — e.g. a card frame with title + body + button. Also supports type='svg' ({svg: markup}), 'image' ({base64}), 'section', and in FigJam files 'sticky', 'connector' ({startNodeId,endNodeId}), 'shape'. Returns the new root node's id.

set_node_propertiesA

Edit properties on existing nodes (by nodeIds, single nodeId, or the current Figma selection when neither is given). Same property surface as create_node — fill, stroke, strokeWeight, cornerRadius, opacity, x/y/width/height, name, visible, locked, rotation, auto-layout props (layout/gap/padding/justify/items/sizing), constraints ({horizontal,vertical} = MIN|CENTER|MAX|STRETCH|SCALE), and text (characters, fontSize, fontFamily/fontStyle — fonts auto-loaded). Applies to every target node; returns per-node ok/error.

node_actionA

Run a structural action on nodes (by nodeIds / nodeId / current selection): delete, clone (with offset), select (+scroll into view), zoom, group, to-component (convert each node to a component), combine-variants (promote frames to components and combine into a component set — name them 'Prop=Value' first), append (move into parentId), or arrange (grid-layout the targets with gap/columns).

get_canvas_treeA

Live node tree from the plugin — works in ANY file the plugin is open in (drafts, branches, files without REST access), no fileKey needed. Root = nodeId, else the single selected node, else the current page. Each node carries id/name/type, x/y/w/h, auto-layout props, fills, radius, and text font/size/content. Depth-limited (default 6, max 12).

find_nodesA

Find nodes on the current page by name substring and/or type (FRAME, TEXT, COMPONENT, INSTANCE, …) via the plugin. Returns id/name/type/bounds for up to max matches (default 50).

export_node_imageA

Export a node (by nodeId or current selection) as PNG/JPG/SVG via the plugin. PNG/JPG come back as an inline image for visual verification of what you just built; SVG comes back as text.

figma_variablesC

Figma Variables CRUD + binding via the plugin. sub-ops: 'listCollections', 'list' (optionally filter by name), 'createCollection' {name}, 'create' {name, collection, type: COLOR|FLOAT|STRING|BOOLEAN, value}, 'setValue' {variableId, value, modeId?}, 'bind' {variable (id or name), field: fill|stroke|cornerRadius|itemSpacing|paddingTop|…, nodeIds?/selection}, 'exportCss' / 'exportTailwind' {collection?} (CSS custom properties / Tailwind theme.colors from the file's variables). Colors accept hex/rgb()/hsl().

create_iconA

Create an icon on the canvas from the Iconify catalog (200k+ icons: lucide:, mdi:, tabler:, heroicons:, …). The server fetches the SVG from api.iconify.design and the plugin renders it as vectors, optionally tinted with color and placed inside parentId.

create_image_from_urlA

Fetch an image from a URL (server-side) and place it on the canvas as a rectangle with an image fill — e.g. reference screenshots, logos, photos. Native image size is used unless width/height given.

canvas_auditA

Accessibility audit of the live canvas via the plugin (scope: nodeId → selection → current page). Checks: 'contrast' (WCAG AA/AAA text-vs-background ratios, large-text aware), 'touch' (interactive elements ≥44×44, detected by reactions or button/input-ish names), 'text' (minimum font size), or 'all'. Returns per-check counts + failing nodes with ids so fixes can target them directly.

analyze_designA

Usage statistics for the live canvas via the plugin (scope: nodeId → selection → current page): top solid fill colors, top typography combos (family/style/size), and top auto-layout gaps + paddings, each with usage counts. Use it to spot hard-coded values that should be tokens, or to derive a palette from an existing design.

dev_resourcesA

Manage dev resources (links to Storybook / GitHub / docs) on a node via the plugin: action='add' {url, name?}, 'list', or 'delete' {url}. Targets nodeId or the current selection.

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/Blyawon/tokensStudioMCP'

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