tokensqueezer-mcp
Integrates with the TokenSqueezer Figma plugin to stream selected frames and components into AI coding agents, including token-compressed UI code in multiple formats, design specs, W3C design tokens, component hierarchy data, accessibility contrast reports, selection comparisons, layer search, and AI annotations written back to Figma layers.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@tokensqueezer-mcp grab my selected Figma frame as shadcn code and check its contrast"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
tokensqueezer-mcp
Companion local Model Context Protocol (MCP) bridge for the TokenSqueezer Figma Plugin (v1.4.1).
Requires the Figma Plugin: Install TokenSqueezer on Figma Community to inspect, compress, and stream Figma frames into your AI coding agent.
tokensqueezer-mcp connects the Figma plugin to Cursor, Claude Desktop, Claude Code, Windsurf, and Antigravity over localhost:3333 — streaming token-compressed UI code (60–90% fewer tokens across 9 formats), W3C DTCG design tokens, Light/Dark variable modes, WCAG 2.2 contrast audits, multimodal PNG previews, and bidirectional canvas annotations with 100% local-first privacy.
Quick Start (Zero-Terminal Setup)
1. Install the Figma Plugin
Open TokenSqueezer on Figma Community and run it inside Figma or Dev Mode.
2. Add to Your AI Editor's MCP Config
Paste into ~/.cursor/mcp.json, Claude claude_desktop_config.json, Windsurf, or Antigravity mcp_config.json:
{
"mcpServers": {
"tokensqueezer": {
"command": "npx",
"args": ["-y", "tokensqueezer-mcp@latest"]
}
}
}When your AI editor loads or refreshes its MCP servers, tokensqueezer-mcp automatically starts a lightweight background HTTP listener on http://localhost:3333 — no manual terminal required, even in editors that spawn MCP tools lazily on demand.
3. Send Context from Figma
In the TokenSqueezer Figma plugin:
Open Settings → MCP Mode (shows ✓ Connected).
Select any frame or component and click Send to MCP.
Related MCP server: figma-mcp
Optional CLI Commands
Run interactively in a terminal with live request logs:
npx -y tokensqueezer-mcp@latestStop the background localhost:3333 listener manually at any time:
npx -y tokensqueezer-mcp@latest --stopIncluded MCP Capabilities
8 Tools
get_figma_context— Retrieve squeezed design output in any of 9 formats (jsx,shadcn,vue,svelte,md,html,tailwind,spec,dtcg) with on-the-fly compression (full,compact,sparse) + multimodal PNG preview.get_design_spec— StructuredDESIGN.mdspecification with YAML tokens, Light/Dark modes, and WCAG 2.2 audit.get_design_tokens— W3C Design Tokens Community Group (tokens.json) export.list_figma_components— Component sets, instances, variant properties, and full hierarchy paths.compare_selections— Token and layer diff between current and previous Figma selections.get_accessibility_report— WCAG 2.2 sRGB relative luminance contrast report.search_layers— Search layers by name, text content, or semantic category.add_figma_annotation— Write AI review notes directly back onto the selected Figma layer.
3 Prompts & 3 Resources
Prompts:
implement_component,extract_design_tokens,audit_accessibilityResources:
figma://current-selection,figma://design-tokens,figma://design-spec
Privacy & Security
Loopback Only: Accepts connections strictly from
127.0.0.1/::1(localhost:3333); external network requests are rejected (403).Explicit Consent: Design context is sent from Figma only when you click "Send to MCP".
Local Cache: Latest selection state is stored locally in
~/.tokensqueezer/with user-only permissions (0700/0600), and the background listener automatically exits after 12 hours of inactivity.
Figma Plugin: https://www.figma.com/community/plugin/1665050072562427069/
Author: Ufuk Aydin • MIT License
Available Tools
8 toolsadd_figma_annotationB
Write an AI feedback note or annotation directly back onto the selected Figma layer (attaches native Dev Mode annotation + visual AI Note card on the Figma canvas).
Inputs: annotation (required).
compare_selectionsB
Compare the current Figma selection with the previous selection (token delta, node count delta, and added/removed layer names).
Inputs: no named parameters.
get_accessibility_reportA
Get WCAG 2.2 sRGB relative-luminance contrast audit results for the current Figma selection.
Inputs: no named parameters.
get_design_specB
Get the DESIGN.md specification (YAML tokens, Multi-Theme Light/Dark modes, Components, and WCAG 2.2 Accessibility Audit) for the selected Figma frame.
Inputs: no named parameters.
get_design_tokensA
Get design tokens from the current Figma selection in W3C Design Tokens Community Group (DTCG) JSON format, including colors, multi-theme modes, typography, spacing, shadows, and gradients.
Inputs: no named parameters.
get_figma_contextB
Get the current squeezed Figma design context + optional multimodal PNG preview. Supports 9 output formats and on-the-fly compression levels (full, compact, sparse).
Inputs: output, compression, include_metadata.
list_figma_componentsA
List all components, component sets, instances, and variant states in the current Figma selection tree with full hierarchy paths.
Inputs: no named parameters.
search_layersA
Search layers by name, text content, or semantic type in the current Figma selection tree and return full breadcrumb paths.
Inputs: query (required), type.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 8 tools
Most tools have distinct purposes (search_layers, compare_selections, add_figma_annotation, get_accessibility_report), but three tools overlap heavily on extracting design data: get_figma_context, get_design_spec, and get_design_tokens all return tokens/structure from the same selection in different formats. An agent must read descriptions carefully to pick the right one, since the 'squeezed design context' could plausibly include the spec and tokens.
All names follow a consistent snake_case verb_noun pattern (get_, list_, add_, search_, compare_). Minor inconsistency: 'figma' is embedded in some names (add_figma_annotation, list_figma_components, get_figma_context) but absent in others (get_design_spec, get_design_tokens, search_layers), which adds noise but doesn't break predictability.
Eight tools is well within the ideal 3-15 range and each earns its place: four read/extract tools, one search, one compare, one audit, and one write-back. No redundant or trivially thin tools for a Figma design-context server.
The surface covers the full read lifecycle (context, spec, tokens, components, layers, accessibility) plus a write-back tool (add_figma_annotation) and a delta tool (compare_selections), which is strong coverage. Minor gaps: no asset/image export beyond the PNG preview, and no bulk annotation or token export-to-file operation, but agents can work around these.
Related MCP Connectors
Run accessibility, contrast, and design token audits and file QA issues from your AI coding tool.
The Figma MCP server brings Figma design context directly into your AI workflow.
Serves your design system and coding standards to coding agents, so they stop guessing.
Build and manage your design system with AI: tokens, themes, components, icons, Figma and code.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables AI coding agents to read and write a user's Figma file through the Figma Plugin API, offline and privately, without API tokens or rate limits.-
- AlicenseNot gradedqualityBmaintenanceEnables AI coding assistants to draw UI directly on a Figma Desktop canvas and read existing designs back as structured JSON, tokens, CSS, and screenshots, all over a localhost bridge without external API keys.109 npm2MIT
- AlicenseNot gradedqualityAmaintenanceEnables AI agents to inspect Figma selections, navigate pages, render previews, generate starter code, and submit user-approved canvas edits through a local bridge.3 npmMIT
- FlicenseNot gradedqualityCmaintenanceEnables AI coding agents to inspect the currently selected Figma element or find layers by name, extracting layout, colors, typography, borders, and shadows as compact design tokens while exporting SVG and PNG assets straight into the local project. It connects over a local WebSocket to a running Figma session, so no API key, Dev Mode subscription, or manual ZIP export is required.-