MCP Hub
Back to servers

PaletteMCP

MCP (Model Context Protocol) Server. PaletteMCP is a command-line tool written in Go that takes a hexadecimal color code and returns the name of the closest matching color from a predefined list of CSS colors.

Tools
2
Validated
Jan 11, 2026

PaletteMCP - Color Code to Name Converter

PaletteMCP is a command-line tool written in Go that takes a hexadecimal color code and returns the name of the closest matching color from a predefined list of CSS colors. The output is provided in JSON format, making it easy to integrate with other scripts and systems.

Features

  • Convert any hex color code to its nearest color name.
  • Outputs in a clean, machine-readable JSON format.
  • Includes a comprehensive list of standard CSS colors.
  • Simple and easy-to-use command-line interface.

Installation

To use this tool, you need to have Go installed on your system.

  1. Clone the repository (if you have it in a git repo) or just use the existing files.

  2. Build the executable:

    go build -o palette-mcp ./cmd/palette-mcp
    

Download Pre-built Binaries

You can download pre-built binaries for various operating systems and architectures directly from the GitHub Releases page.

Replace [VERSION] with the desired release version (e.g., v1.0.0).

Linux / macOS

# Download the binary (replace [OS] and [ARCH] with your system, e.g., linux_amd64, darwin_arm64)
wget https://github.com/kelvinzer0/PaletteMCP/releases/download/[VERSION]/palette-mcp_[OS]_[ARCH] -O palette-mcp

# Make it executable
chmod +x palette-mcp

# Move it to a directory in your PATH (e.g., /usr/local/bin)
sudo mv palette-mcp /usr/local/bin/

Windows

  1. Download the appropriate .exe file from the GitHub Releases page (e.g., palette-mcp_windows_amd64.exe).
  2. Rename the downloaded file to palette-mcp.exe.
  3. Move palette-mcp.exe to a directory that is included in your system's PATH environment variable. A common practice is to create a bin folder in your user directory (e.g., C:\Users\YourUser\bin) and add it to PATH.

Usage

palette-mcp can be used as a command-line tool or run as a Gemini Model Context Protocol (MCP) server.

Command-Line Tool Usage

