UI Toolkit MCP Server
Comprehensive MCP server for end-to-end UI development, offering tools to generate components, manage design tokens, audit accessibility, autofix issues, inspect live pages, compare screenshots, and more across multiple frameworks.
README
UI Toolkit MCP Server
The most comprehensive UI MCP server available. 13 tools, 5 resources, 3 prompts for end-to-end UI development: generate components, manage design tokens, audit accessibility, auto-fix issues, inspect live pages, compare screenshots, generate Storybook stories, extract Figma styles, compose layouts, and preview responsive designs -- across React, Vue, Svelte, Angular, and Web Components.
Works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor IDE, Continue.dev, Cline, and Zed.
Installation
npx (No Install)
npx -y @elsahafy/ui-toolkit-mcp
npm (Global)
npm install -g @elsahafy/ui-toolkit-mcp
Claude Code CLI
claude mcp add ui-toolkit -- npx -y @elsahafy/ui-toolkit-mcp
Claude Desktop
Add to claude_desktop_config.json:
{
"mcpServers": {
"ui-toolkit": {
"command": "npx",
"args": ["-y", "@elsahafy/ui-toolkit-mcp"]
}
}
}
Cursor IDE
Add to ~/.cursor/mcp.json:
{
"mcpServers": {
"ui-toolkit": {
"command": "npx",
"args": ["-y", "@elsahafy/ui-toolkit-mcp"]
}
}
}
Optional: Browser Tools
For inspect_page, live_audit, and responsive_preview, install Playwright separately:
npm install playwright
npx playwright install chromium
All other tools work without Playwright.
Tools (13)
Component Generation
generate_component
Generate production-ready UI components from natural language. Automatically audits the output and reports issues inline.
"Generate a card component with image, title, and action buttons in React"
Parameters:
description(required) -- What to buildframework(required) --react|vue|svelte|angular|web-componentscomponent_name(required) -- PascalCase name (e.g.,ProductCard)variant--default|outlined|filled|ghost|elevatedsize--sm|md|lg|xlauto_audit-- Automatically audit generated output (default: true)include_styles-- Include CSS with design tokens (default: true)include_tests-- Generate test file (default: false)responsive-- Include breakpoints (default: true)
Generated components are automatically registered in the component registry.
compose_layout
Compose a full page layout from previously generated components in the registry.
"Compose a page from Hero, Features, and Footer components in React"
Parameters:
component_names(required) -- Array of component names from the registryframework(required) -- Target frameworklayout_description-- Description of the page layout
Produces a complete page with imports, semantic structure (<header>, <main>, <footer>), and skip navigation.
Design Tokens
import_design_tokens
Import design tokens from Figma Tokens JSON, Style Dictionary, or CSS custom properties.
Parameters:
tokens_json(required) -- Raw JSON string of tokensformat(required) --figma-tokens|style-dictionary|css-custom-propertiesnamespace-- Optional prefix (e.g.,brand)merge_strategy--replace|merge-overwrite|merge-keep
extract_figma_styles
Extract design tokens directly from a Figma file via the REST API.
Parameters:
figma_file_key(required) -- Alphanumeric file key from Figma URLfigma_pat(required) -- Figma Personal Access Token (never stored or logged)node_ids-- Optional specific nodes to extractnamespace-- Optional CSS variable prefixmerge_strategy-- How to handle existing tokens
export_tokens
Export the active token store as CSS custom properties, JSON, or Style Dictionary format.
Parameters:
format--css|json|style-dictionary(default:css)
clear_tokens
Clear all design tokens from the active store.
Auditing & Fixing
audit_component
Audit markup for WCAG accessibility, performance, and responsive design issues. Returns scored findings with fix suggestions.
Parameters:
markup(required) -- HTML/JSX/Vue/Svelte markupcomponent_name-- For report labelingcategories--["accessibility", "performance", "responsive"]wcag_level--A|AA|AAAframework-- Affects how markup is parsed
29 built-in rules: 12 accessibility (WCAG), 9 performance, 8 responsive design.
auto_fix_component
Automatically fix common accessibility and performance issues based on audit findings.
"Auto-fix the accessibility issues in this component"
Parameters:
markup(required) -- The markup to fixfindings(required) -- Array of AuditFinding objects fromaudit_component
Supported auto-fixes: missing alt text, missing lang attribute, missing lazy loading, positive tabindex, px font-sizes to rem.
live_audit
Navigate to a live URL and audit the rendered HTML. Combines browser inspection with markup auditing in one call. Requires Playwright.
Parameters:
target_url(required) -- HTTP/HTTPS URL (private IPs blocked)categories-- Audit categories to runwcag_level-- WCAG conformance level
Browser Tools (Playwright)
Install separately:
npm install playwright && npx playwright install chromium
inspect_page
Navigate to a live URL and extract accessibility tree, component structure, performance metrics, and screenshot.
Parameters:
target_url(required) -- HTTP/HTTPS URL (private IPs blocked)viewport_width/viewport_height-- Viewport sizewait_for--load|domcontentloaded|networkidletimeout_ms-- Navigation timeoutinclude_screenshot-- Base64 PNG screenshot (default: true)
visual_diff
Pixel-by-pixel PNG comparison for visual regression testing. No Playwright required.
Parameters:
before_image(required) -- Base64 PNGafter_image(required) -- Base64 PNGthreshold-- Per-channel tolerance (0-255, default: 10)
responsive_preview
Screenshot a URL at mobile (375px), tablet (768px), and desktop (1280px) viewports. Requires Playwright.
Parameters:
target_url(required) -- HTTP/HTTPS URL (private IPs blocked)
Storybook
generate_story
Auto-generate CSF3 Storybook stories with prop detection, play functions, and accessibility addon config.
Parameters:
component_code(required) -- Full component source codeframework(required) --react|vue|svelte|angularcomponent_name(required) -- PascalCase namestory_title-- Storybook path (default:Components/{name})
Detects props via regex from: TypeScript interfaces (React), defineProps (Vue), export let (Svelte), @Input() (Angular).
Resources (5)
| URI | Description |
|---|---|
ui://tokens/active |
Currently loaded design tokens |
ui://patterns/components |
Component pattern library (12 patterns with a11y requirements) |
ui://components/registry |
Registry of all generated components with audit scores |
ui://server/health |
Server version, tool count, token count, uptime |
ui://audit/checklist |
Full audit rule reference (auto-generated from rule definitions) |
Prompts (3)
| Prompt | Description |
|---|---|
build_page |
Generate a full page with multiple components using design tokens |
component_audit |
Comprehensive audit + fix workflow |
design_to_code |
Full Figma-to-code: extract tokens, generate components, audit, generate stories |
Key Features
Audit-at-Generation-Time
Every component generated by generate_component is automatically audited for accessibility, performance, and responsive issues. Critical findings are reported inline. No other UI MCP server does this.
Component Registry
All generated components are tracked with metadata (framework, tokens used, audit score, timestamp). Use compose_layout to assemble them into full pages.
Design Token Pipeline
Import tokens from Figma, Style Dictionary, or CSS custom properties. Export in any format. Tokens are automatically applied to generated components.
Framework Agnostic
All 13 tools support React, Vue, Svelte, Angular, and Web Components. One server, any framework.
Architecture
src/
index.ts # Server entry (thin orchestrator)
lib/
types.ts # Shared TypeScript interfaces
token-store.ts # In-memory design token state
component-registry.ts # Component tracking
framework-templates.ts # 5 framework component generators
story-templates.ts # CSF3 story templates + prop detection
accessibility-rules.ts # 12 WCAG audit rules
performance-rules.ts # 9 performance audit rules
responsive-rules.ts # 8 responsive design rules
pattern-library.ts # 12 component patterns
browser.ts # Playwright lifecycle + URL validation
validation.ts # Shared input validation
utils.ts # Shared utilities (kebab, clamp, fileExt)
tools/
generate-component.ts # + auto-audit + registry
import-design-tokens.ts
audit-component.ts
auto-fix-component.ts
inspect-page.ts
visual-diff.ts
generate-story.ts
extract-figma-styles.ts
export-tokens.ts
clear-tokens.ts
live-audit.ts
responsive-preview.ts
compose-layout.ts
index.ts # Tool registry + dispatch
resources/
index.ts # 5 resources
prompts/
index.ts # 3 workflow prompts
tests/
lib/ # 11 library test files
tools/ # 12 tool test files
184 tests across 23 test files. All source files have dedicated test coverage.
Security
- No code execution -- all
markupparameters are analyzed via regex, never evaluated - URL validation blocks private IPs (127.x, 10.x, 172.16-31.x, 192.168.x, fe80::, fc00::, localhost)
- Only HTTP/HTTPS schemes allowed for browser tools
- Figma PAT is never stored, logged, or returned in responses (sanitized from error messages)
- All string inputs have
maxLengthconstraints enforced at runtime - No credential keywords in resource URIs
- Input validation helper shared across all tool handlers
License
MIT
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。