Nearest Tailwind Colors MCP
Earlier this year I built nearest-tailwind-colors, a helper to find the closest Tailwind palette entries to any CSS color. I wrote about it here. This post is the follow-up: I wrapped that helper in a simple MCP server so your agents can do the lookup for you.
The server exposes a single tool: nearest_tailwind_colors. You give it a color (any CSS format), optionally how many results you want (n), colors to skip (excludeColors), and the comparison space (lab by default, but oklab, lch, and others are available). It replies with the Tailwind token, hex value, and distance score.
Setup is simple. Clone the repo, install deps, and build:
1git clone https://github.com/brunocpf/nearest-tailwind-colors-mcp.git
2cd nearest-tailwind-colors-mcp
3npm install
4npm run build
Point your MCP host at dist/index.js. For Claude (CLI and Desktop), Cursor, or the VS Code MCP extension, add a server entry that runs node /absolute/path/to/nearest-tailwind-colors-mcp/dist/index.js and reload. For Codex (CLI or VS Code), add a block to ~/.codex/config.toml with the same command (wrap it in nvm use if you need Node 18+).
Using it feels like the original helper, but inside your chat. Ask: “Find the 5 Tailwind colors closest to one in the YouTube logo” The response comes back structured, so you can chain it into other tools—perfect for theme exploration or quick design token audits. If you need to avoid certain hues, pass excludeColors; if you want a longer list, bump n; if you care about a specific color model, switch space. A neat use case is to ask the agent to replace a color in your CSS with the closest Tailwind color custom property (ie, var(--color-<name>-<shade>) or a color-mix representation), making it easy to progressively adopt Tailwind in your projects.
It still leans on nearest-tailwind-colors and zod-validated schemas, but now it speaks MCP over stdio, so any host that can spawn Node can use it. I hope this makes it easier to keep Tailwind palette picks in the loop while you’re iterating in an agent. If you try it, let me know what workflows it unlocks for you.