Skip to main content
Glama
index.html68.1 kB
<!DOCTYPE html><html class="default" lang="en" data-base="./"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>MCP Color Server API Documentation - v0.1.0</title><meta name="description" content="Documentation for MCP Color Server API Documentation"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="assets/style.css"/><link rel="stylesheet" href="assets/highlight.css"/><script defer src="assets/main.js"></script><script async src="assets/icons.js" id="tsd-icons-script"></script><script async src="assets/search.js" id="tsd-search-script"></script><script async src="assets/navigation.js" id="tsd-nav-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => window.app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><a href="index.html" class="title">MCP Color Server API Documentation - v0.1.0</a><div id="tsd-toolbar-links"></div><button id="tsd-search-trigger" class="tsd-widget" aria-label="Search"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="assets/icons.svg#icon-search"></use></svg></button><dialog id="tsd-search" aria-label="Search"><input role="combobox" id="tsd-search-input" aria-controls="tsd-search-results" aria-autocomplete="list" aria-expanded="true" autocapitalize="off" autocomplete="off" placeholder="Search the docs" maxLength="100"/><ul role="listbox" id="tsd-search-results"></ul><div id="tsd-search-status" aria-live="polite" aria-atomic="true"><div>Preparing search index...</div></div></dialog><a href="#" class="tsd-widget menu" id="tsd-toolbar-menu-trigger" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="assets/icons.svg#icon-menu"></use></svg></a></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><h1>MCP Color Server API Documentation - v0.1.0</h1></div><div class="tsd-panel tsd-typography"><h1 id="mcp-color-server" class="tsd-anchor-link">MCP Color Server<a href="#mcp-color-server" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h1><p>A comprehensive DeveloperTools Server and MCP that provides advanced color manipulation, palette generation, gradient creation, and visualization capabilities to AI applications.</p> <h2 id="features" class="tsd-anchor-link">Features<a href="#features" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h2><ul> <li><strong>Comprehensive Color Format Support</strong>: Convert between 22+ formats including HEX, RGB, HSL, HSV, HWB, CMYK, LAB, XYZ, LCH, OKLAB, OKLCH, and named colors</li> <li><strong>Framework Integration</strong>: Native support for CSS variables, SCSS, Tailwind classes, Swift UIColor, Android Color, and Flutter Color formats</li> <li><strong>High-Precision Conversion</strong>: Configurable precision up to 10 decimal places for scientific and professional applications</li> <li><strong>Palette Generation</strong>: Create harmonious color palettes based on color theory principles</li> <li><strong>Gradient Creation</strong>: Generate linear, radial, and conic gradients with advanced interpolation</li> <li><strong>Accessibility Compliance</strong>: WCAG 2.1 AA/AAA contrast checking and colorblind simulation</li> <li><strong>Dual Background Visualization</strong>: Create interactive HTML and high-quality PNG visualizations with both light and dark background variants</li> <li><strong>Export Formats</strong>: Generate CSS, SCSS, Tailwind CSS, and JSON exports for seamless integration</li> <li><strong>Theme Generation</strong>: Generate complete design system themes with semantic color mapping</li> <li><strong>Performance Optimized</strong>: Sub-100ms response times for all color operations with intelligent caching</li> </ul> <h2 id="installation" class="tsd-anchor-link">Installation<a href="#installation" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h2><h3 id="prerequisites" class="tsd-anchor-link">Prerequisites<a href="#prerequisites" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3><ul> <li>Node.js 18.0.0 or higher</li> <li>npm or yarn package manager</li> </ul> <h3 id="install-dependencies" class="tsd-anchor-link">Install Dependencies<a href="#install-dependencies" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3><pre><code class="bash"><span class="hl-0">npm</span><span class="hl-1"> </span><span class="hl-2">install</span> </code><button type="button">Copy</button></pre> <h3 id="development-setup" class="tsd-anchor-link">Development Setup<a href="#development-setup" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3><pre><code class="bash"><span class="hl-3"># Install dependencies</span><br/><span class="hl-0">npm</span><span class="hl-1"> </span><span class="hl-2">install</span><br/><br/><span class="hl-3"># Build the project</span><br/><span class="hl-0">npm</span><span class="hl-1"> </span><span class="hl-2">run</span><span class="hl-1"> </span><span class="hl-2">build</span><br/><br/><span class="hl-3"># Run in development mode</span><br/><span class="hl-0">npm</span><span class="hl-1"> </span><span class="hl-2">run</span><span class="hl-1"> </span><span class="hl-2">dev</span><br/><br/><span class="hl-3"># Run tests</span><br/><span class="hl-0">npm</span><span class="hl-1"> </span><span class="hl-2">test</span><br/><br/><span class="hl-3"># Run tests with coverage</span><br/><span class="hl-0">npm</span><span class="hl-1"> </span><span class="hl-2">run</span><span class="hl-1"> </span><span class="hl-2">test:coverage</span><br/><br/><span class="hl-3"># Lint code</span><br/><span class="hl-0">npm</span><span class="hl-1"> </span><span class="hl-2">run</span><span class="hl-1"> </span><span class="hl-2">lint</span><br/><br/><span class="hl-3"># Format code</span><br/><span class="hl-0">npm</span><span class="hl-1"> </span><span class="hl-2">run</span><span class="hl-1"> </span><span class="hl-2">format</span> </code><button type="button">Copy</button></pre> <h2 id="usage" class="tsd-anchor-link">Usage<a href="#usage" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h2><h3 id="as-an-mcp-server" class="tsd-anchor-link">As an MCP Server<a href="#as-an-mcp-server" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3><p>The color server implements the Model Context Protocol and can be used with any MCP-compatible client.</p> <h4 id="configuration" class="tsd-anchor-link">Configuration<a href="#configuration" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h4><p>Add to your MCP client configuration:</p> <pre><code class="json"><span class="hl-1">{</span><br/><span class="hl-1"> </span><span class="hl-4">&quot;mcpServers&quot;</span><span class="hl-1">: {</span><br/><span class="hl-1"> </span><span class="hl-4">&quot;color&quot;</span><span class="hl-1">: {</span><br/><span class="hl-1"> </span><span class="hl-4">&quot;command&quot;</span><span class="hl-1">: </span><span class="hl-2">&quot;node&quot;</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">&quot;args&quot;</span><span class="hl-1">: [</span><span class="hl-2">&quot;path/to/mcp-color-server/dist/index.js&quot;</span><span class="hl-1">]</span><br/><span class="hl-1"> }</span><br/><span class="hl-1"> }</span><br/><span class="hl-1">}</span> </code><button type="button">Copy</button></pre> <h4 id="available-tools" class="tsd-anchor-link">Available Tools<a href="#available-tools" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h4><ul> <li><code>convert_color</code>: Convert colors between different formats</li> <li><code>analyze_color</code>: Analyze color properties (brightness, contrast, temperature)</li> <li><code>generate_harmony_palette</code>: Create color palettes based on harmony principles</li> <li><code>generate_gradient</code>: Create CSS gradients with advanced options</li> <li><code>check_contrast</code>: Verify WCAG accessibility compliance</li> <li><code>create_palette_html</code>: Generate interactive HTML visualizations</li> <li><code>create_palette_png</code>: Generate high-quality PNG images</li> <li><code>export_css</code>: Generate modern CSS with custom properties and utility classes</li> <li><code>export_scss</code>: Generate SCSS variables, maps, and mixins</li> <li><code>export_tailwind</code>: Generate Tailwind CSS configuration and utility classes</li> <li><code>export_json</code>: Generate JSON format for programmatic use and API integration</li> </ul> <h2 id="api" class="tsd-anchor-link">API<a href="#api" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h2><h3 id="mcp-protocol" class="tsd-anchor-link">MCP Protocol<a href="#mcp-protocol" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3><p>The server implements the Model Context Protocol (MCP) specification and provides the following endpoints:</p> <h4 id="tool-discovery" class="tsd-anchor-link">Tool Discovery<a href="#tool-discovery" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="json"><span class="hl-1">{</span><br/><span class="hl-1"> </span><span class="hl-4">&quot;jsonrpc&quot;</span><span class="hl-1">: </span><span class="hl-2">&quot;2.0&quot;</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">&quot;id&quot;</span><span class="hl-1">: </span><span class="hl-5">1</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">&quot;method&quot;</span><span class="hl-1">: </span><span class="hl-2">&quot;tools/list&quot;</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">&quot;params&quot;</span><span class="hl-1">: {}</span><br/><span class="hl-1">}</span> </code><button type="button">Copy</button></pre> <h4 id="tool-execution" class="tsd-anchor-link">Tool Execution<a href="#tool-execution" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="json"><span class="hl-1">{</span><br/><span class="hl-1"> </span><span class="hl-4">&quot;jsonrpc&quot;</span><span class="hl-1">: </span><span class="hl-2">&quot;2.0&quot;</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">&quot;id&quot;</span><span class="hl-1">: </span><span class="hl-5">2</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">&quot;method&quot;</span><span class="hl-1">: </span><span class="hl-2">&quot;tools/call&quot;</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">&quot;params&quot;</span><span class="hl-1">: {</span><br/><span class="hl-1"> </span><span class="hl-4">&quot;name&quot;</span><span class="hl-1">: </span><span class="hl-2">&quot;convert_color&quot;</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">&quot;arguments&quot;</span><span class="hl-1">: {</span><br/><span class="hl-1"> </span><span class="hl-4">&quot;color&quot;</span><span class="hl-1">: </span><span class="hl-2">&quot;#FF0000&quot;</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">&quot;output_format&quot;</span><span class="hl-1">: </span><span class="hl-2">&quot;hsl&quot;</span><br/><span class="hl-1"> }</span><br/><span class="hl-1"> }</span><br/><span class="hl-1">}</span> </code><button type="button">Copy</button></pre> <h3 id="response-format" class="tsd-anchor-link">Response Format<a href="#response-format" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3><p>All tools return responses in this standardized format:</p> <pre><code class="json"><span class="hl-1">{</span><br/><span class="hl-1"> </span><span class="hl-4">&quot;success&quot;</span><span class="hl-1">: </span><span class="hl-6">true</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">&quot;data&quot;</span><span class="hl-1">: {</span><br/><span class="hl-1"> </span><span class="hl-4">&quot;converted&quot;</span><span class="hl-1">: </span><span class="hl-2">&quot;hsl(0, 100%, 50%)&quot;</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">&quot;original&quot;</span><span class="hl-1">: </span><span class="hl-2">&quot;#FF0000&quot;</span><br/><span class="hl-1"> },</span><br/><span class="hl-1"> </span><span class="hl-4">&quot;metadata&quot;</span><span class="hl-1">: {</span><br/><span class="hl-1"> </span><span class="hl-4">&quot;execution_time&quot;</span><span class="hl-1">: </span><span class="hl-5">15</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">&quot;color_space_used&quot;</span><span class="hl-1">: </span><span class="hl-2">&quot;sRGB&quot;</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">&quot;accessibility_notes&quot;</span><span class="hl-1">: [],</span><br/><span class="hl-1"> </span><span class="hl-4">&quot;recommendations&quot;</span><span class="hl-1">: []</span><br/><span class="hl-1"> },</span><br/><span class="hl-1"> </span><span class="hl-4">&quot;visualizations&quot;</span><span class="hl-1">: {</span><br/><span class="hl-1"> </span><span class="hl-4">&quot;html&quot;</span><span class="hl-1">: </span><span class="hl-2">&quot;&lt;!DOCTYPE html&gt;...&quot;</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">&quot;png_base64&quot;</span><span class="hl-1">: </span><span class="hl-2">&quot;iVBORw0KGgoAAAANSUhEUgAA...&quot;</span><br/><span class="hl-1"> },</span><br/><span class="hl-1"> </span><span class="hl-4">&quot;export_formats&quot;</span><span class="hl-1">: {</span><br/><span class="hl-1"> </span><span class="hl-4">&quot;css&quot;</span><span class="hl-1">: </span><span class="hl-2">&quot;:root { --color: #FF0000; }&quot;</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">&quot;scss&quot;</span><span class="hl-1">: </span><span class="hl-2">&quot;$color: #FF0000;&quot;</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">&quot;tailwind&quot;</span><span class="hl-1">: </span><span class="hl-2">&quot;{ colors: { custom: &#39;#FF0000&#39; } }&quot;</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">&quot;json&quot;</span><span class="hl-1">: { </span><span class="hl-4">&quot;hex&quot;</span><span class="hl-1">: </span><span class="hl-2">&quot;#FF0000&quot;</span><span class="hl-1">, </span><span class="hl-4">&quot;rgb&quot;</span><span class="hl-1">: </span><span class="hl-2">&quot;rgb(255, 0, 0)&quot;</span><span class="hl-1"> }</span><br/><span class="hl-1"> }</span><br/><span class="hl-1">}</span> </code><button type="button">Copy</button></pre> <h2 id="supported-color-formats" class="tsd-anchor-link">Supported Color Formats<a href="#supported-color-formats" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h2><h3 id="input-formats" class="tsd-anchor-link">Input Formats<a href="#input-formats" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3><p>The MCP Color Server accepts colors in any of these formats:</p> <h4 id="standard-web-formats" class="tsd-anchor-link">Standard Web Formats<a href="#standard-web-formats" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h4><ul> <li><strong>HEX</strong>: <code>#FF0000</code>, <code>#F00</code>, <code>FF0000</code>, <code>F00</code></li> <li><strong>RGB</strong>: <code>rgb(255, 0, 0)</code>, <code>255, 0, 0</code>, <code>255 0 0</code>, <code>[255, 0, 0]</code></li> <li><strong>RGBA</strong>: <code>rgba(255, 0, 0, 0.5)</code></li> <li><strong>HSL</strong>: <code>hsl(0, 100%, 50%)</code>, <code>0, 100%, 50%</code></li> <li><strong>HSLA</strong>: <code>hsla(0, 100%, 50%, 0.8)</code></li> <li><strong>HSV/HSB</strong>: <code>hsv(0, 100%, 100%)</code>, <code>hsb(0, 100%, 100%)</code></li> <li><strong>HSVA</strong>: <code>hsva(0, 100%, 100%, 0.7)</code></li> </ul> <h4 id="advanced-color-spaces" class="tsd-anchor-link">Advanced Color Spaces<a href="#advanced-color-spaces" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h4><ul> <li><strong>HWB</strong>: <code>hwb(0, 0%, 0%)</code></li> <li><strong>CMYK</strong>: <code>cmyk(0%, 100%, 100%, 0%)</code></li> <li><strong>LAB</strong>: <code>lab(53.23, 80.11, 67.22)</code></li> <li><strong>XYZ</strong>: <code>xyz(41.24, 21.26, 1.93)</code></li> <li><strong>LCH</strong>: <code>lch(53.23, 104.55, 40.85)</code></li> <li><strong>OKLAB</strong>: <code>oklab(0.628, 0.225, 0.126)</code></li> <li><strong>OKLCH</strong>: <code>oklch(0.628, 0.258, 29.23)</code></li> </ul> <h4 id="named-colors" class="tsd-anchor-link">Named Colors<a href="#named-colors" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h4><ul> <li><strong>CSS Named Colors</strong>: <code>red</code>, <code>blue</code>, <code>forestgreen</code>, <code>lightsteelblue</code>, etc.</li> </ul> <h3 id="output-formats" class="tsd-anchor-link">Output Formats<a href="#output-formats" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3><p>Convert to any of these formats with configurable precision:</p> <h4 id="web-development" class="tsd-anchor-link">Web Development<a href="#web-development" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="json"><span class="hl-1">{</span><br/><span class="hl-1"> </span><span class="hl-4">&quot;color&quot;</span><span class="hl-1">: </span><span class="hl-2">&quot;#FF0000&quot;</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">&quot;output_format&quot;</span><span class="hl-1">: </span><span class="hl-2">&quot;hex&quot;</span><br/><span class="hl-1">}</span><br/><span class="hl-3">// Result: &quot;#ff0000&quot;</span><br/><br/><span class="hl-1">{</span><br/><span class="hl-1"> </span><span class="hl-4">&quot;color&quot;</span><span class="hl-1">: </span><span class="hl-2">&quot;#FF0000&quot;</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">&quot;output_format&quot;</span><span class="hl-1">: </span><span class="hl-2">&quot;rgb&quot;</span><br/><span class="hl-1">}</span><br/><span class="hl-3">// Result: &quot;rgb(255, 0, 0)&quot;</span><br/><br/><span class="hl-1">{</span><br/><span class="hl-1"> </span><span class="hl-4">&quot;color&quot;</span><span class="hl-1">: </span><span class="hl-2">&quot;#FF0000&quot;</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">&quot;output_format&quot;</span><span class="hl-1">: </span><span class="hl-2">&quot;hsl&quot;</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">&quot;precision&quot;</span><span class="hl-1">: </span><span class="hl-5">1</span><br/><span class="hl-1">}</span><br/><span class="hl-3">// Result: &quot;hsl(0.0, 100.0%, 50.0%)&quot;</span> </code><button type="button">Copy</button></pre> <h4 id="css-variables" class="tsd-anchor-link">CSS Variables<a href="#css-variables" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="json"><span class="hl-1">{</span><br/><span class="hl-1"> </span><span class="hl-4">&quot;color&quot;</span><span class="hl-1">: </span><span class="hl-2">&quot;#FF0000&quot;</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">&quot;output_format&quot;</span><span class="hl-1">: </span><span class="hl-2">&quot;css-var&quot;</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">&quot;variable_name&quot;</span><span class="hl-1">: </span><span class="hl-2">&quot;primary-color&quot;</span><br/><span class="hl-1">}</span><br/><span class="hl-3">// Result: &quot;--primary-color: #ff0000;&quot;</span><br/><br/><span class="hl-1">{</span><br/><span class="hl-1"> </span><span class="hl-4">&quot;color&quot;</span><span class="hl-1">: </span><span class="hl-2">&quot;#FF0000&quot;</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">&quot;output_format&quot;</span><span class="hl-1">: </span><span class="hl-2">&quot;scss-var&quot;</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">&quot;variable_name&quot;</span><span class="hl-1">: </span><span class="hl-2">&quot;accent_color&quot;</span><br/><span class="hl-1">}</span><br/><span class="hl-3">// Result: &quot;$accent_color: #ff0000;&quot;</span> </code><button type="button">Copy</button></pre> <h4 id="mobile-development" class="tsd-anchor-link">Mobile Development<a href="#mobile-development" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="json"><span class="hl-1">{</span><br/><span class="hl-1"> </span><span class="hl-4">&quot;color&quot;</span><span class="hl-1">: </span><span class="hl-2">&quot;#FF0000&quot;</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">&quot;output_format&quot;</span><span class="hl-1">: </span><span class="hl-2">&quot;swift&quot;</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">&quot;precision&quot;</span><span class="hl-1">: </span><span class="hl-5">3</span><br/><span class="hl-1">}</span><br/><span class="hl-3">// Result: &quot;UIColor(red: 1.000, green: 0.000, blue: 0.000, alpha: 1.000)&quot;</span><br/><br/><span class="hl-1">{</span><br/><span class="hl-1"> </span><span class="hl-4">&quot;color&quot;</span><span class="hl-1">: </span><span class="hl-2">&quot;#FF0000&quot;</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">&quot;output_format&quot;</span><span class="hl-1">: </span><span class="hl-2">&quot;android&quot;</span><br/><span class="hl-1">}</span><br/><span class="hl-3">// Result: &quot;Color.parseColor(\&quot;#FFFF0000\&quot;)&quot;</span><br/><br/><span class="hl-1">{</span><br/><span class="hl-1"> </span><span class="hl-4">&quot;color&quot;</span><span class="hl-1">: </span><span class="hl-2">&quot;#FF0000&quot;</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">&quot;output_format&quot;</span><span class="hl-1">: </span><span class="hl-2">&quot;flutter&quot;</span><br/><span class="hl-1">}</span><br/><span class="hl-3">// Result: &quot;Color(0xFFFF0000)&quot;</span> </code><button type="button">Copy</button></pre> <h4 id="framework-integration" class="tsd-anchor-link">Framework Integration<a href="#framework-integration" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="json"><span class="hl-1">{</span><br/><span class="hl-1"> </span><span class="hl-4">&quot;color&quot;</span><span class="hl-1">: </span><span class="hl-2">&quot;#FF0000&quot;</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">&quot;output_format&quot;</span><span class="hl-1">: </span><span class="hl-2">&quot;tailwind&quot;</span><br/><span class="hl-1">}</span><br/><span class="hl-3">// Result: &quot;red-500&quot;</span> </code><button type="button">Copy</button></pre> <h4 id="scientificprofessional" class="tsd-anchor-link">Scientific/Professional<a href="#scientificprofessional" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="json"><span class="hl-1">{</span><br/><span class="hl-1"> </span><span class="hl-4">&quot;color&quot;</span><span class="hl-1">: </span><span class="hl-2">&quot;#FF0000&quot;</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">&quot;output_format&quot;</span><span class="hl-1">: </span><span class="hl-2">&quot;lab&quot;</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">&quot;precision&quot;</span><span class="hl-1">: </span><span class="hl-5">6</span><br/><span class="hl-1">}</span><br/><span class="hl-3">// Result: &quot;lab(53.230000, 80.110000, 67.220000)&quot;</span><br/><br/><span class="hl-1">{</span><br/><span class="hl-1"> </span><span class="hl-4">&quot;color&quot;</span><span class="hl-1">: </span><span class="hl-2">&quot;#FF0000&quot;</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">&quot;output_format&quot;</span><span class="hl-1">: </span><span class="hl-2">&quot;oklab&quot;</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">&quot;precision&quot;</span><span class="hl-1">: </span><span class="hl-5">8</span><br/><span class="hl-1">}</span><br/><span class="hl-3">// Result: &quot;oklab(0.62800000, 0.22500000, 0.12600000)&quot;</span> </code><button type="button">Copy</button></pre> <h3 id="usage-examples" class="tsd-anchor-link">Usage Examples<a href="#usage-examples" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3><h4 id="basic-color-conversion" class="tsd-anchor-link">Basic Color Conversion<a href="#basic-color-conversion" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="javascript"><span class="hl-3">// Convert HEX to RGB</span><br/><span class="hl-1">{</span><br/><span class="hl-1"> </span><span class="hl-2">&quot;tool&quot;</span><span class="hl-1">: </span><span class="hl-2">&quot;convert_color&quot;</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-2">&quot;parameters&quot;</span><span class="hl-1">: {</span><br/><span class="hl-1"> </span><span class="hl-2">&quot;color&quot;</span><span class="hl-7">:</span><span class="hl-1"> </span><span class="hl-2">&quot;#FF0000&quot;</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-2">&quot;output_format&quot;</span><span class="hl-7">:</span><span class="hl-1"> </span><span class="hl-2">&quot;rgb&quot;</span><br/><span class="hl-1"> }</span><br/><span class="hl-1">}</span><br/><br/><span class="hl-3">// Convert RGB to HSL with high precision</span><br/><span class="hl-1">{</span><br/><span class="hl-1"> </span><span class="hl-2">&quot;tool&quot;</span><span class="hl-1">: </span><span class="hl-2">&quot;convert_color&quot;</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-2">&quot;parameters&quot;</span><span class="hl-1">: {</span><br/><span class="hl-1"> </span><span class="hl-2">&quot;color&quot;</span><span class="hl-7">:</span><span class="hl-1"> </span><span class="hl-2">&quot;rgb(255, 128, 64)&quot;</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-2">&quot;output_format&quot;</span><span class="hl-7">:</span><span class="hl-1"> </span><span class="hl-2">&quot;hsl&quot;</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-2">&quot;precision&quot;</span><span class="hl-7">:</span><span class="hl-1"> </span><span class="hl-5">4</span><br/><span class="hl-1"> }</span><br/><span class="hl-1">}</span> </code><button type="button">Copy</button></pre> <h4 id="advanced-color-space-conversions" class="tsd-anchor-link">Advanced Color Space Conversions<a href="#advanced-color-space-conversions" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="javascript"><span class="hl-3">// Convert to LAB color space for perceptual uniformity</span><br/><span class="hl-1">{</span><br/><span class="hl-1"> </span><span class="hl-2">&quot;tool&quot;</span><span class="hl-1">: </span><span class="hl-2">&quot;convert_color&quot;</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-2">&quot;parameters&quot;</span><span class="hl-1">: {</span><br/><span class="hl-1"> </span><span class="hl-2">&quot;color&quot;</span><span class="hl-7">:</span><span class="hl-1"> </span><span class="hl-2">&quot;#FF8040&quot;</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-2">&quot;output_format&quot;</span><span class="hl-7">:</span><span class="hl-1"> </span><span class="hl-2">&quot;lab&quot;</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-2">&quot;precision&quot;</span><span class="hl-7">:</span><span class="hl-1"> </span><span class="hl-5">3</span><br/><span class="hl-1"> }</span><br/><span class="hl-1">}</span><br/><br/><span class="hl-3">// Convert to OKLCH for modern color workflows</span><br/><span class="hl-1">{</span><br/><span class="hl-1"> </span><span class="hl-2">&quot;tool&quot;</span><span class="hl-1">: </span><span class="hl-2">&quot;convert_color&quot;</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-2">&quot;parameters&quot;</span><span class="hl-1">: {</span><br/><span class="hl-1"> </span><span class="hl-2">&quot;color&quot;</span><span class="hl-7">:</span><span class="hl-1"> </span><span class="hl-2">&quot;hsl(25, 100%, 69%)&quot;</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-2">&quot;output_format&quot;</span><span class="hl-7">:</span><span class="hl-1"> </span><span class="hl-2">&quot;oklch&quot;</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-2">&quot;precision&quot;</span><span class="hl-7">:</span><span class="hl-1"> </span><span class="hl-5">5</span><br/><span class="hl-1"> }</span><br/><span class="hl-1">}</span> </code><button type="button">Copy</button></pre> <h4 id="framework-specific-outputs" class="tsd-anchor-link">Framework-Specific Outputs<a href="#framework-specific-outputs" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="javascript"><span class="hl-3">// Generate Swift UIColor</span><br/><span class="hl-1">{</span><br/><span class="hl-1"> </span><span class="hl-2">&quot;tool&quot;</span><span class="hl-1">: </span><span class="hl-2">&quot;convert_color&quot;</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-2">&quot;parameters&quot;</span><span class="hl-1">: {</span><br/><span class="hl-1"> </span><span class="hl-2">&quot;color&quot;</span><span class="hl-7">:</span><span class="hl-1"> </span><span class="hl-2">&quot;#2563eb&quot;</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-2">&quot;output_format&quot;</span><span class="hl-7">:</span><span class="hl-1"> </span><span class="hl-2">&quot;swift&quot;</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-2">&quot;precision&quot;</span><span class="hl-7">:</span><span class="hl-1"> </span><span class="hl-5">3</span><br/><span class="hl-1"> }</span><br/><span class="hl-1">}</span><br/><br/><span class="hl-3">// Generate Tailwind CSS class</span><br/><span class="hl-1">{</span><br/><span class="hl-1"> </span><span class="hl-2">&quot;tool&quot;</span><span class="hl-1">: </span><span class="hl-2">&quot;convert_color&quot;</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-2">&quot;parameters&quot;</span><span class="hl-1">: {</span><br/><span class="hl-1"> </span><span class="hl-2">&quot;color&quot;</span><span class="hl-7">:</span><span class="hl-1"> </span><span class="hl-2">&quot;#ef4444&quot;</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-2">&quot;output_format&quot;</span><span class="hl-7">:</span><span class="hl-1"> </span><span class="hl-2">&quot;tailwind&quot;</span><br/><span class="hl-1"> }</span><br/><span class="hl-1">}</span><br/><br/><span class="hl-3">// Generate CSS custom property</span><br/><span class="hl-1">{</span><br/><span class="hl-1"> </span><span class="hl-2">&quot;tool&quot;</span><span class="hl-1">: </span><span class="hl-2">&quot;convert_color&quot;</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-2">&quot;parameters&quot;</span><span class="hl-1">: {</span><br/><span class="hl-1"> </span><span class="hl-2">&quot;color&quot;</span><span class="hl-7">:</span><span class="hl-1"> </span><span class="hl-2">&quot;#10b981&quot;</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-2">&quot;output_format&quot;</span><span class="hl-7">:</span><span class="hl-1"> </span><span class="hl-2">&quot;css-var&quot;</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-2">&quot;variable_name&quot;</span><span class="hl-7">:</span><span class="hl-1"> </span><span class="hl-2">&quot;success-color&quot;</span><br/><span class="hl-1"> }</span><br/><span class="hl-1">}</span> </code><button type="button">Copy</button></pre> <h4 id="export-format-generation" class="tsd-anchor-link">Export Format Generation<a href="#export-format-generation" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h4><p>Generate complete stylesheets and configuration files:</p> <pre><code class="javascript"><span class="hl-3">// Generate CSS with custom properties</span><br/><span class="hl-1">{</span><br/><span class="hl-1"> </span><span class="hl-2">&quot;tool&quot;</span><span class="hl-1">: </span><span class="hl-2">&quot;export_css&quot;</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-2">&quot;parameters&quot;</span><span class="hl-1">: {</span><br/><span class="hl-1"> </span><span class="hl-2">&quot;colors&quot;</span><span class="hl-7">:</span><span class="hl-1"> [</span><span class="hl-2">&quot;#2563eb&quot;</span><span class="hl-1">, </span><span class="hl-2">&quot;#ef4444&quot;</span><span class="hl-1">, </span><span class="hl-2">&quot;#10b981&quot;</span><span class="hl-1">],</span><br/><span class="hl-1"> </span><span class="hl-2">&quot;format&quot;</span><span class="hl-7">:</span><span class="hl-1"> </span><span class="hl-2">&quot;both&quot;</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-2">&quot;semantic_names&quot;</span><span class="hl-7">:</span><span class="hl-1"> [</span><span class="hl-2">&quot;primary&quot;</span><span class="hl-1">, </span><span class="hl-2">&quot;error&quot;</span><span class="hl-1">, </span><span class="hl-2">&quot;success&quot;</span><span class="hl-1">],</span><br/><span class="hl-1"> </span><span class="hl-2">&quot;include_rgb_hsl&quot;</span><span class="hl-7">:</span><span class="hl-1"> </span><span class="hl-6">true</span><br/><span class="hl-1"> }</span><br/><span class="hl-1">}</span><br/><br/><span class="hl-3">// Generate SCSS with mixins</span><br/><span class="hl-1">{</span><br/><span class="hl-1"> </span><span class="hl-2">&quot;tool&quot;</span><span class="hl-1">: </span><span class="hl-2">&quot;export_scss&quot;</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-2">&quot;parameters&quot;</span><span class="hl-1">: {</span><br/><span class="hl-1"> </span><span class="hl-2">&quot;colors&quot;</span><span class="hl-7">:</span><span class="hl-1"> [</span><span class="hl-2">&quot;#2563eb&quot;</span><span class="hl-1">, </span><span class="hl-2">&quot;#ef4444&quot;</span><span class="hl-1">],</span><br/><span class="hl-1"> </span><span class="hl-2">&quot;format&quot;</span><span class="hl-7">:</span><span class="hl-1"> </span><span class="hl-2">&quot;all&quot;</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-2">&quot;include_functions&quot;</span><span class="hl-7">:</span><span class="hl-1"> </span><span class="hl-6">true</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-2">&quot;namespace&quot;</span><span class="hl-7">:</span><span class="hl-1"> </span><span class="hl-2">&quot;theme&quot;</span><br/><span class="hl-1"> }</span><br/><span class="hl-1">}</span><br/><br/><span class="hl-3">// Generate Tailwind config</span><br/><span class="hl-1">{</span><br/><span class="hl-1"> </span><span class="hl-2">&quot;tool&quot;</span><span class="hl-1">: </span><span class="hl-2">&quot;export_tailwind&quot;</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-2">&quot;parameters&quot;</span><span class="hl-1">: {</span><br/><span class="hl-1"> </span><span class="hl-2">&quot;colors&quot;</span><span class="hl-7">:</span><span class="hl-1"> [</span><span class="hl-2">&quot;#2563eb&quot;</span><span class="hl-1">],</span><br/><span class="hl-1"> </span><span class="hl-2">&quot;include_shades&quot;</span><span class="hl-7">:</span><span class="hl-1"> </span><span class="hl-6">true</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-2">&quot;semantic_names&quot;</span><span class="hl-7">:</span><span class="hl-1"> [</span><span class="hl-2">&quot;primary&quot;</span><span class="hl-1">]</span><br/><span class="hl-1"> }</span><br/><span class="hl-1">}</span><br/><br/><span class="hl-3">// Generate JSON with metadata</span><br/><span class="hl-1">{</span><br/><span class="hl-1"> </span><span class="hl-2">&quot;tool&quot;</span><span class="hl-1">: </span><span class="hl-2">&quot;export_json&quot;</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-2">&quot;parameters&quot;</span><span class="hl-1">: {</span><br/><span class="hl-1"> </span><span class="hl-2">&quot;colors&quot;</span><span class="hl-7">:</span><span class="hl-1"> [</span><span class="hl-2">&quot;#2563eb&quot;</span><span class="hl-1">, </span><span class="hl-2">&quot;#ef4444&quot;</span><span class="hl-1">],</span><br/><span class="hl-1"> </span><span class="hl-2">&quot;format&quot;</span><span class="hl-7">:</span><span class="hl-1"> </span><span class="hl-2">&quot;detailed&quot;</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-2">&quot;include_accessibility&quot;</span><span class="hl-7">:</span><span class="hl-1"> </span><span class="hl-6">true</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-2">&quot;group_name&quot;</span><span class="hl-7">:</span><span class="hl-1"> </span><span class="hl-2">&quot;Brand Colors&quot;</span><br/><span class="hl-1"> }</span><br/><span class="hl-1">}</span> </code><button type="button">Copy</button></pre> <h3 id="performance-characteristics" class="tsd-anchor-link">Performance Characteristics<a href="#performance-characteristics" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3><ul> <li><strong>Single Conversions</strong>: &lt; 100ms response time</li> <li><strong>Batch Operations</strong>: &lt; 20ms average per conversion</li> <li><strong>High Precision</strong>: Up to 10 decimal places without performance impact</li> <li><strong>Memory Efficient</strong>: Optimized for concurrent operations</li> <li><strong>Caching</strong>: Intelligent caching for frequently converted colors</li> </ul> <h3 id="direct-usage" class="tsd-anchor-link">Direct Usage<a href="#direct-usage" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3><pre><code class="typescript"><span class="hl-8">import</span><span class="hl-1"> { </span><span class="hl-7">ColorServer</span><span class="hl-1"> } </span><span class="hl-8">from</span><span class="hl-1"> </span><span class="hl-2">&#39;./src/server.js&#39;</span><span class="hl-1">;</span><br/><br/><span class="hl-6">const</span><span class="hl-1"> </span><span class="hl-9">server</span><span class="hl-1"> = </span><span class="hl-6">new</span><span class="hl-1"> </span><span class="hl-0">ColorServer</span><span class="hl-1">();</span><br/><span class="hl-3">// Server usage examples will be added as implementation progresses</span> </code><button type="button">Copy</button></pre> <h2 id="development" class="tsd-anchor-link">Development<a href="#development" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h2><h3 id="project-structure" class="tsd-anchor-link">Project Structure<a href="#project-structure" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3><pre><code><span class="hl-7">mcp</span><span class="hl-1">-</span><span class="hl-7">color</span><span class="hl-1">-</span><span class="hl-7">server</span><span class="hl-1">/</span><br/><span class="hl-1">├── </span><span class="hl-7">src</span><span class="hl-1">/ # </span><span class="hl-7">Source</span><span class="hl-1"> </span><span class="hl-7">code</span><br/><span class="hl-1">│ ├── </span><span class="hl-7">server</span><span class="hl-1">.</span><span class="hl-7">ts</span><span class="hl-1"> # </span><span class="hl-7">Main</span><span class="hl-1"> </span><span class="hl-9">MCP</span><span class="hl-1"> </span><span class="hl-7">server</span><span class="hl-1"> </span><span class="hl-7">implementation</span><br/><span class="hl-1">│ ├── </span><span class="hl-7">tools</span><span class="hl-1">/ # </span><span class="hl-7">Tool</span><span class="hl-1"> </span><span class="hl-7">implementations</span><br/><span class="hl-1">│ ├── </span><span class="hl-7">validation</span><span class="hl-1">/ # </span><span class="hl-7">Input</span><span class="hl-1"> </span><span class="hl-7">validation</span><span class="hl-1"> </span><span class="hl-7">schemas</span><br/><span class="hl-1">│ ├── </span><span class="hl-7">types</span><span class="hl-1">/ # </span><span class="hl-7">TypeScript</span><span class="hl-1"> </span><span class="hl-6">type</span><span class="hl-1"> </span><span class="hl-10">definitions</span><br/><span class="hl-1">│ └── utils/ # Utility functions</span><br/><span class="hl-1">├── tests/ # Test files</span><br/><span class="hl-1">├── docs/ # Documentation</span><br/><span class="hl-1">├── examples/ # Usage examples</span><br/><span class="hl-1">└── dist/ # Compiled output</span> </code><button>Copy</button></pre> <h3 id="code-quality" class="tsd-anchor-link">Code Quality<a href="#code-quality" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3><p>This project maintains high code quality standards with automated Git hooks:</p> <ul> <li><strong>Pre-commit Hooks</strong>: Automatic linting, formatting, and type checking on staged files</li> <li><strong>Pre-push Hooks</strong>: Full test suite with 90%+ coverage requirements and build verification</li> <li><strong>Commit Message Validation</strong>: Enforces conventional commit format</li> <li><strong>Zero-Defect Policy</strong>: No TypeScript errors, ESLint warnings, or failing tests allowed</li> </ul> <p>See <a href="media/husky-setup.md">Husky Setup Documentation</a> for detailed information about our Git hooks.</p> <ul> <li><strong>TypeScript</strong>: Strict mode enabled with comprehensive type checking</li> <li><strong>ESLint</strong>: Enforces code style and catches potential issues</li> <li><strong>Prettier</strong>: Automatic code formatting</li> <li><strong>Jest</strong>: Comprehensive test suite with 90%+ coverage requirement</li> <li><strong>Continuous Integration</strong>: Automated testing and quality checks</li> </ul> <h3 id="contributing" class="tsd-anchor-link">Contributing<a href="#contributing" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3><p>Please read <a href="media/contributing.md">docs/contributing.md</a> for details on our code of conduct and the process for submitting pull requests.</p> <h3 id="testing" class="tsd-anchor-link">Testing<a href="#testing" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3><pre><code class="bash"><span class="hl-3"># Run all tests</span><br/><span class="hl-0">npm</span><span class="hl-1"> </span><span class="hl-2">test</span><br/><br/><span class="hl-3"># Run tests in watch mode</span><br/><span class="hl-0">npm</span><span class="hl-1"> </span><span class="hl-2">run</span><span class="hl-1"> </span><span class="hl-2">test:watch</span><br/><br/><span class="hl-3"># Run tests with coverage report</span><br/><span class="hl-0">npm</span><span class="hl-1"> </span><span class="hl-2">run</span><span class="hl-1"> </span><span class="hl-2">test:coverage</span><br/><br/><span class="hl-3"># Run specific test file</span><br/><span class="hl-0">npm</span><span class="hl-1"> </span><span class="hl-2">test</span><span class="hl-1"> </span><span class="hl-6">--</span><span class="hl-1"> </span><span class="hl-2">server.test.ts</span> </code><button type="button">Copy</button></pre> <h3 id="building" class="tsd-anchor-link">Building<a href="#building" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3><pre><code class="bash"><span class="hl-3"># Clean previous build</span><br/><span class="hl-0">npm</span><span class="hl-1"> </span><span class="hl-2">run</span><span class="hl-1"> </span><span class="hl-2">clean</span><br/><br/><span class="hl-3"># Build for production</span><br/><span class="hl-0">npm</span><span class="hl-1"> </span><span class="hl-2">run</span><span class="hl-1"> </span><span class="hl-2">build</span><br/><br/><span class="hl-3"># Type check without building</span><br/><span class="hl-0">npm</span><span class="hl-1"> </span><span class="hl-2">run</span><span class="hl-1"> </span><span class="hl-2">type-check</span> </code><button type="button">Copy</button></pre> <h2 id="license" class="tsd-anchor-link">License<a href="#license" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h2><p>This project is licensed under the MIT License - see the <a href="media/LICENSE">LICENSE</a> file for details.</p> <h2 id="contributing-1" class="tsd-anchor-link">Contributing<a href="#contributing-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h2><p>We welcome contributions! Please see <a href="media/contributing.md">docs/contributing.md</a> for guidelines.</p> <h2 id="code-of-conduct" class="tsd-anchor-link">Code of Conduct<a href="#code-of-conduct" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h2><p>This project adheres to a <a href="media/code-of-conduct.md">Code of Conduct</a>. By participating, you are expected to uphold this code.</p> <h2 id="support" class="tsd-anchor-link">Support<a href="#support" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h2><ul> <li><strong>Issues</strong>: <a href="https://github.com/keyurgolani/ColorMcp/issues">GitHub Issues</a></li> <li><strong>Discussions</strong>: <a href="https://github.com/keyurgolani/ColorMcp/discussions">GitHub Discussions</a></li> <li><strong>Documentation</strong>: <a href="media/docs">docs/</a> <ul> <li><a href="media/export-formats-guide.md">Export Formats Guide</a></li> <li><a href="media/color-theory-guide.md">Color Theory Guide</a></li> <li><a href="media/accessibility-guide.md">Accessibility Guide</a></li> </ul> </li> </ul> <h2 id="production-deployment" class="tsd-anchor-link">Production Deployment<a href="#production-deployment" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h2><h3 id="system-requirements" class="tsd-anchor-link">System Requirements<a href="#system-requirements" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3><ul> <li><strong>Node.js</strong>: 18.0.0 or higher</li> <li><strong>Memory</strong>: 512MB minimum, 2GB recommended</li> <li><strong>CPU</strong>: 1 core minimum, 2+ cores recommended for high load</li> <li><strong>Storage</strong>: 100MB for application, additional space for logs and cache</li> </ul> <h3 id="performance-characteristics-1" class="tsd-anchor-link">Performance Characteristics<a href="#performance-characteristics-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3><ul> <li><strong>Response Times</strong>: &lt; 100ms for color conversions, &lt; 2s for complex visualizations</li> <li><strong>Throughput</strong>: 50+ concurrent requests supported</li> <li><strong>Memory Usage</strong>: &lt; 100MB per request, intelligent caching and cleanup</li> <li><strong>Reliability</strong>: 99.9% uptime with proper deployment and monitoring</li> </ul> <h3 id="deployment-options" class="tsd-anchor-link">Deployment Options<a href="#deployment-options" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3><h4 id="docker-deployment" class="tsd-anchor-link">Docker Deployment<a href="#docker-deployment" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="bash"><span class="hl-3"># Build Docker image</span><br/><span class="hl-0">docker</span><span class="hl-1"> </span><span class="hl-2">build</span><span class="hl-1"> </span><span class="hl-6">-t</span><span class="hl-1"> </span><span class="hl-2">mcp-color-server</span><span class="hl-1"> </span><span class="hl-2">.</span><br/><br/><span class="hl-3"># Run container</span><br/><span class="hl-0">docker</span><span class="hl-1"> </span><span class="hl-2">run</span><span class="hl-1"> </span><span class="hl-6">-d</span><span class="hl-1"> </span><span class="hl-11">\</span><br/><span class="hl-1"> </span><span class="hl-6">--name</span><span class="hl-1"> </span><span class="hl-2">mcp-color-server</span><span class="hl-1"> </span><span class="hl-11">\</span><br/><span class="hl-1"> </span><span class="hl-6">-e</span><span class="hl-1"> </span><span class="hl-2">NODE_ENV=production</span><span class="hl-1"> </span><span class="hl-11">\</span><br/><span class="hl-1"> </span><span class="hl-6">-e</span><span class="hl-1"> </span><span class="hl-2">LOG_LEVEL=info</span><span class="hl-1"> </span><span class="hl-11">\</span><br/><span class="hl-1"> </span><span class="hl-6">-p</span><span class="hl-1"> </span><span class="hl-2">3000:3000</span><span class="hl-1"> </span><span class="hl-11">\</span><br/><span class="hl-1"> </span><span class="hl-2">mcp-color-server</span> </code><button type="button">Copy</button></pre> <h4 id="pm2-deployment" class="tsd-anchor-link">PM2 Deployment<a href="#pm2-deployment" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="bash"><span class="hl-3"># Install PM2 globally</span><br/><span class="hl-0">npm</span><span class="hl-1"> </span><span class="hl-2">install</span><span class="hl-1"> </span><span class="hl-6">-g</span><span class="hl-1"> </span><span class="hl-2">pm2</span><br/><br/><span class="hl-3"># Start with PM2</span><br/><span class="hl-0">pm2</span><span class="hl-1"> </span><span class="hl-2">start</span><span class="hl-1"> </span><span class="hl-2">ecosystem.config.js</span><br/><br/><span class="hl-3"># Save PM2 configuration</span><br/><span class="hl-0">pm2</span><span class="hl-1"> </span><span class="hl-2">save</span><br/><span class="hl-0">pm2</span><span class="hl-1"> </span><span class="hl-2">startup</span> </code><button type="button">Copy</button></pre> <h4 id="systemd-service" class="tsd-anchor-link">Systemd Service<a href="#systemd-service" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="bash"><span class="hl-3"># Copy service file</span><br/><span class="hl-0">sudo</span><span class="hl-1"> </span><span class="hl-2">cp</span><span class="hl-1"> </span><span class="hl-2">mcp-color-server.service</span><span class="hl-1"> </span><span class="hl-2">/etc/systemd/system/</span><br/><br/><span class="hl-3"># Enable and start service</span><br/><span class="hl-0">sudo</span><span class="hl-1"> </span><span class="hl-2">systemctl</span><span class="hl-1"> </span><span class="hl-2">enable</span><span class="hl-1"> </span><span class="hl-2">mcp-color-server</span><br/><span class="hl-0">sudo</span><span class="hl-1"> </span><span class="hl-2">systemctl</span><span class="hl-1"> </span><span class="hl-2">start</span><span class="hl-1"> </span><span class="hl-2">mcp-color-server</span> </code><button type="button">Copy</button></pre> <h3 id="monitoring-and-maintenance" class="tsd-anchor-link">Monitoring and Maintenance<a href="#monitoring-and-maintenance" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3><ul> <li><strong>Health Checks</strong>: Built-in health endpoint at <code>/health</code></li> <li><strong>Metrics</strong>: Performance metrics and resource usage tracking</li> <li><strong>Logging</strong>: Structured JSON logging with configurable levels</li> <li><strong>Alerts</strong>: Memory usage, response time, and error rate monitoring</li> </ul> <h2 id="security" class="tsd-anchor-link">Security<a href="#security" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h2><h3 id="security-features" class="tsd-anchor-link">Security Features<a href="#security-features" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3><ul> <li><strong>Input Validation</strong>: Comprehensive validation for all color formats and parameters</li> <li><strong>XSS Prevention</strong>: Sanitization of generated HTML, CSS, and SVG content</li> <li><strong>Rate Limiting</strong>: Built-in rate limiting for expensive operations</li> <li><strong>Resource Protection</strong>: Memory limits, processing timeouts, and cleanup</li> <li><strong>Audit Logging</strong>: Security-relevant events logged without exposing sensitive data</li> </ul> <h3 id="security-best-practices" class="tsd-anchor-link">Security Best Practices<a href="#security-best-practices" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3><ol> <li><strong>Run with minimal privileges</strong>: Use dedicated user account</li> <li><strong>Network security</strong>: Run behind reverse proxy with HTTPS</li> <li><strong>Resource limits</strong>: Configure appropriate memory and CPU limits</li> <li><strong>Regular updates</strong>: Keep dependencies updated for security patches</li> <li><strong>Monitoring</strong>: Monitor for suspicious activity and resource usage</li> </ol> <h3 id="vulnerability-reporting" class="tsd-anchor-link">Vulnerability Reporting<a href="#vulnerability-reporting" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3><p>Report security vulnerabilities privately to: <strong><a href="mailto:security@mcp-color-server.org">security@mcp-color-server.org</a></strong></p> <p>See <a href="media/security.md">docs/security.md</a> for detailed security policy and reporting procedures.</p> <h2 id="roadmap" class="tsd-anchor-link">Roadmap<a href="#roadmap" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h2><h3 id="current-version-010" class="tsd-anchor-link">Current Version (0.1.0)<a href="#current-version-010" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3><ul> <li>✅ Complete color format conversion system</li> <li>✅ Palette generation with color theory algorithms</li> <li>✅ Gradient creation and visualization</li> <li>✅ Theme generation and semantic color mapping</li> <li>✅ Accessibility compliance tools</li> <li>✅ HTML and PNG visualization generation</li> <li>✅ Export formats (CSS, SCSS, Tailwind, JSON)</li> <li>✅ Performance optimization and caching</li> <li>✅ Security hardening and input validation</li> </ul> <h3 id="planned-features-future-releases" class="tsd-anchor-link">Planned Features (Future Releases)<a href="#planned-features-future-releases" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3><ul> <li>🔄 3D color space visualizations</li> <li>🔄 Color animation and transitions</li> <li>🔄 Advanced image color extraction</li> <li>🔄 Educational content and tutorials</li> <li>🔄 Plugin architecture for custom algorithms</li> <li>🔄 RESTful API endpoints</li> <li>🔄 Advanced gradient types (mesh, conic)</li> <li>🔄 Mobile framework integrations</li> </ul> <h3 id="community-contributions-welcome" class="tsd-anchor-link">Community Contributions Welcome<a href="#community-contributions-welcome" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3><ul> <li>Color theory algorithm improvements</li> <li>New export format support</li> <li>Performance optimizations</li> <li>Documentation enhancements</li> <li>Test coverage improvements</li> <li>Accessibility features</li> </ul> </div></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="assets/icons.svg#icon-chevronDown"></use></svg><h3>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="assets/icons.svg#icon-chevronDown"></use></svg><h3>On This Page</h3></summary><div class="tsd-accordion-details"><a href="#mcp-color-server"><span>MCP <wbr/>Color <wbr/>Server</span></a><ul><li><a href="#features"><span>Features</span></a></li><li><a href="#installation"><span>Installation</span></a></li><li><ul><li><a href="#prerequisites"><span>Prerequisites</span></a></li><li><a href="#install-dependencies"><span>Install <wbr/>Dependencies</span></a></li><li><a href="#development-setup"><span>Development <wbr/>Setup</span></a></li></ul></li><li><a href="#usage"><span>Usage</span></a></li><li><ul><li><a href="#as-an-mcp-server"><span>As an <wbr/>MCP <wbr/>Server</span></a></li><li><ul><li><a href="#configuration"><span>Configuration</span></a></li><li><a href="#available-tools"><span>Available <wbr/>Tools</span></a></li></ul></li></ul></li><li><a href="#api"><span>API</span></a></li><li><ul><li><a href="#mcp-protocol"><span>MCP <wbr/>Protocol</span></a></li><li><ul><li><a href="#tool-discovery"><span>Tool <wbr/>Discovery</span></a></li><li><a href="#tool-execution"><span>Tool <wbr/>Execution</span></a></li></ul></li><li><a href="#response-format"><span>Response <wbr/>Format</span></a></li></ul></li><li><a href="#supported-color-formats"><span>Supported <wbr/>Color <wbr/>Formats</span></a></li><li><ul><li><a href="#input-formats"><span>Input <wbr/>Formats</span></a></li><li><ul><li><a href="#standard-web-formats"><span>Standard <wbr/>Web <wbr/>Formats</span></a></li><li><a href="#advanced-color-spaces"><span>Advanced <wbr/>Color <wbr/>Spaces</span></a></li><li><a href="#named-colors"><span>Named <wbr/>Colors</span></a></li></ul></li><li><a href="#output-formats"><span>Output <wbr/>Formats</span></a></li><li><ul><li><a href="#web-development"><span>Web <wbr/>Development</span></a></li><li><a href="#css-variables"><span>CSS <wbr/>Variables</span></a></li><li><a href="#mobile-development"><span>Mobile <wbr/>Development</span></a></li><li><a href="#framework-integration"><span>Framework <wbr/>Integration</span></a></li><li><a href="#scientificprofessional"><span>Scientific/<wbr/>Professional</span></a></li></ul></li><li><a href="#usage-examples"><span>Usage <wbr/>Examples</span></a></li><li><ul><li><a href="#basic-color-conversion"><span>Basic <wbr/>Color <wbr/>Conversion</span></a></li><li><a href="#advanced-color-space-conversions"><span>Advanced <wbr/>Color <wbr/>Space <wbr/>Conversions</span></a></li><li><a href="#framework-specific-outputs"><span>Framework-<wbr/>Specific <wbr/>Outputs</span></a></li><li><a href="#export-format-generation"><span>Export <wbr/>Format <wbr/>Generation</span></a></li></ul></li><li><a href="#performance-characteristics"><span>Performance <wbr/>Characteristics</span></a></li><li><a href="#direct-usage"><span>Direct <wbr/>Usage</span></a></li></ul></li><li><a href="#development"><span>Development</span></a></li><li><ul><li><a href="#project-structure"><span>Project <wbr/>Structure</span></a></li><li><a href="#code-quality"><span>Code <wbr/>Quality</span></a></li><li><a href="#contributing"><span>Contributing</span></a></li><li><a href="#testing"><span>Testing</span></a></li><li><a href="#building"><span>Building</span></a></li></ul></li><li><a href="#license"><span>License</span></a></li><li><a href="#contributing-1"><span>Contributing</span></a></li><li><a href="#code-of-conduct"><span>Code of <wbr/>Conduct</span></a></li><li><a href="#support"><span>Support</span></a></li><li><a href="#production-deployment"><span>Production <wbr/>Deployment</span></a></li><li><ul><li><a href="#system-requirements"><span>System <wbr/>Requirements</span></a></li><li><a href="#performance-characteristics-1"><span>Performance <wbr/>Characteristics</span></a></li><li><a href="#deployment-options"><span>Deployment <wbr/>Options</span></a></li><li><ul><li><a href="#docker-deployment"><span>Docker <wbr/>Deployment</span></a></li><li><a href="#pm2-deployment"><span>PM2 <wbr/>Deployment</span></a></li><li><a href="#systemd-service"><span>Systemd <wbr/>Service</span></a></li></ul></li><li><a href="#monitoring-and-maintenance"><span>Monitoring and <wbr/>Maintenance</span></a></li></ul></li><li><a href="#security"><span>Security</span></a></li><li><ul><li><a href="#security-features"><span>Security <wbr/>Features</span></a></li><li><a href="#security-best-practices"><span>Security <wbr/>Best <wbr/>Practices</span></a></li><li><a href="#vulnerability-reporting"><span>Vulnerability <wbr/>Reporting</span></a></li></ul></li><li><a href="#roadmap"><span>Roadmap</span></a></li><li><ul><li><a href="#current-version-010"><span>Current <wbr/>Version (0.1.0)</span></a></li><li><a href="#planned-features-future-releases"><span>Planned <wbr/>Features (<wbr/>Future <wbr/>Releases)</span></a></li><li><a href="#community-contributions-welcome"><span>Community <wbr/>Contributions <wbr/>Welcome</span></a></li></ul></li></ul></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="modules.html">MCP Color Server API Documentation - v0.1.0</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer></footer><div class="overlay"></div></body></html>

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/keyurgolani/ColorMcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server