colors-mcp-server
v2.1.1MCP server that gives AI agents exact color math, accessibility checks and ready-made palettes — built for small models.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
colors_check Check contrast
Check WCAG 2 contrast for text/background color pairs and say PASS or FAIL for each, with the exact ratio and, for failures, a nearby passing color. Also gives the signed APCA Lc (APCA-W3 0.98G-4g: positive for dark text on light, negative for light on dark). Use whenever you must know if colors are readable or accessible. Handles translucent colors. Pass foreground+background, or pairs for many.
| Parameter | Type | Description |
|---|---|---|
background | string | Background color, for a single check. Any CSS color. |
base | string | Color that translucent backgrounds are composited over. Default "#ffffff". |
foreground | string | Text color, for a single check. Any CSS color. |
level | string | WCAG level. Default "AA". |
pairs | array | Several checks at once: a list of {foreground, background}. Use instead of foreground/background. |
size | string | "normal" text (default), "large" text (24px or 18.66px bold and up), or "ui" for non-text parts like borders and icons. |
colors_fix Fix contrast
Make a text color readable: returns the closest color (same hue) that reaches the target contrast ratio on the given background. Use after a contrast check fails, or to pick an accessible text color. The background stays fixed. Returns one hex color and its verified ratio.
| Parameter | Type | Description |
|---|---|---|
background * | string | The background color it sits on. Any CSS color. |
foreground * | string | The text color that is too low in contrast. Any CSS color. |
keepHue | boolean | Keep the original hue (within 15 degrees) so the color still reads as the same one. Default true. |
target | number | Minimum contrast ratio to reach. 4.5 = WCAG AA text (default), 3 = large text or UI parts, 7 = AAA text. |
colors_palette Build a palette
Build a finished color palette with verified accessibility. kind "ramp": an 11-step tonal scale of a color (lightest to darkest, the seed is one step, evenly spaced). kind "theme": light and dark UI tokens (background, surface, surface-raised, text, text-muted, border, primary, on-primary) from a brand color, with every text contrast rule checked. kind "categorical": N clearly different, color-blind-safe colors for charts. kind "diverging": a scale from `color` through a light neutral to `color2`, with symmetric lightness. Returns hex values ready to use.
| Parameter | Type | Description |
|---|---|---|
kind * | string | "ramp" = tonal scale (50..950) of one color; "theme" = light + dark UI tokens from a brand color; "categorical" = a set of clearly different colors for charts or tags; "diverging" = a scale from one c… |
background | string | Categorical only: the background the colors sit on. Default "#ffffff". |
color | string | Seed color. Required for "ramp" and "theme" (the brand color) and for "diverging" (the left end). Ignored for "categorical". |
color2 | string | "diverging" only: the color at the right end. |
count | integer | Categorical only: how many colors. Default 5. |
cvd | string | Categorical only: color-blindness types the set must survive. Default "all" (protan, deutan, tritan). |
steps | integer | Ramp: number of steps, default 11 (named 50, 100 ... 950). Diverging: an odd number of steps, default 7. |
colors_find Find colors that meet rules
Find colors that satisfy your rules in one call. Combine any of: hue band (or the hue family of a color), chroma range, lightness range, contrast against one or more backgrounds (`against`), and for several colors a minimum lightness gap, hue gap or color difference (optionally color-blind safe). Returns verified hex colors with the most margin, or says which rule cannot be met.
| Parameter | Type | Description |
|---|---|---|
against | array | Every found color must reach the ratio against each of these colors, for example a light and a dark surface. |
chromaMax | number | Maximum OKLCH chroma. |
chromaMin | number | Minimum OKLCH chroma (0 gray, 0.1 muted, 0.2 vivid). |
count | integer | How many colors to find. Default 1. |
cvd | string | Several colors: also keep every pair apart (minDeltaE) under this color blindness. "all" covers the three common types. Default "none". |
hueMax | number | OKLCH hue band end, degrees 0-360. |
hueMin | number | OKLCH hue band start, degrees 0-360 (red 30, yellow 100, green 145, cyan 200, blue 260, purple 305, pink 350). If hueMin is above hueMax the band wraps through 0. |
hueOf | string | Instead of hueMin/hueMax: keep the found colors in the hue family of this color (for example the brand color). The band is its OKLCH hue plus or minus hueWithin. |
hueWithin | number | Degrees either side of hueOf. Default 20. |
lightnessMax | number | Maximum OKLCH lightness. |
lightnessMin | number | Minimum OKLCH lightness, 0 black to 1 white. |
minDeltaE | number | Several colors: minimum CIEDE2000 difference between every pair. Default 15 when no other pair rule is given. |
minHueGap | number | Several colors: minimum OKLCH hue difference in degrees between every pair of colorful colors. |
minLightnessGap | number | Several colors: minimum OKLab lightness difference between every pair (keeps them apart in grayscale). |
colors_scrim Smallest overlay for legible text on an image
Text over a photo: find the smallest overlay (scrim) opacity at which the text reaches a contrast ratio on every worst-case region of the image. Painted like CSS, on 8-bit channels. Returns the opacity and the ratio on each region.
| Parameter | Type | Description |
|---|---|---|
overlay * | string | Overlay (scrim) color, usually black, white or a brand color. Any CSS color: "#3b82f6", "rgb(59 130 246)", "oklch(0.62 0.19 260)", "tomato". |
regions * | array | Colors of the busiest or worst-case parts of the image behind the text. A list, even for a single color. Any CSS color strings. |
text * | string | Text color that sits on the image. Any CSS color: "#3b82f6", "rgb(59 130 246)", "oklch(0.62 0.19 260)", "tomato". |
step | number | Opacity grid, for example 0.05. Default 0.05. |
target | number | Contrast ratio the text must reach on every region. Default 4.5. |
colors_audit Audit CSS colors
Scan CSS for color problems and return exact findings: "text-contrast-aa" (color on background below 4.5:1), "nontext-contrast-3" (border-color on background below 3:1) and "near-duplicate-token" (two :root custom-property colors almost identical, ΔE00 under 2). Resolves var(--x) from :root. Use for any stylesheet or design review.
| Parameter | Type | Description |
|---|---|---|
css * | string | The CSS text to audit (rules and :root custom properties). Not a file path. |
colors_info Describe or validate colors
Validate color strings and describe each: hex, rgb, hsl, oklch, closest CSS name, how light it is, whether it fits sRGB, and contrast against white and black (so you can pick black or white text). Use to check that an input is a real color, or to understand an unfamiliar color. Bad inputs are reported per color, with a suggestion.
| Parameter | Type | Description |
|---|---|---|
colors * | array | Colors to describe or validate. A list, even for a single color. Any CSS color strings. |
colors_convert Convert colors
Convert colors to another format: hex, rgb, hsl, hwb, hsv, oklch, oklab, CSS lab/lch (D50), lab-d65/lch-d65 (CIELAB, D65, no adaptation), xyz (D65), linear (linear sRGB), p3, rec2020 (CSS, 2.4 gamma), rec2020-oetf (BT.2020 transfer) or rec2020-linear. Reads any of them as input. Handles lists. A color outside sRGB (for hex/rgb/hsl/hwb) is mapped in by lowering chroma only, and the result says so.
| Parameter | Type | Description |
|---|---|---|
colors * | array | Colors to convert. A list, even for a single color. Any CSS color strings. |
to * | string | Target format. "lab"/"lch" are the CSS ones (D50); "lab-d65"/"lch-d65" use the D65 white, no adaptation. "xyz" is D65, "linear" is linear sRGB, "p3" is display-p3, "rec2020" has a 2.4 gamma, "rec2020-… |
precision | integer | Decimal places. Default 3. |
colors_compare Compare colors
Measure how different colors look from a reference: CIEDE2000 (ΔE00, default), CIE94, CIE76 or Oklab distance, or all of them at once. Returns the nearest candidate and a full ranking, closest first. Use for 'which color is closest', 'are these the same color', or matching to a palette. Under 1 is not noticeable; over 10 is very different.
| Parameter | Type | Description |
|---|---|---|
candidates * | array | Colors to compare against the reference. A list, even for a single color. Any CSS color strings. |
color * | string | The reference color. Any CSS color: "#3b82f6", "rgb(59 130 246)", "oklch(0.62 0.19 260)", "tomato". |
metric | string | "ciede2000" (default, ΔE00), "cie94" (graphic-arts weights, reference chroma), "cie76" (Euclidean in CIELAB), "oklab" (Euclidean in Oklab) or "all" (every metric; ranked by ΔE00). Lab is D65, no ada… |
colors_blend Blend or build a gradient
Mix colors or build a gradient between 2+ colors. Returns evenly spaced hex colors with both endpoints included, interpolated in OKLCH so midpoints stay clean (no gray mud). Set `at` for one mixed color (0.5 = even mix). Always in sRGB gamut.
| Parameter | Type | Description |
|---|---|---|
colors * | array | The colors to blend between, in order. 2 to 8 stops. A list, even for a single color. Any CSS color strings. |
at | number | Return just ONE blended color at this position between the first two colors (0 = first, 0.5 = even mix, 1 = second). Overrides steps. |
space | string | Interpolation space. "oklch" (default) keeps colors vivid and takes the shorter hue path; "oklab" is smooth but can dull; "srgb" matches old CSS gradients and goes muddy between far-apart hues; "srgb-… |
steps | integer | How many colors to return, endpoints included. Default 5. |
colors_adjust Adjust colors
Make colors lighter, darker, more or less colorful, or rotate the hue, by exact OKLCH amounts. Changes only the property you name; the result is always a valid sRGB hex (chroma is lowered if the color would leave the gamut). Examples: {property:"lightness",mode:"add",amount:-0.1}; {property:"hue",mode:"add",amount:40}; {property:"chroma",mode:"multiply",amount:0.6}.
| Parameter | Type | Description |
|---|---|---|
amount * | number | The number to add, multiply by, or set. Lightness and chroma are on the OKLCH scale (add -0.1 lightness = a bit darker); hue is in degrees. |
colors * | array | Colors to adjust. A list, even for a single color. Any CSS color strings. |
property * | string | What to change, in OKLCH: lightness (0 black to 1 white), chroma (colorfulness, about 0 to 0.4), or hue (degrees, 0 to 360). |
mode | string | "add" the amount (negative lowers it), "multiply" by the amount (0.5 halves chroma), or "set" the property to the amount. Default "add". |
colors_harmony Color harmony
Generate a color scheme from a base color by rotating its OKLCH hue (complementary, split-complementary, triadic, tetradic, analogous) while keeping lightness and chroma matched. Returns hex colors with their hue offsets; the base is included at offset 0. OKLCH hue steps look even, unlike HSL angles.
| Parameter | Type | Description |
|---|---|---|
color * | string | The base color. Any CSS color: "#3b82f6", "rgb(59 130 246)", "oklch(0.62 0.19 260)", "tomato". |
scheme * | string | Color scheme: complementary (hue offsets 0, 180); split-complementary (hue offsets 0, 150, 210); triadic (hue offsets 0, 120, 240); tetradic (hue offsets 0, 90, 180, 270); analogous (hue offsets -30,… |
colors_vision Color blindness simulation
Simulate how colors look with color blindness (Machado 2009 model) and, for 2+ colors, measure whether the set stays distinguishable: returns the weakest pair per vision type. Use to check chart or status colors, or to find out if red/green pairs will collide. To BUILD a color-blind-safe set use colors_palette with kind "categorical".
| Parameter | Type | Description |
|---|---|---|
colors * | array | Colors to simulate (and compare with each other). A list, even for a single color. Any CSS color strings. |
minDifference | number | A pair counts as distinguishable when its CIEDE2000 difference is at least this. Default 10. |
type | string | Which color vision to simulate. "deuteranopia" and "protanopia" are red-green; "tritanopia" is blue-yellow; "achromatopsia" is no color; "all" (default) runs all four. |