Run the tool from your terminal, passing a hex color code (with or without the # prefix) as an argument.

./palette-mcp #ff6347

Example (Command-Line Tool)

Input:

./palette-mcp #ff6347

Output:

{
  "hex": "#ff6347",
  "name": "Tomato",
  "rgb": "rgb(255, 99, 71)"
}

Gemini MCP Server Integration

palette-mcp can also run as an MCP server, exposing its functionality to the Gemini CLI. This allows the Gemini model to discover and execute palette-mcp's tools.

Running the MCP Server

To start palette-mcp in server mode, use the server argument.

Stdio Transport

This is the default transport method and is used when you run the server with the server argument.

# Start the server using stdio
./palette-mcp server

HTTP Transport

You can also run the server with an HTTP transport, which allows you to specify a custom port.

# Start on default port 8080
./palette-mcp serve-http

# Start on a custom port (e.g., 9000)
./palette-mcp serve-http 9000

SSE (Server-Sent Events) Transport

To run the server in SSE mode, use the -sse flag. This will start an HTTP server that streams events.

# Start on default port 8080 in SSE mode
./palette-mcp -sse

# Start on a custom port (e.g., 9000) in SSE mode
./palette-mcp -sse -port 9000

It's recommended to run the server in the background if you want to continue using your terminal:

./palette-mcp serve-http &
# Or for a custom port:
./palette-mcp serve-http 9000 &

# For SSE mode:
./palette-mcp -sse &
# Or for a custom port:
./palette-mcp -sse -port 9000 & 

Configuring Gemini CLI

To enable the Gemini CLI to connect to your palette-mcp server, add the following configuration to your settings.json file. This file can be found globally at ~/.gemini/settings.json or in your project's .gemini/settings.json.

{
  "theme": "ANSI Light",
  "selectedAuthType": "oauth-personal",
  "mcpServers": {
    "get-color-info": {
        "command": "/usr/local/bin/palette-mcp",
        "args":["server"]
    }
  }
}
  • paletteMcpServer: This is the name you give to your MCP server within Gemini CLI. You can choose any descriptive name.
  • httpUrl: The URL where your palette-mcp server is listening. Adjust the port if you started the server on a custom port (e.g., http://localhost:9000).
  • timeout: The maximum time (in milliseconds) Gemini CLI will wait for a response from the server.

Available Tools

Once configured and the server is running, the Gemini CLI will discover the following tools:

  • echo: Echoes back the provided message. (Example tool for demonstration)
    • Parameters: message (string)
  • get_color_info: Retrieves information about a color given its hex code.
    • Parameters: hexCode (string, e.g., #FF0000)

Example Gemini CLI Usage (Conceptual)

After setting up, you can interact with the tools via the Gemini CLI. For instance, you might ask:

What is the name of the color #00BFFF?

The Gemini model, if it decides to use the get_color_info tool, would execute it and provide the result.

Integration with Forge MCP

PaletteMCP can be easily integrated into forge mcp workflows to provide color name lookup capabilities. You can add palette-mcp as a custom command within your forge mcp configuration.

Adding PaletteMCP to Forge MCP

You can add palette-mcp to your forge mcp configuration using the forge mcp add command or by manually editing your .mcp.json file.

Using forge mcp add (Command Line)

# Example: Add palette-mcp as a command named 'colorname'
forge mcp add --name colorname --command /path/to/palette-mcp --args "#{{hex_code}}"
  • Replace /path/to/palette-mcp with the actual absolute path to your palette-mcp executable.
  • #{{hex_code}} is a placeholder for the hexadecimal color code that forge mcp will pass to palette-mcp. The double curly braces {{...}} indicate a variable or expression in forge mcp.

Manual .mcp.json Configuration

You can also manually create or modify your .mcp.json file. This file can be located in your local project directory or in your user-specific configuration.

{
  "mcpServers": {
    "colorname_tool": {
      "command": "/usr/local/bin/palette-mcp",
      "args": ["server"],
      "description": "Converts a hex color code to its closest named color."
    }
  }
}
  • colorname_tool: This is the name you will use to invoke palette-mcp via forge mcp (e.g., forge mcp run colorname_tool #RRGGBB).
  • command: The absolute path to your palette-mcp executable.
  • args: An array of arguments to pass to palette-mcp. "#{{hex_code}}" is a common pattern for passing dynamic input from forge mcp.

Example Forge MCP Usage

Once configured, you can use palette-mcp within your forge mcp workflows:

# Run the configured colorname_tool with a hex code
forge mcp run colorname_tool "#00BFFF"

# Example of using the output in a multi-agent workflow (conceptual)
# Assuming 'forge mcp run colorname_tool' outputs JSON
COLOR_INFO=$(forge mcp run colorname_tool "#FF0000")
COLOR_NAME=$(echo $COLOR_INFO | jq -r '.name')
echo "The color is: $COLOR_NAME"
  • Note: The jq command is a powerful JSON processor for the command line. You might need to install it separately (brew install jq on macOS, sudo apt-get install jq on Debian/Ubuntu).

This integration allows forge mcp to leverage PaletteMCP for color code to name conversions as part of larger automation or multi-agent tasks.

How It Works

The tool calculates the "closest" color by finding the Euclidean distance between the input color's RGB values and the RGB values of each color in the predefined list. The color with the smallest distance is considered the closest match.

Color Reference

The following table lists all the named colors used for matching.

Color NameHexRGB
aliceblue#f0f8ff240, 248, 255
antiquewhite#faebd7250, 235, 215
aqua#00ffff0, 255, 255
aquamarine#7fffd4127, 255, 212
azure#f0ffff240, 255, 255
beige#f5f5dc245, 245, 220
bisque#ffe4c4255, 228, 196
black#0000000, 0, 0
blanchedalmond#ffebcd255, 235, 205
blue#0000ff0, 0, 255
blueviolet#8a2be2138, 43, 226
brown#a52a2a165, 42, 42
burlywood#deb887222, 184, 135
cadetblue#5f9ea095, 158, 160
chartreuse#7fff00127, 255, 0
chocolate#d2691e210, 105, 30
coral#ff7f50255, 127, 80
cornflowerblue#6495ed100, 149, 237
cornsilk#fff8dc255, 248, 220
crimson#dc143c220, 20, 60
cyan#00ffff0, 255, 255
darkblue#00008b0, 0, 139
darkcyan#008b8b0, 139, 139
darkgoldenrod#b8860b184, 134, 11
darkgray#a9a9a9169, 169, 169
darkgreen#0064000, 100, 0
darkkhaki#bdb76b189, 183, 107
darkmagenta#8b008b139, 0, 139
darkolivegreen#556b2f85, 107, 47
darkorange#ff8c00255, 140, 0
darkorchid#9932cc153, 50, 204
darkred#8b0000139, 0, 0
darksalmon#e9967a233, 150, 122
darkseagreen#8fbc8f143, 188, 143
darkslateblue#483d8b72, 61, 139
darkslategray#2f4f4f47, 79, 79
darkturquoise#00ced10, 206, 209
darkviolet#9400d3148, 0, 211
deeppink#ff1493255, 20, 147
deepskyblue#00bfff0, 191, 255
dimgray#696969105, 105, 105
dodgerblue#1e90ff30, 144, 255
firebrick#b22222178, 34, 34
floralwhite#fffaf0255, 250, 240
forestgreen#228b2234, 139, 34
fuchsia#ff00ff255, 0, 255
gainsboro#dcdcdc220, 220, 220
ghostwhite#f8f8ff248, 248, 255
gold#ffd700255, 215, 0
goldenrod#daa520218, 165, 32
gray#808080128, 128, 128
green#0080000, 128, 0
greenyellow#adff2f173, 255, 47
honeydew#f0fff0240, 255, 240
hotpink#ff69b4255, 105, 180
indianred#cd5c5c205, 92, 92
indigo#4b008275, 0, 130
ivory#fffff0255, 255, 240
khaki#f0e68c240, 230, 140
lavender#e6e6fa230, 230, 250
lavenderblush#fff0f5255, 240, 245
lawngreen#7cfc00124, 252, 0
lemonchiffon#fffacd255, 250, 205
lightblue#add8e6173, 216, 230
lightcoral#f08080240, 128, 128
lightcyan#e0ffff224, 255, 255
lightgoldenrodyellow#fafad2250, 250, 210
lightgray#d3d3d3211, 211, 211
lightgreen#90ee90144, 238, 144
lightpink#ffb6c1255, 182, 193
lightsalmon#ffa07a255, 160, 122
lightseagreen#20b2aa32, 178, 170
lightskyblue#87cefa135, 206, 250
lightslategray#778899119, 136, 153
lightsteelblue#b0c4de176, 196, 222
lightyellow#ffffe0255, 255, 224
lime#00ff000, 255, 0
limegreen#32cd3250, 205, 50
linen#faf0e6250, 240, 230
magenta#ff00ff255, 0, 255
maroon#800000128, 0, 0
mediumaquamarine#66cdaa102, 205, 170
mediumblue#0000cd0, 0, 205
mediumorchid#ba55d3186, 85, 211
mediumpurple#9370db147, 112, 219
mediumseagreen#3cb37160, 179, 113
mediumslateblue#7b68ee123, 104, 238
mediumspringgreen#00fa9a0, 250, 154
mediumturquoise#48d1cc72, 209, 204
mediumvioletred#c71585199, 21, 133
midnightblue#19197025, 25, 112
mintcream#f5fffa245, 255, 250
mistyrose#ffe4e1255, 228, 225
moccasin#ffe4b5255, 228, 181
navajowhite#ffdead255, 222, 173
navy#0000800, 0, 128
oldlace#fdf5e6253, 245, 230
olive#808000128, 128, 0
olivedrab#6b8e23107, 142, 35
orange#ffa500255, 165, 0
orangered#ff4500255, 69, 0
orchid#da70d6218, 112, 214
palegoldenrod#eee8aa238, 232, 170
palegreen#98fb98152, 251, 152
paleturquoise#afeeee175, 238, 238
palevioletred#db7093219, 112, 147
papayawhip#ffefd5255, 239, 213
peachpuff#ffdab9255, 218, 185
peru#cd853f205, 133, 63
pink#ffc0cb255, 192, 203
plum#dda0dd221, 160, 221
powderblue#b0e0e6176, 224, 230
purple#800080128, 0, 128
rebeccapurple#663399102, 51, 153
red#ff0000255, 0, 0
rosybrown#bc8f8f188, 143, 143
royalblue#4169e165, 105, 225
saddlebrown#8b4513139, 69, 19
salmon#fa8072250, 128, 114
sandybrown#f4a460244, 164, 96
seagreen#2e8b5746, 139, 87
seashell#fff5ee255, 245, 238
sienna#a0522d160, 82, 45
silver#c0c0c0192, 192, 192
skyblue#87ceeb135, 206, 235
slateblue#6a5acd106, 90, 205
slategray#708090112, 128, 144
snow#fffafa255, 250, 250
springgreen#00ff7f0, 255, 127
steelblue#4682b470, 130, 180
tan#d2b48c210, 180, 140
teal#0080800, 128, 128
thistle#d8bfd8216, 191, 216
tomato#ff6347255, 99, 71
turquoise#40e0d064, 224, 208
violet#ee82ee238, 130, 238
wheat#f5deb3245, 222, 179
white#ffffff255, 255, 255
whitesmoke#f5f5f5245, 245, 245
yellow#ffff00255, 255, 0
yellowgreen#9acd32154, 205, 50

Contributing

Contributions are welcome! Please feel free to submit a pull request or open an issue if you have suggestions for improvements.

License

This project is licensed under the MIT License.

Reviews

No reviews yet

Sign in to write a review