Tailwind Shades

io.github.bourhaouta由 GitHub 账号 bourhaouta 发布v1.6.0更新于 Oct 24, 2026

Tailwind CSS palettes (50-950) from any color, the closest Tailwind color, and Tailwind's defaults

发布方自己的服务:Tailwind App

已验证Streamable HTTP可网页运行开发者工具媒体与设计

概览

AI 生成的概览

一个 MCP 服务器,为助手提供真实的 Tailwind CSS 调色板:从任意颜色生成 50-950 色阶、查找最接近的默认色阶,并查询或列出 Tailwind 默认颜色。

可以做什么
从任意 CSS 颜色生成完整的 50-950 Tailwind 调色板,支持 theme、config、CSS、live 和 Shopify 输出,并在注释中给出符合 WCAG AA 的可读配色对。查找与给定颜色最接近的 Tailwind 默认色阶,并判断差异是否肉眼可见。查询 Tailwind 自带的默认颜色或单个色阶,覆盖 v4、v3、v2 和 v1。列出某个版本的默认颜色名称及其色阶和 500 色值示例。将任意 CSS 颜色转换为 oklch()、hex 和 rgb。
适用场景
适合助手编辑 Tailwind 主题、需要避免凭空编造色阶或凭记忆写默认颜色值的场景。可用于把品牌色作为完整调色板加入、选择已有工具类而非任意值,或为 v4 项目转换单个颜色。
运行要求
可使用远程 Streamable HTTP 端点(无需 API 密钥),或用 npx 运行本地 npm 包,后者需要 Node.js 20 或更高版本。未声明任何环境变量或请求头。
安装前请注意
五个工具均为只读,但生成的调色板代码和 add_brand_color 提示会引导助手把代码粘贴进项目主题,接受前请检查改动。远程端点会把颜色输入发送给第三方主机;本地 npx 方式则保留在本机。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Tailwind Shades,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Web executable,通过 Streamable HTTP。 远程服务在工作区中配置后即可从网页运行时运行。

交给智能体安装

把这段提示词粘贴到 Claude Code、Codex、Cursor 等智能体,或 SourceWeft 对话中。智能体会读取该服务器的安装指南,先向你展示发布者、端点和登录方式,经你同意后再把它添加到你的客户端。密钥不会写进任何命令。

阅读 https://sourceweft.com/mcp/io.github.bourhaouta%2Ftailwindshades/install.md,并按其中说明把这个 MCP 服务器接入我的客户端。修改任何配置之前,先告诉我它的发布者、端点和登录方式,等我确认。不要把 API 密钥写进命令或我会提交的文件;问我密钥应从哪里获取。

查看智能体所依据的安装指南

其他 MCP 客户端

把它添加到你客户端的 mcpServers 配置中。

{
  "mcpServers": {
    "tailwind-shades": {
      "type": "http",
      "url": "https://tailwindshades.bourhaouta.com/mcp"
    }
  }
}

README

tailwindshades-mcp

[Tailwind Shades MCP connector – tool definition quality and endpoint health on Glama]

An MCP server that gives AI agents real Tailwind CSS palettes, so they stop guessing shades. Works with Tailwind v4, v3, v2 and v1.

Ask your agent "Add a brand color #db4d53 to my theme", and it writes a full 50 to 950 palette in the project's Tailwind format, with #db4d53 exactly at brand-500. Same engine as the Tailwind Shades editor extension and tailwindshades.bourhaouta.com.

Setup

Remote (nothing to install)

Connect your agent to https://tailwindshades.bourhaouta.com/mcp (Streamable HTTP, no API key).

Claude Code

sh
claude mcp add --transport http --scope user tailwindshades https://tailwindshades.bourhaouta.com/mcp

Cursor (~/.cursor/mcp.json, or .cursor/mcp.json in a project)

json
{  "mcpServers": {    "tailwindshades": { "url": "https://tailwindshades.bourhaouta.com/mcp" }  }}

VS Code (.vscode/mcp.json)

json
{  "servers": {    "tailwindshades": { "type": "http", "url": "https://tailwindshades.bourhaouta.com/mcp" }  }}

Local (stdio)

Runs on your machine with npx, so nothing leaves it. Needs Node.js 20 or later.

Claude Code

sh
claude mcp add --scope user tailwindshades -- npx -y tailwindshades-mcp

Cursor (~/.cursor/mcp.json, or .cursor/mcp.json in a project)

json
{  "mcpServers": {    "tailwindshades": { "command": "npx", "args": ["-y", "tailwindshades-mcp"] }  }}

VS Code (.vscode/mcp.json)

json
{  "servers": {    "tailwindshades": { "command": "npx", "args": ["-y", "tailwindshades-mcp"] }  }}

Other agents: use the URL above, or run npx -y tailwindshades-mcp as a stdio server. It's also in the MCP Registry as io.github.bourhaouta/tailwindshades.

Tools

