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 DeveloperTools Server and MCP 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
Dual Background Visualization: Create interactive HTML and high-quality PNG visualizations with both light and dark background variants
Export Formats: Generate CSS, SCSS, Tailwind CSS, and JSON exports for seamless integration
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 20.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 imagesexport_css
: Generate modern CSS with custom properties and utility classesexport_scss
: Generate SCSS variables, maps, and mixinsexport_tailwind
: Generate Tailwind CSS configuration and utility classesexport_json
: Generate JSON format for programmatic use and API integration
API
MCP Protocol
The server implements the Model Context Protocol (MCP) specification and provides the following endpoints:
Tool Discovery
Tool Execution
Response Format
All tools return responses in this standardized format:
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
Export Format Generation
Generate complete stylesheets and configuration files:
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 docs/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 docs/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/
Production Deployment
System Requirements
Node.js: 20.0.0 or higher
Memory: 512MB minimum, 2GB recommended
CPU: 1 core minimum, 2+ cores recommended for high load
Storage: 100MB for application, additional space for logs and cache
Performance Characteristics
Response Times: < 100ms for color conversions, < 2s for complex visualizations
Throughput: 50+ concurrent requests supported
Memory Usage: < 100MB per request, intelligent caching and cleanup
Reliability: 99.9% uptime with proper deployment and monitoring
Deployment Options
Docker Deployment
PM2 Deployment
Systemd Service
Monitoring and Maintenance
Health Checks: Built-in health endpoint at
/health
Metrics: Performance metrics and resource usage tracking
Logging: Structured JSON logging with configurable levels
Alerts: Memory usage, response time, and error rate monitoring
Security
Security Features
Input Validation: Comprehensive validation for all color formats and parameters
XSS Prevention: Sanitization of generated HTML, CSS, and SVG content
Rate Limiting: Built-in rate limiting for expensive operations
Resource Protection: Memory limits, processing timeouts, and cleanup
Audit Logging: Security-relevant events logged without exposing sensitive data
Security Best Practices
Run with minimal privileges: Use dedicated user account
Network security: Run behind reverse proxy with HTTPS
Resource limits: Configure appropriate memory and CPU limits
Regular updates: Keep dependencies updated for security patches
Monitoring: Monitor for suspicious activity and resource usage
Vulnerability Reporting
Report security vulnerabilities privately to: security@mcp-color-server.org
See docs/security.md for detailed security policy and reporting procedures.
Roadmap
Current Version (0.1.0)
✅ Complete color format conversion system
✅ Palette generation with color theory algorithms
✅ Gradient creation and visualization
✅ Theme generation and semantic color mapping
✅ Accessibility compliance tools
✅ HTML and PNG visualization generation
✅ Export formats (CSS, SCSS, Tailwind, JSON)
✅ Performance optimization and caching
✅ Security hardening and input validation
Planned Features (Future Releases)
🔄 3D color space visualizations
🔄 Color animation and transitions
🔄 Advanced image color extraction
🔄 Educational content and tutorials
🔄 Plugin architecture for custom algorithms
🔄 RESTful API endpoints
🔄 Advanced gradient types (mesh, conic)
🔄 Mobile framework integrations
Community Contributions Welcome
Color theory algorithm improvements
New export format support
Performance optimizations
Documentation enhancements
Test coverage improvements
Accessibility features
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.