Package Exports
- ainative-design-system-mcp-server
- ainative-design-system-mcp-server/build/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (ainative-design-system-mcp-server) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
π¨ AINative Design System MCP Server
A comprehensive Model Context Protocol (MCP) server that provides AI assistants with powerful design system management capabilities. Extract design tokens, analyze components, generate themes, and create comprehensive style guidesβall through natural language conversations with Claude Code.
π Quick Start
# Install globally
npm install -g ainative-design-system-mcp-server
# Add to Claude Code
claude mcp add ainative-design-system -- ainative-design-system-mcp
# Start using with Claude!Features
π¨ Design Token Management
- Extract design tokens from CSS, SCSS, Less, Stylus files
- Parse CSS variables and custom properties
- Analyze color palettes and generate variations
- Typography scale detection and optimization
- Spacing system analysis and standardization
- Generate token files in JSON, YAML, JavaScript formats
π§© Component Analysis
- Component library scanning across multiple frameworks
- Style extraction from component files
- Prop analysis and documentation generation
- Variant detection and categorization
- Usage pattern analysis
π Theme Management
- Multi-theme support and generation
- Dark/light mode automatic detection
- Brand color extraction and palette generation
- Accessibility compliance checking (WCAG)
- Color contrast analysis and optimization
π± Responsive Design
- Breakpoint detection from CSS and design files
- Grid system analysis and documentation
- Component responsiveness evaluation
- Mobile-first pattern detection
π Integration Support
- Tailwind CSS configuration generation
- Styled Components theme creation
- Material-UI theme adaptation
- Chakra UI theme configuration
- CSS-in-JS library integration
Installation
npm install @ainative/design-system-mcp-serverUsage
Claude Desktop Integration
Add to your Claude Desktop configuration:
{
"mcpServers": {
"design-system": {
"command": "node",
"args": ["/path/to/design-system-mcp-server/build/index.js"],
"env": {
"DESIGN_SYSTEM_PATH": "/path/to/your/design/system",
"OUTPUT_FORMAT": "json"
}
}
}
}Available Tools
1. Extract Design Tokens
await extractDesignTokens({
source: "path/to/styles",
formats: ["css", "scss", "less"],
output: "tokens.json",
categories: ["colors", "typography", "spacing"]
});2. Analyze Component Library
await analyzeComponentLibrary({
source: "src/components",
framework: "react",
includeStyles: true,
generateDocs: true
});3. Generate Theme
await generateTheme({
baseColors: ["#3B82F6", "#10B981"],
modes: ["light", "dark"],
format: "tailwind",
accessibility: true
});4. Create Component Documentation
await createComponentDocs({
components: "src/components/**/*.tsx",
output: "docs/components",
includeStorybook: true,
generateExamples: true
});5. Validate Design System
await validateDesignSystem({
source: "design-system/",
rules: ["consistency", "accessibility", "performance"],
reportFormat: "detailed"
});Configuration
Environment Variables
DESIGN_SYSTEM_PATH: Root path to your design systemOUTPUT_FORMAT: Default output format (json, yaml, js)INCLUDE_EXAMPLES: Include usage examples in outputACCESSIBILITY_LEVEL: WCAG compliance level (A, AA, AAA)FRAMEWORK_SUPPORT: Supported frameworks (react,vue,angular)
Configuration File
Create a design-system.config.json:
{
"tokenCategories": {
"colors": {
"primary": ["primary", "brand", "main"],
"secondary": ["secondary", "accent"],
"semantic": ["success", "error", "warning", "info"]
},
"typography": {
"scales": ["heading", "body", "caption"],
"weights": ["light", "regular", "medium", "bold"]
},
"spacing": {
"scale": "modular",
"base": 16,
"ratio": 1.5
}
},
"breakpoints": {
"mobile": 480,
"tablet": 768,
"desktop": 1024,
"wide": 1440
},
"accessibility": {
"contrastRatio": 4.5,
"wcagLevel": "AA",
"checkFocus": true
}
}Examples
Extracting Tokens from Figma Design
// Extract design tokens from Figma file
const tokens = await extractDesignTokens({
source: "figma://file-key",
categories: ["colors", "typography", "spacing"],
format: "css-variables"
});
// Generate Tailwind config
const tailwindConfig = await generateFrameworkConfig({
tokens,
framework: "tailwind",
includeComponents: true
});Building Component Library Documentation
// Analyze existing components
const analysis = await analyzeComponentLibrary({
source: "src/components",
framework: "react",
includeStyles: true
});
// Generate comprehensive docs
const docs = await createComponentDocs({
analysis,
format: "markdown",
includeStorybook: true,
generatePlayground: true
});Creating Multi-Theme System
// Extract base colors from brand assets
const brandColors = await extractColorsFromImage({
source: "assets/logo.png",
count: 5,
accessibility: true
});
// Generate complete theme system
const themes = await generateMultiTheme({
baseColors: brandColors,
modes: ["light", "dark", "high-contrast"],
platforms: ["web", "mobile", "desktop"]
});API Reference
Core Functions
extractDesignTokens(options)
Extract design tokens from various sources.
Parameters:
source: String or array of file paths/URLscategories: Array of token categories to extractformat: Output format (json, yaml, css, scss)transform: Apply transformations (kebab-case, camelCase)
Returns:
tokens: Extracted design tokens objectmetadata: Information about source and extractionvalidation: Token validation results
analyzeComponentLibrary(options)
Analyze component library structure and styles.
Parameters:
source: Component directory pathframework: Target framework (react, vue, angular)includeStyles: Include style analysisdepth: Directory scanning depth
Returns:
components: Component analysis resultspatterns: Detected design patternsdependencies: Component dependenciessuggestions: Optimization suggestions
generateTheme(options)
Generate theme configuration for target framework.
Parameters:
baseColors: Primary colors for thememodes: Theme modes (light, dark)framework: Target frameworkaccessibility: Enable accessibility checks
Returns:
theme: Generated theme configurationvariations: Color variations and scalesaccessibility: Accessibility compliance reportexamples: Usage examples
Utility Functions
validateAccessibility(colors)
Check color combinations for WCAG compliance.
generateColorPalette(baseColor, options)
Generate complete color palette from base color.
optimizeTokens(tokens, options)
Optimize tokens for performance and consistency.
convertFormat(tokens, targetFormat)
Convert tokens between different formats.
Integration Examples
With Tailwind CSS
const tokens = await extractDesignTokens({
source: "design-tokens/",
format: "tailwind"
});
// Generate tailwind.config.js
const config = {
theme: {
colors: tokens.colors,
fontFamily: tokens.typography.families,
spacing: tokens.spacing
}
};With Styled Components
const theme = await generateTheme({
baseColors: tokens.colors.primary,
format: "styled-components"
});
// Use in styled-components
const Button = styled.button`
background: ${props => props.theme.colors.primary};
color: ${props => props.theme.colors.onPrimary};
`;With Material-UI
const muiTheme = await generateTheme({
tokens,
framework: "material-ui",
mode: "light"
});
// Apply to MUI theme
const theme = createTheme(muiTheme);Development
# Install dependencies
npm install
# Development mode
npm run dev
# Build
npm run build
# Test
npm test
# Lint
npm run lintContributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for new functionality
- Ensure all tests pass
- Submit a pull request
License
MIT License - see LICENSE file for details.
Support
- π§ Email: support@ainative.com
- π Issues: GitHub Issues
- π Documentation: Full Documentation
- π¬ Community: Discord