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 整合