tailwindshades-mcp
Generates complete Tailwind CSS color palettes (shades 50–950) from any input color, matching the project's Tailwind version (v4, v3, v2, v1). Provides tools to produce ready-to-paste palette code (e.g. a v4 @theme block, a v3 tailwind.config.js entry, or CSS variables) and to find the closest existing Tailwind color class to a given color (e.g. #db4d53 → red-500).
Tailwind CSS Shades
Generate a full Tailwind CSS color palette (50 to 950) from any color, right in your editor. Works with Tailwind v4, v3, v2 and v1.
VS Code Marketplace · Open VSX (Cursor, Windsurf, VSCodium)
Also as a command line tool and an MCP server for AI agents, with the same palettes. Try it in the browser: tailwindshades.bourhaouta.com.
Usage
Select a color, or just put the cursor on it:
#db4d53,rgb(…),hsl(…),oklch(…)or a CSS color name.Press Cmd+K Cmd+G (macOS) or Ctrl+K Ctrl+G, or run Tailwind Shades: Generate color palette from the Command Palette.
Pick a name. The closest Tailwind color is suggested; type your own (like
brand) to keep Tailwind's color too.
With no color under the cursor, the extension asks you for one.
Tailwind v4 (CSS file)
@theme {
--color-brand-50: oklch(97.1% 0.01 13.669);
--color-brand-100: oklch(93.2% 0.024 14.006);
--color-brand-200: oklch(87.7% 0.046 14.623);
--color-brand-300: oklch(79.5% 0.085 15.86);
--color-brand-400: oklch(68.7% 0.143 18.505);
--color-brand-500: oklch(61.6% 0.177 21.62);
--color-brand-600: oklch(56% 0.183 23.614);
--color-brand-700: oklch(49.2% 0.159 23.807);
--color-brand-800: oklch(43.6% 0.133 23.188);
--color-brand-900: oklch(39.2% 0.106 22.012);
--color-brand-950: oklch(25.8% 0.069 22.331);
}Already inside an @theme { … } block? Only the variables are added.
Tailwind v3 (tailwind.config.js)
brand: {
50: '#fdf2f3',
100: '#fae2e3',
200: '#f6c9cc',
300: '#efa5a9',
400: '#e7757a',
500: '#db4d53',
600: '#ca373c',
700: '#aa2c30',
800: '#8d272b',
900: '#772528',
950: '#411012',
},Related MCP server: MCP Color Converter
How the shades are made
The palette follows Tailwind's own colors instead of simply mixing with white and black:
It finds the Tailwind color closest to yours, and copies how that color's lightness, saturation and hue change from light to dark.
Your color stays exactly as it is, at the shade where it fits best. A light color can become
200, not always500.The math happens in OKLCH, the color space Tailwind v4 uses, so the steps look even to the eye.
Tailwind versions
The version is detected from your project, most reliable source first:
The closest
package.jsonwith atailwindcssdependencyThe current CSS file:
@import "tailwindcss",@theme,@utility,@plugin→ v4;@tailwind base;→ v3A
tailwind.config.js(or.ts,.cjs,.mjs) in the project → v3Other CSS files in the project, with the same hints as step 2
If nothing is found, v4 is used. The status bar tells you which version was used and why, e.g. v3 from tailwind.config.js.
Version | Shades | In CSS files | In JS/TS files | Colors |
v4 | 50–950 |
| config object | OKLCH |
v3 | 50–950 | CSS variables | config object | hex |
v2 | 50–900 | CSS variables | config object | hex |
v1 | 100–900 | CSS variables | config object | hex |
Each version uses its own default palette as the reference, so a v1 palette looks like v1 colors.
Commands
Command | What it does |
Generate color palette | Picks the version and output for you (see above). Shortcut: Ctrl/Cmd+K Ctrl/Cmd+G |
Generate color palette (choose version and output)… | Asks which Tailwind version and output to use |
Generate color palette as CSS variables | Always writes |
Settings
Setting | Default | Options |
|
|
|
|
|
|
|
|
|
|
| Ask for the color name |
Command line
The same palettes, without an editor:
npx tailwindshades-cli "#db4d53" --name brandOption | Values | Default |
| letters, digits and dashes | the closest Tailwind color |
|
|
|
|
|
|
|
|
|
The palette goes to stdout, so you can add it to a file: npx tailwindshades-cli db4d53 -o css >> colors.css. More in the package README.
Use it with AI agents
AI coding agents often guess Tailwind shades, or add one --color-brand line instead of a palette. The tailwindshades-mcp server gives them two tools:
generate_palette: the same palette code as the extension, for the project's Tailwind versionclosest_tailwind_color: the Tailwind class closest to a color (e.g.#db4d53→red-500), and whether the difference is visible
Then ask things like "Add a brand color #db4d53 to my theme".
Remote, nothing to install: connect to https://tailwindshades.bourhaouta.com/mcp.
Claude Code
claude mcp add --transport http --scope user tailwindshades https://tailwindshades.bourhaouta.com/mcpCursor (~/.cursor/mcp.json, or .cursor/mcp.json in a project)
{
"mcpServers": {
"tailwindshades": { "url": "https://tailwindshades.bourhaouta.com/mcp" }
}
}VS Code (.vscode/mcp.json)
{
"servers": {
"tailwindshades": { "type": "http", "url": "https://tailwindshades.bourhaouta.com/mcp" }
}
}Local: run npx -y tailwindshades-mcp as a stdio server instead, for example claude mcp add --scope user tailwindshades -- npx -y tailwindshades-mcp. Setup for each agent is in the package README.
It's also in the MCP Registry as io.github.bourhaouta/tailwindshades, with both options.
Development
An npm workspace: the extension is at the root, the palette engine and CLI in packages/core, the MCP server in packages/mcp, and the website with the remote MCP endpoint (/mcp) in apps/web (npm run dev -w apps/web).
npm install
npm run check # type check + tests
npm run build # bundle the extension to dist/Press F5 in VS Code to try the extension in a new window. After upgrading a tailwindcss dev dependency, run npm run palette to refresh the reference palettes. After an engine change, node media/demo/record.mjs re-records the demo GIF (see the file for setup).
License
MIT © Omar Bourhaouta
Available Tools
2 toolsclosest_tailwind_colorFind the closest Tailwind colorARead-onlyIdempotentInspect
Finds the shade in Tailwind's default palette that looks most like a given color, e.g. #db4d53 -> red-500. Use it to pick an existing Tailwind class (bg-red-500) instead of an arbitrary value. If the difference is visible, use generate_palette to add the exact color as a custom palette instead.
| Name | Required | Description | Default |
|---|---|---|---|
| color | Yes | Any CSS color: hex (#db4d53), rgb(), hsl(), oklch() or a named color | |
| tailwindVersion | No | The project's Tailwind CSS major version. Defaults to 4 |
Output Schema
| Name | Required | Description |
|---|---|---|
| name | Yes | Tailwind color name, e.g. "red" |
| input | Yes | The input color |
| shade | Yes | Closest shade, e.g. 500 |
| distance | Yes | OKLab distance: 0 is identical, under 0.02 is hard to see |
| className | Yes | Color part of a utility class, e.g. "red-400" for bg-red-400 |
| tailwindValue | Yes | Tailwind's value for that shade |
| tailwindVersion | Yes | |
| visiblyDifferent | Yes | True when the Tailwind shade looks different from the input |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint, idempotentHint and closed-world, so the safety profile is covered. The description adds real value beyond that by explaining the intent (prefer a palette class over an arbitrary value) and the fallback pathway, though it doesn't discuss precision/tie-breaking behavior for near-equal shades.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Three tight sentences, front-loaded with the core behavior and followed by decision guidance. No filler, and the example is embedded efficiently.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
An output schema exists, so return-value explanation isn't required, yet the description still previews the result shape (red-500). For a simple two-parameter read tool with full schema coverage, nothing an agent needs in order to call it correctly is missing.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100% – both the color format list and the tailwindVersion enum with default are fully documented in the schema. The description's example color reinforces but adds no syntax detail beyond what the schema provides, so the baseline 3 applies.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb and resource ('finds the shade in Tailwind's default palette') and grounds it with a concrete example mapping (#db4d53 -> red-500). It is clearly distinguishable from the sibling generate_palette, which is named as the alternative.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicit guidance: use this to pick an existing Tailwind class instead of an arbitrary value, and switch to generate_palette when the visual difference is noticeable. The when/when-not split is unambiguous.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
generate_paletteGenerate a Tailwind paletteARead-onlyIdempotentInspect
Generates a full Tailwind CSS palette (50-950) from one color, ready to paste. Call it whenever you add a color to a Tailwind theme (e.g. "add a brand color #db4d53"), instead of writing a single variable or inventing shades. The input color stays exactly at its best-fit shade, and the other shades follow the closest Tailwind color, so they look like Tailwind's own.
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | Color name used in the code, e.g. "brand". Defaults to the closest Tailwind color, which replaces Tailwind's own palette of that name (e.g. red), so pass a name unless that is what the user wants | |
| color | Yes | Any CSS color: hex (#db4d53), rgb(), hsl(), oklch() or a named color | |
| format | No | Color format. Defaults to oklch for v4 and hex for older versions | |
| output | No | theme: a v4 @theme block for the main CSS file. config: an object for theme.extend.colors in tailwind.config.js. css: plain CSS variables. Defaults to theme for v4 and config for older versions | |
| tailwindVersion | No | The project's Tailwind CSS major version. Defaults to 4 |
Output Schema
| Name | Required | Description |
|---|---|---|
| code | Yes | The palette as code, ready to paste |
| name | Yes | |
| format | Yes | |
| output | Yes | |
| shades | Yes | |
| inputShade | Yes | Shade that holds the input color unchanged, e.g. 500 |
| tailwindVersion | Yes | |
| closestTailwindColor | Yes | Tailwind color whose curve the palette follows |
| replacesTailwindColor | Yes | True when the code replaces a default Tailwind palette (default color name, theme or config output) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint, idempotentHint and a closed world, so the safety profile is covered. The description adds genuine behavioral context beyond that: the input color is preserved at its best-fit shade while the remaining shades are derived from the closest Tailwind color, so the agent knows output is deterministic and visually consistent.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Three sentences, front-loaded with what is produced, then the trigger condition, then a behavioral guarantee. No filler or repetition of schema content.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
An output schema exists, so return-value shape need not be restated. For a single-shot, five-parameter generation tool with fully documented params and annotations, the description covers everything an agent needs to select and invoke it correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so every parameter (name, color, format, output, tailwindVersion) is already documented with defaults and enums in the schema itself. The description adds no syntax or format detail beyond that, so the baseline of 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb and resource with scope: generates a full Tailwind CSS palette (50-950) from one color, ready to paste. It also contrasts the tool with the naive alternative (writing a single variable or inventing shades), so an agent can tell why this exists rather than reaching for closest_tailwind_color.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicit trigger: 'Call it whenever you add a color to a Tailwind theme' with a concrete example prompt. It names the anti-pattern to avoid ('instead of writing a single variable or inventing shades'), giving clear when-to-use and when-not-to-use guidance.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
2 tool updates
v0.1.0- First observed
closest_tailwind_color - First observed
generate_palette
TDQS
Scored across 2 tools
The two tools target distinct decisions: generate_palette creates a custom 50-950 scale from one color, while closest_tailwind_color maps a color to the nearest existing Tailwind shade. Descriptions explicitly tell the agent which to use based on whether the default shade is visually close enough.
Both names use snake_case and are descriptive, but the pattern is not strictly parallel: generate_palette follows verb_noun, while closest_tailwind_color omits an explicit verb. Still readable and predictable enough.
Two tools is slightly below the typical 3-15 range, but the server has a narrow, well-defined utility scope. Each tool earns its place and there is no redundant surface.
For a Tailwind color/palette helper, the core workflows are covered: either generate a custom palette or find an existing Tailwind class. Minor gaps could include bulk palette generation or color-format conversion, but no obvious dead end in the stated purpose.
Maintenance
Related MCP Connectors
Convert colours between hex, RGB, HSL, OKLCH and CMYK, and compute harmonies.
Generate design systems: OKLCH color palettes, fluid type scales, spacing, shape and icon tokens.
Solve, audit and simulate colorblind-safe chart palettes. WCAG contrast, OKLab ΔE. Read-only.
AI-agent design tools: fonts, font recognition, palettes, color naming, contrast, code, SVG, CSS.
Related MCP Servers
- AlicenseBqualityDmaintenanceEnables comprehensive color manipulation, conversion between 22+ formats (HEX, RGB, HSL, CMYK, LAB, etc.), palette generation, gradient creation, and accessibility compliance checking. Supports framework-specific outputs for CSS, Swift, Android, Flutter, and Tailwind with high-precision conversions and visualization capabilities.25MIT
- AlicenseNot gradedqualityDmaintenanceProvides comprehensive color conversion, manipulation, analysis, and WCAG accessibility tools supporting multiple formats (hex, rgb, hsl, oklch, oklab) for design systems and web development.14 npm2MIT
- FlicenseBqualityDmaintenanceFinds the closest Tailwind CSS palette colors to any given CSS color value. Supports multiple color spaces and customizable result filtering to help match designs to Tailwind's color system.1-
- AlicenseNot gradedqualityDmaintenanceA comprehensive toolkit for color conversion, manipulation, and accessibility analysis supporting formats like OkLCH and WCAG compliance. It enables AI agents to manage design systems by generating harmonious palettes, transforming color spaces, and performing contrast checks.2MIT