spectra-mcp

mwalterskirchen/spectra-mcp

3.3

If you are the rightful owner of spectra-mcp and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.

Spectra MCP Server is a powerful tool for converting colors between different color spaces and formats, available as a hosted service.

Tools
12
Resources
0
Prompts
0

🎨 Spectra MCP Server

A powerful Model Context Protocol (MCP) server for converting colors between different color spaces and formats. Built with FastMCP and powered by the coloraide library.

🌐 Hosted Deployment

Spectra is now available as a hosted service! No installation required - integrate directly with any MCP client that supports remote HTTP servers.

Server URL: https://spectra-mcp.fastmcp.app/mcp

Simply add the URL to your MCP client configuration and start using color conversion tools immediately.

Overview

Spectra provides seamless color conversion capabilities through MCP tools, enabling AI assistants and applications to convert colors between various formats including RGB, HEX, HSL, and OKLCH color spaces. This server is ideal for design tools, theme generators, and any application requiring robust color manipulation.

Why Spectra?

Large Language Models (LLMs) struggle with converting colors between different formats in a deterministic way. Even seemingly simple conversions like #ff8080 to RGB or OKLCH to HEX can produce inconsistent or incorrect results when attempted through pure reasoning. Spectra solves this problem by providing reliable, deterministic color conversion tools that AI assistants can call, ensuring accurate and consistent color transformations every time.

Features

  • 🌐 Hosted Service: Available remotely at https://spectra-mcp.fastmcp.app/mcp - no installation needed
  • Multiple Color Space Support: Convert between RGB, HEX, HSL, and OKLCH color spaces
  • Bidirectional Conversions: Convert colors in any direction between supported formats
  • High-Quality Conversions: Powered by the coloraide library for accurate color science
  • MCP Protocol: Standardized interface for integration with AI assistants and tools
  • HTTP Transport: Supports remote HTTP MCP servers for seamless integration

Supported Conversions

The following table shows all supported color format conversions:

From \ ToRGBHEXHSLOKLCH
RGB
HEX
HSL
OKLCH

All conversions are bidirectional—you can convert between any two formats in either direction.

🛠️ Installation

Requirements

  • Cursor, Claude Code, VSCode, Windsurf or another MCP Client
Install in Cursor

Go to: Settings -> Cursor Settings -> MCP -> Add new global MCP server

Pasting the following configuration into your Cursor ~/.cursor/mcp.json file is the recommended approach. You may also install in a specific project by creating .cursor/mcp.json in your project folder. See Cursor MCP docs for more info.

Since Cursor 1.0, you can click the install button at the top of this README for instant one-click installation.

Install MCP Server

{
  "mcpServers": {
    "spectra": {
      "url": "https://spectra-mcp.fastmcp.app/mcp"
    }
  }
}
Install in Claude Code

Run this command. See Claude Code MCP docs for more info.

claude mcp add --transport http spectra https://spectra-mcp.fastmcp.app/mcp
Install in Amp

Run this command in your terminal. See Amp MCP docs for more info.

amp mcp add spectra https://spectra-mcp.fastmcp.app/mcp
Install in Windsurf

Add this to your Windsurf MCP config file. See Windsurf MCP docs for more info.

{
  "mcpServers": {
    "spectra": {
      "serverUrl": "https://spectra-mcp.fastmcp.app/mcp"
    }
  }
}
Install in VS Code

Add this to your VS Code MCP config file. See VS Code MCP docs for more info.

"mcp": {
  "servers": {
    "spectra": {
      "type": "http",
      "url": "https://spectra-mcp.fastmcp.app/mcp"
    }
  }
}
Install in Cline

You can easily install Spectra through the Cline MCP Server Marketplace by following these instructions:

  1. Open Cline.
  2. Click the hamburger menu icon (☰) to enter the MCP Servers section.
  3. Use the search bar within the Marketplace tab to find Spectra.
  4. Click the Install button.

Or you can directly edit MCP servers configuration:

  1. Open Cline.
  2. Click the hamburger menu icon (☰) to enter the MCP Servers section.
  3. Choose Remote Servers tab.
  4. Click the Edit Configuration button.
  5. Add spectra to mcpServers:
{
  "mcpServers": {
    "spectra": {
      "url": "https://spectra-mcp.fastmcp.app/mcp",
      "type": "streamableHttp"
    }
  }
}
Install in Zed

