The MCP Color Server provides comprehensive color manipulation, conversion, and analysis capabilities for AI applications and developers.
• Convert colors between 22+ formats including HEX, RGB, HSL, HSV, HWB, CMYK, LAB, XYZ, LCH, OKLAB, OKLCH, and named colors with configurable precision up to 10 decimal places • Analyze color properties including brightness, temperature, contrast, and accessibility, plus compare colors with usage recommendations • Check WCAG accessibility compliance for color contrast against WCAG 2.1 (AA/AAA) and APCA standards, considering text size • Generate framework-specific outputs for CSS variables, SCSS, Tailwind classes, Swift UIColor, Android Color, and Flutter Color • Create color palettes based on harmony principles and generate complete design system themes with semantic color mapping • Generate gradients with linear, radial, and conic options plus advanced interpolation • Produce visualizations including interactive HTML and high-quality PNG images of colors and palettes
Provides color format conversion to Android Color syntax for mobile app development
Supports CSS color formats, variables, gradients, and WCAG accessibility compliance for web styling
Uses ESLint for code quality enforcement and issue detection during development
Provides color format conversion to Flutter Color syntax for cross-platform app development
Integrates with GitHub for issue tracking, discussions, and project management
Uses Jest testing framework for comprehensive test suite execution and coverage reporting
Built on Node.js runtime environment for server execution and package management
Uses npm package manager for dependency management and project scripts
Uses Prettier for automatic code formatting and style consistency
Provides color format conversion to Swift UIColor syntax for iOS app development
Converts colors to Tailwind CSS class names for utility-first CSS framework integration
Built with TypeScript for type safety, strict mode checking, and enhanced development experience
Supports Yarn package manager as an alternative to npm for dependency management
MCP Color Server
A comprehensive Model Context Protocol (MCP) server that provides advanced color manipulation, palette generation, gradient creation, and visualization capabilities to AI applications.
Features
- Comprehensive Color Format Support: Convert between 22+ formats including HEX, RGB, HSL, HSV, HWB, CMYK, LAB, XYZ, LCH, OKLAB, OKLCH, and named colors
- Framework Integration: Native support for CSS variables, SCSS, Tailwind classes, Swift UIColor, Android Color, and Flutter Color formats
- High-Precision Conversion: Configurable precision up to 10 decimal places for scientific and professional applications
- Palette Generation: Create harmonious color palettes based on color theory principles
- Gradient Creation: Generate linear, radial, and conic gradients with advanced interpolation
- Accessibility Compliance: WCAG 2.1 AA/AAA contrast checking and colorblind simulation
- Visualization Generation: Create interactive HTML and high-quality PNG visualizations
- Theme Generation: Generate complete design system themes with semantic color mapping
- Performance Optimized: Sub-100ms response times for all color operations with intelligent caching
Installation
Prerequisites
- Node.js 18.0.0 or higher
- npm or yarn package manager
Install Dependencies
Development Setup
Usage
As an MCP Server
The color server implements the Model Context Protocol and can be used with any MCP-compatible client.
Configuration
Add to your MCP client configuration:
Available Tools
convert_color
: Convert colors between different formatsanalyze_color
: Analyze color properties (brightness, contrast, temperature)generate_harmony_palette
: Create color palettes based on harmony principlesgenerate_gradient
: Create CSS gradients with advanced optionscheck_contrast
: Verify WCAG accessibility compliancecreate_palette_html
: Generate interactive HTML visualizationscreate_palette_png
: Generate high-quality PNG images
Supported Color Formats
Input Formats
The MCP Color Server accepts colors in any of these formats:
Standard Web Formats
- HEX:
#FF0000
,#F00
,FF0000
,F00
- RGB:
rgb(255, 0, 0)
,255, 0, 0
,255 0 0
,[255, 0, 0]
- RGBA:
rgba(255, 0, 0, 0.5)
- HSL:
hsl(0, 100%, 50%)
,0, 100%, 50%
- HSLA:
hsla(0, 100%, 50%, 0.8)
- HSV/HSB:
hsv(0, 100%, 100%)
,hsb(0, 100%, 100%)
- HSVA:
hsva(0, 100%, 100%, 0.7)
Advanced Color Spaces
- HWB:
hwb(0, 0%, 0%)
- CMYK:
cmyk(0%, 100%, 100%, 0%)
- LAB:
lab(53.23, 80.11, 67.22)
- XYZ:
xyz(41.24, 21.26, 1.93)
- LCH:
lch(53.23, 104.55, 40.85)
- OKLAB:
oklab(0.628, 0.225, 0.126)
- OKLCH:
oklch(0.628, 0.258, 29.23)
Named Colors
- CSS Named Colors:
red
,blue
,forestgreen
,lightsteelblue
, etc.
Output Formats
Convert to any of these formats with configurable precision:
Web Development
CSS Variables
Mobile Development
Framework Integration
Scientific/Professional
Usage Examples
Basic Color Conversion
Advanced Color Space Conversions
Framework-Specific Outputs
Performance Characteristics
- Single Conversions: < 100ms response time
- Batch Operations: < 20ms average per conversion
- High Precision: Up to 10 decimal places without performance impact
- Memory Efficient: Optimized for concurrent operations
- Caching: Intelligent caching for frequently converted colors
Direct Usage
Development
Project Structure
Code Quality
This project maintains high code quality standards with automated Git hooks:
- Pre-commit Hooks: Automatic linting, formatting, and type checking on staged files
- Pre-push Hooks: Full test suite with 90%+ coverage requirements and build verification
- Commit Message Validation: Enforces conventional commit format
- Zero-Defect Policy: No TypeScript errors, ESLint warnings, or failing tests allowed
See Husky Setup Documentation for detailed information about our Git hooks.
- TypeScript: Strict mode enabled with comprehensive type checking
- ESLint: Enforces code style and catches potential issues
- Prettier: Automatic code formatting
- Jest: Comprehensive test suite with 90%+ coverage requirement
- Continuous Integration: Automated testing and quality checks
Contributing
Please read CONTRIBUTING.md for details on our code of conduct and the process for submitting pull requests.
Testing
Building
License
This project is licensed under the MIT License - see the LICENSE file for details.
Contributing
We welcome contributions! Please see CONTRIBUTING.md for guidelines.
Code of Conduct
This project adheres to a Code of Conduct. By participating, you are expected to uphold this code.
Support
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Documentation: docs/
Roadmap
See our project roadmap for planned features and improvements.
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
Enables comprehensive color manipulation, conversion between 22+ formats (HEX, RGB, HSL, CMYK, LAB, etc.), palette generation, gradient creation, and accessibility compliance checking. Supports framework-specific outputs for CSS, Swift, Android, Flutter, and Tailwind with high-precision conversions and visualization capabilities.