
Tailwind Context Resolver Mcp
io.github.vola-trebla由 GitHub 账号 vola-trebla 发布v0.2.0更新于 Oct 24, 2026
Resolves Tailwind CSS design tokens and validates utility classes against the local project config.
发布方自己的服务:Tailwind App
概览
让助手读取项目已解析的 Tailwind CSS v3 主题,并据此校验工具类字符串。
- 可以做什么
- 加载项目的 tailwind.config.js 或 .ts,并通过四个工具暴露解析后的设计系统。resolve_theme_tokens 返回某个命名空间(如 colors.brand、spacing)下的令牌;validate_class_string 把 className 字符串拆分为有效与无效类并提示冲突;detect_css_conflicts 报告相互冲突的工具类,例如 flex 与 grid;get_config_summary 报告 Tailwind 版本、前缀、被定制的主题分区和插件。校验基于令牌,而非完整的 PostCSS/JIT 流程。
- 适用场景
- 当助手在带有自定义调色板、间距刻度、前缀或品牌令牌的项目中编写 Tailwind 类时适用,可让它对照真实配置而非默认主题检查类名。最适合在已有的 Tailwind v3 代码库中做组件或界面相关工作。
- 运行要求
- 以 stdio 在本地运行,通常用 npx 启动。需要 Node.js 18+,以及项目中的 tailwind.config.js 或 tailwind.config.ts。仅支持 Tailwind CSS v3,v4 的 CSS 配置格式不受支持。未声明需要账号、API 密钥或环境变量。
安装
在 SourceWeft 中
- 打开 控制台中的 Tailwind Context Resolver Mcp,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
tailwind-context-resolver-mcp 🎨🐸
[npm version] [npm downloads] [CI] [License: MIT]
An MCP server that loads your project's tailwind.config.ts/js and exposes its actual design system to AI agents — so they stop hallucinating class names.
🤔 The Problem
AI agents generate Tailwind classes based on training data — the default Tailwind docs. Your project is not the default docs.
You have a custom color palette. A non-standard spacing scale. Maybe a prefix like tw-. Brand tokens like bg-brand-primary. The agent doesn't know any of this. It guesses.
The result:
The agent can't validate what it writes because it has no access to your resolved config. It's working from memory of the default theme — not yours.
✅ The Fix
This MCP server runs the Tailwind resolver locally and gives agents a typed, queryable interface to your actual config. Before writing a component, the agent can ask:
- "What brand colors exist in this project?"
- "Is
p-18a valid spacing value here?" - "Does this project use a custom prefix?"
- "Is
bg-brand-primary flex grida valid class string?"
🛠️ Tools
resolve_theme_tokens
Query any namespace in the resolved Tailwind theme. Returns all design tokens as flat key-value pairs.
Use before generating components to discover what tokens actually exist.
validate_class_string
Validates a Tailwind className string against the project's resolved config. Returns valid classes, invalid (hallucinated) classes, and conflict warnings.
Use to catch hallucinated design tokens before writing code.
detect_css_conflicts
Detects conflicting Tailwind utilities — e.g. flex + grid, or absolute + fixed on the same element.
get_config_summary
Returns a compact overview: Tailwind version, prefix, which theme sections are customized, active plugins.
Use first to understand the project's design system before querying specific tokens.
🚀 Setup
Claude Desktop
Add to your claude_desktop_config.json:
Cursor / VS Code / Any MCP client
📋 Requirements
- Tailwind CSS v3 — v4 uses a CSS-based config format and is not supported (the server will tell you clearly)
- Node.js 18+
- A
tailwind.config.jsortailwind.config.tsin your project
🔧 How It Works
The server uses the same config loading strategy as the Tailwind CLI:
jitiloads yourtailwind.config.tsat runtime — nots-noderequiredtailwindcss/resolveConfigmerges your config with Tailwind defaults to produce the full resolved theme- Tools perform token-based class validation — checking that
bg-brand-primarymaps to an actualcolors.brand.primarytoken — without running the full PostCSS/JIT pipeline
This approach is fast, stable, and works with any Tailwind v3 project without additional configuration.
📖 Agent Workflow Example
🐸 Part of the MCP Toolbelt
Built alongside:
- playwright-network-chaos-mcp — network fault injection for Playwright tests
- v8-cpu-profile-decoder-mcp — V8 CPU profile analysis for AI agents
License
MIT
来源:README.md,提交 2e58837
工具
0版本历史
1- v0.2.0最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分
其他 Tailwind 集成
Tailwind App
ai.tailwind官方发布者
让助手通过 Tailwind 列出 Pinterest 账号,并创建、安排和管理 Pinterest 帖子。
Tailwind Shades
由 GitHub 账号 bourhaouta 发布
一个 MCP 服务器,为助手提供真实的 Tailwind CSS 调色板:从任意颜色生成 50-950 色阶、查找最接近的默认色阶,并查询或列出 Tailwind 默认颜色。

Tailwind V4 Upgrade Blocker Lint
由 GitHub 账号 jmshinhwa 发布
一个本地 MCP 服务器,用 19 条规则检查文件中被 Tailwind v4 移除或重新定义的 v3 语法,帮助助手发现升级阻碍。