Add this to your Zed settings.json. See Zed Context Server docs for more info.

Note: Zed currently supports local MCP servers only. For remote server support, please check Zed's documentation for updates or use another MCP client that supports remote HTTP servers.

Install in Augment Code

Note: Augment Code currently supports local MCP servers only. For remote server support, please check Augment Code's documentation for updates or use another MCP client that supports remote HTTP servers.

Install in Roo Code

Add this to your Roo Code MCP configuration file. See Roo Code MCP docs for more info.

{
  "mcpServers": {
    "spectra": {
      "type": "streamable-http",
      "url": "https://spectra-mcp.fastmcp.app/mcp"
    }
  }
}
Install in Claude Desktop

Open Claude Desktop and navigate to Settings > Connectors > Add Custom Connector. Enter the name as Spectra and the remote MCP server URL as https://spectra-mcp.fastmcp.app/mcp.

Install in Opencode

Add this to your Opencode configuration file. See Opencode MCP docs for more info.

"mcp": {
  "spectra": {
    "type": "remote",
    "url": "https://spectra-mcp.fastmcp.app/mcp",
    "enabled": true
  }
}
Install in OpenAI Codex

See OpenAI Codex for more information.

Add the following configuration to your OpenAI Codex MCP server settings:

[mcp_servers.spectra]
url = "https://spectra-mcp.fastmcp.app/mcp"
Install in JetBrains AI Assistant

Note: JetBrains AI Assistant currently supports local MCP servers only. For remote server support, please check JetBrains' documentation for updates or use another MCP client that supports remote HTTP servers.

Install in Kiro

Note: Kiro currently supports local MCP servers only. For remote server support, please check Kiro's documentation for updates or use another MCP client that supports remote HTTP servers.

Install in Trae

Use the Add manually feature and fill in the JSON configuration information for that MCP server.

For more details, visit the Trae documentation.

{
  "mcpServers": {
    "spectra": {
      "url": "https://spectra-mcp.fastmcp.app/mcp"
    }
  }
}
Install in LM Studio

Note: LM Studio currently supports local MCP servers only. For remote server support, please check LM Studio's documentation for updates or use another MCP client that supports remote HTTP servers.

Install in Visual Studio 2022

You can configure Spectra MCP in Visual Studio 2022 by following the Visual Studio MCP Servers documentation.

Add this to your Visual Studio MCP config file (see the Visual Studio docs for details):

{
  "inputs": [],
  "servers": {
    "spectra": {
      "type": "http",
      "url": "https://spectra-mcp.fastmcp.app/mcp"
    }
  }
}

For more information and troubleshooting, refer to the Visual Studio MCP Servers documentation.

Install in Crush

Add this to your Crush configuration file. See Crush MCP docs for more info.

{
  "$schema": "https://charm.land/crush.json",
  "mcp": {
    "spectra": {
      "type": "http",
      "url": "https://spectra-mcp.fastmcp.app/mcp"
    }
  }
}
Install in BoltAI

Note: BoltAI currently supports local MCP servers only. For remote server support, please check BoltAI's documentation for updates or use another MCP client that supports remote HTTP servers.

Install in Warp

Note: Warp currently supports local MCP servers only. For remote server support, please check Warp's documentation for updates or use another MCP client that supports remote HTTP servers.

Install in Perplexity Desktop

Note: Perplexity Desktop currently supports local MCP servers only. For remote server support, please check Perplexity's documentation for updates or use another MCP client that supports remote HTTP servers.


💻 Development Setup (For Contributors)

If you want to contribute to Spectra or run it locally:

Prerequisites
  • Python 3.14 or higher
  • uv package manager (recommended)
Setup
  1. Clone the repository:
git clone <repository-url>
cd spectra-mcp
  1. Install dependencies using uv:
uv sync
  1. Start the server:
uv run python main.py

The server will start on http://127.0.0.1:8000 by default.

API Reference

Tools

oklch_to_rgb

Convert an OKLCH color to an RGB color.

Parameters:

  • oklch (string): OKLCH color string (e.g., "oklch(0.7 0.2 180)")

Returns:

  • RGB color string (e.g., "rgb(255, 128, 128)")
rgb_to_oklch

Convert an RGB color to an OKLCH color.

Parameters:

  • rgb (string): RGB color string (e.g., "rgb(255, 128, 128)" or "255, 128, 128")

