Claude Talk to Figma MCP - DaisyUI Edition
Drives a Figma plugin over a WebSocket channel to read and modify design documents: builds a local index of components and pages, searches components (by name, category or DaisyUI class), extracts design tokens, text nodes for i18n and WCAG accessibility audits, generates Jinja/HTMX templates, Tailwind classes, Playwright page objects and component-registry entries, binds color/text/fill/stroke variables and styles, manages prototype links and scroll behavior, and edits nodes (rename, visibility, opacity, lock, batch fetch).
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.
Claude Talk to Figma MCP - DaisyUI Edition
A Model Context Protocol (MCP) plugin that allows Claude Desktop and other AI tools to interact directly with Figma, enhanced with intelligent DaisyUI component detection, local caching for fast queries, HTMX/Tailwind code generation, design token extraction, accessibility auditing, and real-time change notifications.
Fork of: arinspunk/claude-talk-to-figma-mcp Original credit to Sonny Lazuardi and Xúlio Zé
Project Context
This fork was developed for a project that needed enhanced Figma-to-code workflow capabilities. While customized for a specific workflow (HTMX + DaisyUI + Tailwind + Playwright), the tools are general-purpose and work with any Figma project.
Customizations in this fork:
Component registry format uses
docs/ui/component-registry/*.yamlstructurePage Object generation follows Playwright test conventions
Design token extraction optimized for Tailwind config
All tools work standalone and can be adapted to other project structures.
Related MCP server: Claude Talk to Figma MCP
New in v0.9.0 - Variable Binding & Per-Document Caching
Feature | Description |
Variable Binding | Bind DaisyUI color variables to nodes for theme-compatible colors (light/dark mode) |
Style Binding | Apply fill, stroke, and text styles programmatically |
Variable Caching | Variables stored in local SQLite index with FTS5 search |
Per-Document Databases | Each Figma file gets its own cache - switch files seamlessly |
DaisyUI Auto-Detection | Variables automatically mapped to semantic names (primary, base-100, etc.) |
Previous: v0.8.0 - Comprehensive Figma-to-Code Pipeline
Feature | Description |
Design Token Extraction | Extract colors, spacing, typography, shadows → Tailwind config or CSS variables |
i18n Text Extraction | Extract all text nodes with suggested i18n keys and namespaces |
Accessibility Audit | WCAG 2.1 AA/AAA audit (contrast ratios, touch targets, text sizes) |
Component Registry Sync | Compare Figma designs with local component registry YAML |
Visual Regression Export | Export frames for visual regression testing |
Real-Time Change Notifications | Auto-sync index when Figma document changes |
DaisyUI Edition Features
This fork adds powerful features for DaisyUI + Tailwind + HTMX workflows:
Feature | Benefit |
Local SQLite Index | 100x faster queries - no Figma round-trips |
Per-Document Caching | Each Figma file gets its own database - switch files seamlessly |
FTS5 Fuzzy Search | Find components with natural language ("primary button") |
DaisyUI Auto-Detection | Automatic mapping of Figma nodes to DaisyUI classes |
Tailwind Extraction | Convert Figma styles to Tailwind utilities |
Jinja/HTMX Templates | Generate server-rendered templates from designs |
Page Object Generator | Create Playwright test objects from Figma |
Auto-Sync on Changes | Index automatically updates when Figma document changes |
Agent-Optimized Responses | 99% smaller responses with ready-to-use clone commands |
All Tools
Index & Search Tools
Tool | Description |
| Build local SQLite index from Figma document (auto-runs on first query) |
| Check index health, sync status, invalidation state |
| List all Figma documents that have been indexed locally |
| Natural language search: "primary button", "login form" |
| List all components in a category (buttons, forms, cards) |
| Find component by DaisyUI class (btn-primary) |
| Quick overview of all pages |
| Hierarchical page structure (much smaller than full export) |
Code Generation Tools
Tool | Description |
| Generate Jinja/HTML with HTMX and Alpine.js attributes |
| Extract Tailwind classes from Figma node styles |
| Create Playwright Page Objects (TypeScript or Python) |
| Generate component registry YAML entry |
Design Token Tools (NEW)
Tool | Description |
| Extract colors, spacing, typography, shadows → Tailwind config or CSS vars |
i18n & Accessibility Tools (NEW)
Tool | Description |
| Extract all text for i18n validation with suggested keys |
| WCAG 2.1 AA/AAA audit (contrast, touch targets, text sizes) |
Component Registry Tools (NEW)
Tool | Description |
| Compare Figma with local registry YAML, detect drift |
Visual Testing Tools (NEW)
Tool | Description |
| Export frames for visual regression testing |
Variable & Style Binding Tools
Tool | Description |
| Inspect which variables are bound to a node's properties |
| Bind a color variable to a node's fill (theme-compatible) |
| Bind a color variable to a node's stroke |
| Apply a fill style to a node |
| Apply a stroke style to a node |
| Apply a text style to a text node |
| Find a variable ID by name (e.g., 'base-100', 'primary') |
| Remove a variable binding from a node property |
Note:
get_local_variablesandget_variable_collectionswere REMOVED in v1.1.0 due to excessive response sizes (~25k tokens). Use cached alternatives below.
Variable Cache & Search Tools (NEW v0.9.0)
Tool | Description |
| Search locally cached variables by name/DaisyUI mapping |
| List all color variables grouped by DaisyUI category |
| List variable collections with modes and counts |
| Find variable by DaisyUI name (e.g., 'primary', 'base-100') |
Prototype & Interaction Tools
Tool | Description |
| Create interactive links between frames (click to navigate) |
| List all prototype links from a node/frame |
| Remove prototype interactions from a node |
| Configure scroll overflow on frames |
Utility Tools
Tool | Description |
| Extract styles optimized for Tailwind/DaisyUI mapping |
| Compact page structure for indexing |
| Batch fetch multiple nodes with minimal data |
| Rename any Figma node |
| Show/hide nodes |
| Set node opacity (0-1) |
| Lock/unlock nodes from editing |
Installation
1. Prerequisites
2. Clone and Build
git clone https://github.com/morteng/claude-talk-to-figma-mcp-daisyui.git
cd claude-talk-to-figma-mcp-daisyui
bun install
bun run build3. Configure Claude Desktop
Add to ~/.claude.json:
{
"mcpServers": {
"figma": {
"command": "/path/to/bun",
"args": ["run", "/path/to/claude-talk-to-figma-mcp-daisyui/dist/talk_to_figma_mcp/server.js"],
"env": {
"FIGMA_CACHE_DIR": "/path/to/cache/dir"
}
}
}
}4. Setup Figma Plugin
Import src/claude_mcp_plugin/manifest.json in Figma → Plugins → Development
5. First Connection
# Terminal 1: Start WebSocket server
bun socket
# Terminal 2: Use Claude
"Connect to Figma channel abc-123"
"Search for primary buttons" # Index auto-builds on first queryUsage Examples
Design Token Extraction
"Extract design tokens as Tailwind config"
→ Generates theme.extend with colors, spacing, typography, shadows
"Extract design tokens as CSS variables"
→ Generates :root { --color-primary: #...; } formatAccessibility Audit
"Audit the login page for accessibility"
→ Returns WCAG 2.1 AA/AAA violations with severity levels
Example output:
- Error: Contrast ratio 2.1 (needs 4.5 for AA)
- Warning: Touch target 32x32px (recommended 44x44px)
- Error: Text size 10px below minimum 12pxi18n Text Extraction
"Extract text nodes from the settings page with namespace 'settings'"
→ Returns all text with suggested i18n keys
Example output:
- "Save Changes" → settings.save_changes
- "Account Settings" → settings.account_titleComponent Registry Sync
"Sync component registry for the dashboard page"
→ Compares Figma with local YAML files
Example output:
- in_registry_not_figma: ["old-component"]
- in_figma_not_registry: ["new-feature-card"]
- name_mismatches: [{"figma": "Stats Card", "registry": "stat-card"}]Visual Regression Export
"Export the dashboard frames for visual regression testing"
→ Exports frames as PNG at specified scaleCode Generation
"Generate a Jinja template from node 123:456"
→ Produces HTMX-ready template with DaisyUI classes
"Generate a Playwright Page Object for the Login page in Python"
→ Creates Python test helper with selectorsVariable & Style Binding (NEW v0.9.0)
"Get all DaisyUI color variables"
→ Lists all color variables organized by collection (base, primary, secondary, etc.)
"Bind the base-100 variable to the navbar background"
→ Makes the fill theme-compatible (auto-switches light/dark)
Example workflow:
1. resolve_variable_by_name("base-100") → Get variable ID
2. set_fill_variable(nodeId, variableId) → Bind to node
→ Now the node's fill automatically adapts to theme changes
"Check what variables are bound to this card"
→ Shows all variable bindings for fills, strokes, and other propertiesPrototype Interactions
"Link the Login button to the Dashboard frame"
→ Creates ON_CLICK prototype link with smooth transition
"Show all prototype links in the navigation bar"
→ Lists all interactive elements and their destinationsAuto-Sync Behavior
The index automatically stays in sync with your Figma document:
Event | Behavior |
First query | Auto-builds index if empty |
Document changes | Index invalidates on node creation/deletion or >5 property changes |
Stale index | Auto-rebuilds if >5 minutes old |
Not connected | Uses cached index with warning |
Check sync status anytime with index_status.
Change Notification Flow
Figma Document Change
↓
Plugin Event Listener (throttled, 1s minimum)
↓
WebSocket Notification
↓
MCP Server Handler
↓
Index Invalidation Flag
↓
Next Query → Auto-rebuildArchitecture
┌─────────────────────────────────────────────────────────────────┐
│ CLAUDE CODE │
└───────────────────────────────────┬─────────────────────────────┘
│ MCP Protocol
▼
┌─────────────────────────────────────────────────────────────────┐
│ DAISYUI EDITION MCP SERVER │
│ ┌─────────────┐ ┌──────────────┐ ┌────────────────────┐ │
│ │ SQLite FTS5 │ │ DaisyUI │ │ Code Generator │ │
│ │ Index │ │ Component │ │ - Jinja/HTMX │ │
│ │ - Nodes │ │ Detector │ │ - Tailwind │ │
│ │ - Components│ │ - Colors │ │ - Page Objects │ │
│ │ - Pages │ │ - Patterns │ │ - Registry YAML │ │
│ └──────┬──────┘ └──────┬───────┘ └────────────────────┘ │
│ │ │ │
│ ┌──────┴────────────────┴───────────────────────────────────┐ │
│ │ NEW TOOLS (v0.8.0) │ │
│ │ - Design Token Extraction - Accessibility Audit │ │
│ │ - i18n Text Extraction - Component Registry Sync │ │
│ │ - Visual Regression Export - Change Notifications │ │
│ └───────────────────────────────────────────────────────────┘ │
│ │
│ ┌───────────────────────────────────────────────────────────┐ │
│ │ Original Tools (50+) │ │
│ │ Document, Creation, Modification, Text, Components │ │
│ └────────────────────────────────────────────────────────────┘ │
└───────────────────────────────┬─────────────────────────────────┘
│ WebSocket + Change Notifications
▼
┌─────────────────────────────────────────────────────────────────┐
│ FIGMA PLUGIN │
│ - Document change listener │
│ - Selection change listener │
│ - Page change listener │
│ - Throttled notification relay │
└─────────────────────────────────────────────────────────────────┘DaisyUI Component Categories
The index automatically categorizes components:
Category | Components |
| btn, btn-primary, btn-secondary, btn-ghost, etc. |
| input, select, checkbox, radio, toggle, textarea |
| card, card-compact, card-bordered |
| navbar, tabs, breadcrumbs, menu |
| alert, toast, modal, tooltip, progress, loading |
| stats, avatar, badge, table |
| hero, footer, divider, drawer |
| collapse, rating, link |
Testing
bun run test # Unit tests
bun run test:coverage # Coverage report
bun run test:integration # Integration testingVersion History
1.1.0 (Context Optimization)
REMOVED:
get_local_variables,get_variable_collections,get_document_info- These returned massive responses (~25k tokens) that filled context quicklyUse Instead: Cached alternatives like
get_cached_variable_by_daisyui(),search_cached_variables(),list_pages(),get_page_tree()Why: Context window preservation, faster responses, better agent behavior
1.0.0 (DaisyUI + Tailwind Edition)
Complete Tailwind CSS Color Palette: Full support for all 22 color families with all shades
Enhanced Variable Classification: Color systems, token types, semantic roles
Multi-Mode Theme Support: Store and query variable values across light/dark modes
Variable Binding Tracking: Track which variables are bound to which nodes
Spacing & Sizing Tokens: Support for non-color design tokens
0.9.0 (Variable Binding & Caching)
Variable Binding: Bind Figma variables (design tokens) to node fills and strokes
Theme-Compatible Colors: Use
set_fill_variableinstead of hardcoded RGB for light/dark theme supportVariable Discovery:
resolve_variable_by_namefor finding variables by nameStyle Binding:
set_fill_style_id,set_stroke_style_id,set_text_style_idVariable Inspection:
get_bound_variablesto see what's bound to a nodeClear Bindings:
clear_variable_bindingto remove variable connectionsVariable Caching: Variables stored in SQLite with FTS5 search (
search_cached_variables,list_cached_color_variables)Per-Document Databases: Each Figma file gets its own SQLite database (
list_cached_documents)DaisyUI Auto-Mapping: Variables automatically mapped to semantic names (primary, base-100, etc.)
0.8.0 (DaisyUI Edition - Extended)
Design Token Extraction: Extract colors, spacing, typography → Tailwind config or CSS vars
i18n Text Extraction: Extract text nodes with suggested i18n keys
Accessibility Audit: WCAG 2.1 AA/AAA audit (contrast, touch targets, text sizes)
Component Registry Sync: Compare Figma with local YAML registry
Visual Regression Export: Export frames for visual testing
Real-Time Change Notifications: Auto-sync index on document changes
Enhanced Plugin: Document/selection/page change event listeners
Auto-Index Invalidation: Smart cache invalidation based on change types
0.7.0 (DaisyUI Edition)
Local SQLite Index: Fast queries without Figma round-trips
FTS5 Search: Natural language component search
DaisyUI Detection: Automatic component-to-class mapping
Tailwind Extraction: Figma styles → Tailwind utilities
Code Generation: Jinja/HTMX templates, Page Objects
Agent-Optimized: Smaller responses with ready-to-use commands
Previous (from upstream)
See CHANGELOG.md for upstream history.
License & Credits
License: MIT
This Fork:
DaisyUI Edition enhancements for comprehensive Figma-to-Code pipeline
Additional tools for design token extraction, accessibility auditing, and code generation
Upstream:
arinspunk/claude-talk-to-figma-mcp - Claude adaptation by Xúlio Zé
cursor-talk-to-figma-mcp - Original by Sonny Lazuardi
Contributing
Fork this repo
Create feature branch:
git checkout -b feature/amazingMake changes and test
Submit PR with clear description
Focus areas for contribution:
Additional DaisyUI component patterns
More Tailwind mapping coverage
Enhanced code generation (React, Vue templates)
Better theme token extraction
Additional accessibility checks
More i18n key generation patterns
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
Compare Figma designs against live websites and get visual + content QA reports, from inside Claude.
Run accessibility, contrast, and design token audits and file QA issues from your AI coding tool.
Edit and publish your FramerToNextJS sites (converted Framer or AI-built) from Claude, Cursor or Codex. 19 tools: read pages, rewrite copy, restyle elements, add sections and pages, design Studio sites, manage CMS collections and items, then publish to your own host. OAuth with a read-only option, and MCP runs no model on FNJ's side. Requires an FNJ plan (Lifetime or any AI builder plan).
Serves your design system and coding standards to coding agents, so they stop guessing.
Related MCP Servers
- AlicenseCqualityDmaintenanceEnables Claude Desktop and other AI tools to interact directly with Figma, allowing for powerful AI-assisted design capabilities through natural language commands.92844 npm682MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants like Claude Desktop to interact directly with Figma, allowing natural language commands to create, modify, and analyze designs including shapes, text, components, and layouts in real-time.MIT
- AlicenseNot gradedqualityDmaintenanceEnables Claude to interact directly with Figma Desktop for creating UI components, managing design tokens, and auditing files through natural language. It establishes a live connection between the AI and the Figma API via a local server and companion plugin.MIT
- FlicenseNot gradedqualityDmaintenanceEnables Claude to interact with Figma designs, convert designs to code, extract variables, get screenshots, and more.1-