All five tools are read-only.

generate_palette

A full palette from one color, ready to paste.

InputDefault
colorrequired: any CSS color (#db4d53, rgb(), hsl(), oklch(), a name)
namethe closest Tailwind color, which replaces Tailwind's own palette, so the tool warns
tailwindVersion4 (also 3, 2, 1)
formatoklch for v4, hex before (also rgb)
outputtheme for v4, config before (also css, and live and shopify for v4)
plain, semanticfalse: with live or shopify, a plain :root block instead of @theme, and a --color-<name>-foreground

live is for colors picked at runtime (a user, a tenant, a CMS setting): CSS where every shade follows one variable, rebuilt in the browser. shopify adds the color setting and Liquid line for Shopify themes, where the merchant picks the color in the theme editor. See Colors picked at runtime.

Returns the code, plus the shades, the shade that holds the input color and the closest Tailwind color as structured data.

The code starts with a comment of readable pairs: text and background classes that pass WCAG AA (4.5:1), tested on the real shades. Agents use them for buttons and text, so a red brand gets bg-brand-600 text-white instead of the failing bg-brand-500 text-white:

css
/* Readable pairs (WCAG AA, 4.5:1 or more):   button     bg-brand-600 text-white      5.09:1   text       bg-white text-brand-600      5.09:1   badge      bg-brand-100 text-brand-700  5.43:1   dark mode  bg-brand-950 text-brand-400  5.33:1   avoid      bg-brand-500 text-white      4.03:1 */

find_closest_tailwind_color

The Tailwind shade that looks most like a color, e.g. #db4d53 → red-500, with Tailwind's value, the distance, and whether the difference is visible. Agents use it to pick an existing class instead of an arbitrary value, or to decide a custom palette is needed.

get_tailwind_palette

Tailwind's own default colors, exactly as Tailwind defines them: a whole color (blue) or one shade (slate-500), for Tailwind v4, v3, v2 or v1. Values are oklch() in v4 and hex before. Agents use it instead of writing Tailwind's default values from memory.

list_tailwind_colors

The names of Tailwind's default colors for a version (26 in v4, including mauve, olive, mist and taupe), with the shades they have and each one's 500 value as a sample.

convert_color

Any CSS color as oklch(), hex and rgb, formatted like Tailwind. Handy when a project on Tailwind v4 needs one oklch() value rather than a whole palette.

Prompt

add_brand_color

Arguments: color and an optional name (default brand). It asks the agent to find the project's Tailwind version, call generate_palette, and paste the code into the theme. Clients like Claude Code show it as a slash command.

Host it yourself

The package also exports createServer(), a fresh McpServer with all its tools and the prompt. Serve it with the MCP TypeScript SDK, for example over HTTP in any web-standard runtime (this is how the remote server above runs, as a Next.js route):

ts
import { createMcpHandler } from '@modelcontextprotocol/server'import { createServer } from 'tailwindshades-mcp'
const handler = createMcpHandler(createServer)
export const POST = (request: Request) => handler.fetch(request)

More

License

MIT © Omar Bourhaouta

来源:packages/mcp/README.md,提交 eeac0d1

工具

5

generate_palette

Generate a Tailwind palette

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.

输入参数namecolor必填plainformatoutputsemantictailwindVersion

find_closest_tailwind_color

Find the closest Tailwind color

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.

输入参数color必填tailwindVersion

get_tailwind_palette

Get Tailwind's default colors

Looks up Tailwind's own default colors, exactly as Tailwind defines them: a whole color (e.g. "blue", all shades) or one shade (e.g. "slate-500"), for Tailwind v4, v3, v2 or v1. Use it instead of writing default Tailwind color values from memory. Values are oklch() in v4 and hex in older versions.

输入参数name必填tailwindVersion

list_tailwind_colors

List Tailwind's default colors

Lists the names of Tailwind's default colors for a Tailwind version (e.g. red, slate, mauve in v4), with the shades each one has and its 500 value as a sample. Use it to see which colors exist before calling get_tailwind_palette or picking a utility class.

输入参数tailwindVersion

convert_color

Convert a color

Converts any CSS color to oklch(), hex and rgb, formatted like Tailwind (oklch() is what Tailwind v4 uses). Colors outside a format are mapped into it: oklch() to Display P3 like Tailwind's palette, hex and rgb to sRGB. Use it for one value; to add a color with all its shades, call generate_palette instead.

输入参数color必填

版本历史

6
  1. v1.6.0最新Oct 13, 2026
  2. v1.5.1Oct 7, 2026
  3. v1.4.0Oct 3, 2026
  4. v1.3.0Oct 1, 2026
  5. v1.2.0Oct 1, 2026
  6. v1.1.0Oct 1, 2026

评分

已满足适用检查项的 100%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通必需25 分
  • 已声明认证方式必需10 分
  • 已列出工具必需15 分
  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分

其他 Tailwind 集成