Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Oct 9, 2025

Overview

This PR adds a complete MCP (Model Context Protocol) server implementation to the igniteui-theming repository, enabling developers and AI assistants to generate production-ready CSS from the library's theming presets. This addresses the need for developers to easily implement design system CSS as handed off from design tools like Figma, Sketch, and Adobe XD.

What's New

MCP Server (mcp-server/)

A fully functional MCP server that exposes 5 powerful tools for CSS generation:

  1. generate_color_palette - Generates comprehensive color palette CSS variables

    • Supports all themes: material, bootstrap, fluent, indigo
    • Light and dark variants
    • Outputs 200+ CSS variables covering all color shades (50-900, A100-A700) with contrast colors
  2. generate_typography - Generates typography definitions and utility classes

    • All typography scales (h1-h6, subtitles, body text, buttons, captions, overlines)
    • CSS variables for all typography properties
    • Ready-to-use utility classes
  3. generate_elevations - Generates Material Design elevation definitions

    • 25 elevation levels (0-24)
    • Box-shadow CSS variables and utility classes
    • Supports material and indigo themes
  4. generate_sizing_spacing - Generates sizing and spacing utilities

    • Size variants: small, medium, large
    • Spacing modes: compact, cosy, comfortable
    • Responsive CSS variables
  5. generate_complete_theme - Generates complete theme bundles

    • Combines all components into a single CSS file
    • Perfect for quick theme scaffolding

CLI Tool

Command-line interface for testing and direct usage:

node cli.js palette --theme=material --variant=light --output=theme.css
node cli.js typography --theme=bootstrap
node cli.js elevations --theme=material
node cli.js spacing

Example Output

Generated CSS follows best practices with CSS custom properties:

:root {
  --ig-primary-50: hsl(204, 123%, 89%);
  --ig-primary-500: #0099ff;
  --ig-font-family: 'Titillium Web', sans-serif;
  --ig-h1-font-size: 6rem;
  --ig-elevation-12: 0 7px 8px -4px rgba(0,0,0,0.26), ...;
}

.ig-typography-h1 {
  font-family: var(--ig-font-family);
  font-size: var(--ig-h1-font-size);
  /* ... */
}

Use Cases

  • Design System Implementation: Convert Figma/Sketch design tokens to production CSS instantly
  • Multi-Brand Applications: Generate different themes for different brands
  • Light/Dark Mode: Easy switching between color variants
  • Rapid Prototyping: Quickly scaffold styled prototypes with consistent design tokens
  • AI-Assisted Development: Enable AI tools to generate CSS from design specifications

Technical Details

  • Built on @modelcontextprotocol/sdk for MCP protocol compliance
  • Uses sass-embedded for high-performance Sass compilation
  • Uses postcss for CSS post-processing
  • ES modules throughout for modern JavaScript
  • Integrates seamlessly with existing Sass functions and presets

Documentation

Comprehensive documentation included:

  • README.md - Installation, usage, and API reference
  • EXAMPLES.md - Real-world use cases and integration patterns
  • IMPLEMENTATION.md - Technical architecture details
  • demo.html - Interactive demonstration page

Testing

  • ✅ All new tests passing (4/4 test suites)
  • ✅ All existing tests passing (99/99 tests)
  • ✅ Build process verified (JSON, Tailwind, E2E)
  • ✅ Linting clean (stylelint, prettier)
  • ✅ Server startup verified

Usage with MCP Clients

Configure in Claude Desktop or other MCP clients:

{
  "mcpServers": {
    "igniteui-theming": {
      "command": "node",
      "args": ["/path/to/igniteui-theming/mcp-server/index.js"]
    }
  }
}

Files Changed

  • Added mcp-server/ directory with complete implementation
  • Updated package.json to include MCP server in npm package files
  • Updated README.md with MCP server documentation section
  • Updated Jest configuration to exclude MCP server tests (uses ES modules)

No Breaking Changes

This PR introduces only new functionality with zero breaking changes to the existing codebase. All existing tests, builds, and functionality remain unchanged.

Original prompt

Create an igniteui-theming MCP server implementation, which exposes commands for generating color palettes, typography definitions, elevations, sizing and spacing definitions in css based on the theming parameters, mixins, functions, and data structures exposed by the igniteui-theming library. The high-level goal is for developers to be able to implement design system css implementations, as handed off by designers from Figma, Sketch, and other design tools.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Create MCP server for igniteui-theming implementation Add MCP server implementation for generating CSS from igniteui-theming library Oct 9, 2025
Copilot AI requested a review from kdinev October 9, 2025 06:47
Copilot finished work on behalf of kdinev October 9, 2025 06:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants