Tutorial
Use figma-console MCP to read a Figma component spec directly — design tokens included — then Storybook MCP to match Atelier UI components, and let Claude Code write token-exact code. The next section explains what an MCP is.
Just want the recipe? Try the 15-min kata instead.
What you'll learn
- Read a Figma component's
boundVariablesvia MCP - Match the right Atelier UI component through the Storybook MCP
- Generate token-exact code in Angular, React or Vue
- Verify design parity automatically
Before you start
- Completed the Workshop setup
figma-consoleMCP configured — see Figma Setup- Read access to the Atelier UI Figma file (linked below)
- One framework picked — Angular, React or Vue
- Open Figma · click the frame
- Read the inspect panel by hand
- Note color tokens · copy by hand
- Note spacing & radius tokens
- Switch to the Storybook tab
- Find the right component
- Read prop docs & variants
- Type the code · risk drift
- Manually verify against the design
Drift risk at every step.
- Copy the node-id from the Figma URL
- Send one prompt to Claude Code
"build component for node-id 695-313 using figma-console + storybook-react MCP."
- Token-exact code lands
- Optional:
figma_check_design_parity
Single source of truth · no drift.
What's an MCP, in 30 seconds?
Claude Code can call functions exposed by an external MCP server. The server fetches structured data from a source (Figma, Storybook, Nx) and hands it back — no screenshots, no copy-paste, no prompt-stuffing. Each call is one of four hops:
This tutorial uses two MCP servers: figma-console (reads Figma component frames) and one of the storybook-* servers (returns Atelier UI component prop documentation). The next section walks the figma-console tools you'll use.
What figma-console MCP provides
The key tool is figma_get_component_for_development. Given a node-id it returns:
// What figma_get_component_for_development returns for a card frame:{ "name": "Settings / Card", "boundVariables": { "fills": [{ "variable": "color/surface-raised" }], // → --ui-color-surface-raised "paddingTop": { "variable": "spacing/6" }, // → --ui-spacing-6 "paddingLeft": { "variable": "spacing/6" }, // → --ui-spacing-6 "itemSpacing": { "variable": "spacing/4" }, // → --ui-spacing-4 "cornerRadius": { "variable": "radius/lg" } // → --ui-radius-lg }, "image": "<2x rendered PNG — included automatically>"}The workflow
Select the component in Figma
Open the Atelier UI Figma file and click the frame you want to implement. The node-id appears in the URL after ?node-id= — copy that value, you’ll pass it to the MCP tool.
AI reads the spec
Claude Code calls figma_get_component_for_development(nodeId). The response includes boundVariables listing every design token used in the frame, plus a rendered image for visual reference — no screenshots needed.
AI matches to Atelier UI components
Claude Code queries the Storybook MCP (list-all-documentation → get-documentation) for the matching component. It gets exact prop names and variants — no guessing.
AI generates token-exact code
With the Figma token names from boundVariables and the correct Atelier UI props from Storybook, the generated code uses the right component APIs and the exact CSS custom properties — no hardcoded values, no style overrides.
Verify design parity (optional)
figma_check_design_parity compares the generated code against the Figma spec and returns a parity score plus specific discrepancies. Pass the prompt below to close the loop.
Run figma_check_design_parity on the settings card nodeagainst the component I just generated. Fix any discrepancies.Example prompt
A prompt that drives the full A–D workflow in one shot:
I've selected the "Settings / Card" frame in Figma.
1. Use figma-console MCP (figma_get_component_for_development) to read the component spec — I need the boundVariables and the visual reference.2. Use storybook-react MCP to look up LlmCard and LlmInput props.3. Generate the React component using: - The Atelier UI components matched from Storybook - The exact token names from boundVariables (they map 1-to-1 to CSS custom properties — no conversion needed)Generated output
What Claude Code produces — using LlmCard and LlmInput from Atelier UI with tokens drawn directly from Figma boundVariables:
import { LlmCard, LlmInput, LlmButton } from '@atelier-ui/react';
export function SettingsCard() { return ( <LlmCard variant="elevated" style={{ padding: 'var(--ui-spacing-6)', display: 'flex', flexDirection: 'column', gap: 'var(--ui-spacing-4)' }} > <h2 style={{ fontSize: 'var(--ui-font-size-lg)', fontWeight: 600, color: 'var(--ui-color-text)', margin: 0 }}> Account Settings </h2> <LlmInput label="Name" placeholder="Jane Smith" /> <LlmInput label="Email" type="email" placeholder="jane@example.com" /> <div> <LlmButton variant="primary">Save Changes</LlmButton> </div> </LlmCard> );}import { Component } from '@angular/core';import { LlmCard, LlmInput, LlmButton } from '@atelier-ui/angular';
@Component({ selector: 'app-settings-card', standalone: true, imports: [LlmCard, LlmInput, LlmButton], template: ` <llm-card variant="elevated" style="padding: var(--ui-spacing-6); display: flex; flex-direction: column; gap: var(--ui-spacing-4)"> <h2 style="font-size: var(--ui-font-size-lg); font-weight: 600; color: var(--ui-color-text); margin: 0"> Account Settings </h2> <llm-input label="Name" placeholder="Jane Smith" /> <llm-input label="Email" type="email" placeholder="jane@example.com" /> <div> <llm-button variant="primary">Save Changes</llm-button> </div> </llm-card> `,})export class SettingsCardComponent {}<script setup lang="ts">import { LlmCard, LlmInput, LlmButton } from '@atelier-ui/vue';</script>
<template> <LlmCard variant="elevated" style="padding: var(--ui-spacing-6); display: flex; flex-direction: column; gap: var(--ui-spacing-4)" > <h2 style="font-size: var(--ui-font-size-lg); font-weight: 600; color: var(--ui-color-text); margin: 0"> Account Settings </h2> <LlmInput label="Name" placeholder="Jane Smith" /> <LlmInput label="Email" type="email" placeholder="jane@example.com" /> <div> <LlmButton variant="primary">Save Changes</LlmButton> </div> </LlmCard></template>Run it
Save the generated component, start your dev server, and verify against the Figma frame. The framework tabs above stay in sync with this section.
- Save as
apps/workshop-react/src/components/SettingsCard.tsx - Start the dev server
Terminal window npx nx serve workshop-react - Open http://localhost:4201 A card with two text inputs (Name, Email) and a primary "Save Changes" button — surface-raised background, padding from the Figma spacing token.
- Verify parity Run the parity prompt above — Claude will list any discrepancies and propose fixes.
- Save as
apps/workshop-angular/src/app/components/settings-card.component.ts - Start the dev server
Terminal window npx nx serve workshop-angular - Open http://localhost:4200 A card with two text inputs (Name, Email) and a primary "Save Changes" button — same surface, padding, and radius as the Figma frame.
- Verify parity Run the parity prompt above — Claude will list any discrepancies and propose fixes.
- Save as
apps/workshop-vue/src/components/SettingsCard.vue - Start the dev server
Terminal window npx nx serve workshop-vue - Open http://localhost:4202 A card with two text inputs (Name, Email) and a primary "Save Changes" button — surface-raised background, identical token-driven spacing.
- Verify parity Run the parity prompt above — Claude will list any discrepancies and propose fixes.
figma-console MCP — tools used
| Tool | When to use |
|---|---|
figma_get_component_for_development | Main tool — reads component tree, boundVariables, and renders a 2× image. Use for any "build this component" task. |
figma_get_component_for_development_deep | For complex, deeply nested components (depth > 4) — resolves all boundVariables to actual token names. |
figma_get_variables | Export all design tokens as CSS / Tailwind / TypeScript. Handles Light and Dark mode values. |
figma_check_design_parity | Compare generated code against the Figma spec. Returns a parity score and actionable fix list. |
figma_generate_component_doc | Generate structured component documentation (anatomy, tokens, variants) by merging Figma data with code-side info. |