Returns:

  • OKLCH color string (e.g., "oklch(0.7 0.2 180)")
hex_to_rgb

Convert a hex color to an RGB color.

Parameters:

  • hex (string): Hex color string (e.g., "#ff8080" or "ff8080")

Returns:

  • RGB color string (e.g., "rgb(255, 128, 128)")
rgb_to_hex

Convert an RGB color to a hex color.

Parameters:

  • rgb (string): RGB color string (e.g., "rgb(255, 128, 128)" or "255, 128, 128")

Returns:

  • Hex color string (e.g., "#ff8080")
oklch_to_hex

Convert an OKLCH color to a hex color.

Parameters:

  • oklch (string): OKLCH color string (e.g., "oklch(0.7 0.2 180)")

Returns:

  • Hex color string (e.g., "#ff8080")
hex_to_oklch

Convert a hex color to an OKLCH color.

Parameters:

  • hex (string): Hex color string (e.g., "#ff8080" or "ff8080")

Returns:

  • OKLCH color string (e.g., "oklch(0.7 0.2 180)")
rgb_to_hsl

Convert an RGB color to an HSL color.

Parameters:

  • rgb (string): RGB color string (e.g., "rgb(255, 128, 128)" or "255, 128, 128")

Returns:

  • HSL color string (e.g., "hsl(0 100% 75%)")
hsl_to_rgb

Convert an HSL color to an RGB color.

Parameters:

  • hsl (string): HSL color string (e.g., "hsl(0 100% 75%)")

Returns:

  • RGB color string (e.g., "rgb(255, 128, 128)")
oklch_to_hsl

Convert an OKLCH color to an HSL color.

Parameters:

  • oklch (string): OKLCH color string (e.g., "oklch(0.7 0.2 180)")

Returns:

  • HSL color string (e.g., "hsl(0 100% 75%)")
hsl_to_oklch

Convert an HSL color to an OKLCH color.

Parameters:

  • hsl (string): HSL color string (e.g., "hsl(0 100% 75%)")

Returns:

  • OKLCH color string (e.g., "oklch(0.7 0.2 180)")
hex_to_hsl

Convert a hex color to an HSL color.

Parameters:

  • hex (string): Hex color string (e.g., "#ff8080" or "ff8080")

Returns:

  • HSL color string (e.g., "hsl(0 100% 75%)")
hsl_to_hex

Convert an HSL color to a hex color.

Parameters:

  • hsl (string): HSL color string (e.g., "hsl(0 100% 75%)")

Returns:

  • Hex color string (e.g., "#ff8080")

Examples

Converting OKLCH to RGB

Input: oklch(0.7 0.2 180)
Output: rgb(255, 128, 128)

Converting RGB to OKLCH

Input: rgb(255, 128, 128)
Output: oklch(0.7 0.2 180)

Converting HEX to RGB

Input: #ff8080
Output: rgb(255, 128, 128)

Converting RGB to HEX

Input: rgb(255, 128, 128)
Output: #ff8080

Converting OKLCH to HEX

Input: oklch(0.7 0.2 180)
Output: #ff8080

Converting HEX to OKLCH

Input: #ff8080
Output: oklch(0.7 0.2 180)

Converting RGB to HSL

Input: rgb(255, 128, 128)
Output: hsl(0 100% 75%)

Converting HSL to RGB

Input: hsl(0 100% 75%)
Output: rgb(255, 128, 128)

Converting OKLCH to HSL

Input: oklch(0.7 0.2 180)
Output: hsl(0 100% 75%)

Converting HSL to OKLCH

Input: hsl(0 100% 75%)
Output: oklch(0.7 0.2 180)

Converting HEX to HSL

Input: #ff8080
Output: hsl(0 100% 75%)

Converting HSL to HEX

Input: hsl(0 100% 75%)
Output: #ff8080

Configuration

Remote/Hosted Server

No configuration needed! The hosted service at https://spectra-mcp.fastmcp.app/mcp is ready to use.

Local Development Server

For local development, server configuration can be modified in fastmcp.json:

  • Port: Change the port value (default: 8000)
  • Host: Change the host value (default: 127.0.0.1)
  • Log Level: Adjust log_level (default: DEBUG)
  • Environment: Modify environment variables as needed

Dependencies

  • coloraide (>=5.1): Advanced color manipulation library
  • fastmcp (>=2.13.0.2): Fast MCP server framework

Acknowledgments